# This is my third day trying to install GCC

**URL:** <https://fortran-lang.discourse.group/t/this-is-my-third-day-trying-to-install-gcc/5569>\
**Category:** Help\
**Created:** [April 14, 2023, 12:48pm UTC](https://fortran-lang.discourse.group/t/this-is-my-third-day-trying-to-install-gcc/5569 "2023-04-14T12:48:21Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![Patrick](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/patrick/32/3170_2.png) [@Patrick](https://fortran-lang.discourse.group/u/Patrick)\
**Post date:** [April 14, 2023, 12:48pm UTC](https://fortran-lang.discourse.group/t/this-is-my-third-day-trying-to-install-gcc/5569/1 "2023-04-14T12:48:21Z")

</div>

After instalation my compiler is here:  
c:\users\pader\gcc\x86\_64-W64-mingw32

my test program is here: j:\x\trialOne.f90

If I attempt to compile I get this:

J:\>gfortran trialOne.f90 -o a.exe  
‘gfortran’ is not recognized as an internal or external command,  
operable program or batch file.

Should I open a DOS window and enter this: (???)  
set path=c:\users\pader\gcc\ %path%

Please no narrative, just tell me do this: . . . i.e. what to type in where,

---

<div class="post-metadata">

**Author:** ![Arjen](https://avatars.discourse-cdn.com/v4/letter/a/b9bd4f/32.png) [@Arjen](https://fortran-lang.discourse.group/u/Arjen)\
**Post date:** [April 14, 2023, 12:53pm UTC](https://fortran-lang.discourse.group/t/this-is-my-third-day-trying-to-install-gcc/5569/2 "2023-04-14T12:53:14Z")

</div>

Look for the directory that contains the executable “gfortran.exe” and fill in that name in the command. I do not think “c:\users\pader\gcc” is the one you need, but I am not sure whether you need to add “bin” at the end or 'x86\_64\_W64-mingw32".

---

<div class="post-metadata">

**Author:** ![Patrick](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/patrick/32/3170_2.png) [@Patrick](https://fortran-lang.discourse.group/u/Patrick)\
**Post date:** [April 14, 2023, 1:04pm UTC](https://fortran-lang.discourse.group/t/this-is-my-third-day-trying-to-install-gcc/5569/3 "2023-04-14T13:04:37Z")

</div>

This is where Gfortran is  
c:\users\pader\gcc\bin\gfortran  
So, opening a DOS window: what do I type in to create a path to the compiler?

Is it (???)  
set path=c:\users\pader\gcc\ gcc\bin;%path%  
or is it  
set path=c:\users\pader\gcc\ gcc\bin\gfortran;%path%

Supposing the path string is wrong. How do I get rid of it again later?

---

<div class="post-metadata">

**Author:** ![Arjen](https://avatars.discourse-cdn.com/v4/letter/a/b9bd4f/32.png) [@Arjen](https://fortran-lang.discourse.group/u/Arjen)\
**Post date:** [April 14, 2023, 1:24pm UTC](https://fortran-lang.discourse.group/t/this-is-my-third-day-trying-to-install-gcc/5569/4 "2023-04-14T13:24:49Z")

</div>

Use the first version of the “set path” command.

If you open a new command window, it will have the default environment variables.

And, do not get me wrong, but you could have tried these commands yourself and see whether the compiler can be found.

---

<div class="post-metadata">

**Author:** ![Patrick](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/patrick/32/3170_2.png) [@Patrick](https://fortran-lang.discourse.group/u/Patrick)\
**Post date:** [April 14, 2023, 1:37pm UTC](https://fortran-lang.discourse.group/t/this-is-my-third-day-trying-to-install-gcc/5569/5 "2023-04-14T13:37:32Z")

</div>

I certainly could have tried the statements, and I do respect you for saying so, but yesterday I crashed my system trying to get the compiler to run, and Microsoft repairing it, was busy a few hours, before it was running again.

I am grateful for your reply.

Supposing the path string is wrong. How do I get rid of it again later?

---

<div class="post-metadata">

**Author:** ![Carltoffel](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/carltoffel/32/1680_2.png) [@Carltoffel](https://fortran-lang.discourse.group/u/Carltoffel)\
**Post date:** [April 14, 2023, 1:55pm UTC](https://fortran-lang.discourse.group/t/this-is-my-third-day-trying-to-install-gcc/5569/6 "2023-04-14T13:55:35Z")

</div>

> [@Patrick](#):
>
> set path=c:\users\pader\gcc\ gcc\bin;%path%

Using the “set” command to modify the “PATH” environment variable makes only temporary changes that are effective only for the current session of the command prompt. Once you close the command prompt window or restart your computer, the changes will be lost.

---

<div class="post-metadata">

**Author:** ![Patrick](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/patrick/32/3170_2.png) [@Patrick](https://fortran-lang.discourse.group/u/Patrick)\
**Post date:** [April 14, 2023, 2:09pm UTC](https://fortran-lang.discourse.group/t/this-is-my-third-day-trying-to-install-gcc/5569/7 "2023-04-14T14:09:17Z")

</div>

Maybe that is why it did not work then?

---

<div class="post-metadata">

**Author:** ![Carltoffel](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/carltoffel/32/1680_2.png) [@Carltoffel](https://fortran-lang.discourse.group/u/Carltoffel)\
**Post date:** [April 14, 2023, 2:10pm UTC](https://fortran-lang.discourse.group/t/this-is-my-third-day-trying-to-install-gcc/5569/8 "2023-04-14T14:10:17Z")

</div>

Try the set command and directly after this type just `gfortran` into the same window.

---

<div class="post-metadata">

**Author:** ![Patrick](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/patrick/32/3170_2.png) [@Patrick](https://fortran-lang.discourse.group/u/Patrick)\
**Post date:** [April 14, 2023, 2:20pm UTC](https://fortran-lang.discourse.group/t/this-is-my-third-day-trying-to-install-gcc/5569/9 "2023-04-14T14:20:39Z")

</div>

C:\>set path=c:\users\pader\gcc\ gcc\bin;%path%

C:\>gfortran -c j:\x\trialOne.f90  
‘gfortran’ is not recognized as an internal or external command,  
operable program or batch file.

So what now?

---

<div class="post-metadata">

**Author:** ![Arjen](https://avatars.discourse-cdn.com/v4/letter/a/b9bd4f/32.png) [@Arjen](https://fortran-lang.discourse.group/u/Arjen)\
**Post date:** [April 14, 2023, 2:27pm UTC](https://fortran-lang.discourse.group/t/this-is-my-third-day-trying-to-install-gcc/5569/10 "2023-04-14T14:27:07Z")

</div>

The path you added is wrong: it should have been “c:\users\pader\gcc\bin”, you doubled the “gcc” bit.

As for your computer crashing: that is a rather unusual occurrence. I would not have expected that, as the software you installed is not likely to do much in the foundations of the operating system.

---

<div class="post-metadata">

**Author:** ![Patrick](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/patrick/32/3170_2.png) [@Patrick](https://fortran-lang.discourse.group/u/Patrick)\
**Post date:** [April 14, 2023, 2:43pm UTC](https://fortran-lang.discourse.group/t/this-is-my-third-day-trying-to-install-gcc/5569/11 "2023-04-14T14:43:32Z")

</div>

Yes that was dumb. More probs

C:\>gfortran -c j:\x\testOne.f90  
gfortran: error: j:\x\testOne.f90: No such file or directory  
gfortran: fatal error: no input files  
compilation terminated.

The system collapsing. It took hours to repair.  
And I thought the automatic repair was jolly clever of Microsoft

---

<div class="post-metadata">

**Author:** ![Arjen](https://avatars.discourse-cdn.com/v4/letter/a/b9bd4f/32.png) [@Arjen](https://fortran-lang.discourse.group/u/Arjen)\
**Post date:** [April 14, 2023, 3:12pm UTC](https://fortran-lang.discourse.group/t/this-is-my-third-day-trying-to-install-gcc/5569/12 "2023-04-14T15:12:11Z")

</div>

At the very least the compiler is running now 🙂

---

<div class="post-metadata">

**Author:** ![Beliavsky](https://avatars.discourse-cdn.com/v4/letter/b/ba8739/32.png) [@Beliavsky](https://fortran-lang.discourse.group/u/Beliavsky)\
**Post date:** [April 14, 2023, 4:09pm UTC](https://fortran-lang.discourse.group/t/this-is-my-third-day-trying-to-install-gcc/5569/13 "2023-04-14T16:09:48Z")

</div>

> [@Patrick](#):
>
> Yes that was dumb. More probs
> 
> C:\>gfortran -c j:\x\testOne.f90  
> gfortran: error: j:\x\testOne.f90: No such file or directory  
> gfortran: fatal error: no input files  
> compilation terminated.
> 
> The system collapsing. It took hours to repair.  
> And I thought the automatic repair was jolly clever of Microsoft

Does the file exist? What is the result of

`C:>dir j:\x\testOne.f90`

What if you move to the directory where the source file is supposed to be with

`C:>cd /d j:\x`

and then try `dir testOne.f90` or `gfortran testOne.f90`

To be a programmer you must understand the basics of how your operating system works.

---

<div class="post-metadata">

**Author:** ![Patrick](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/patrick/32/3170_2.png) [@Patrick](https://fortran-lang.discourse.group/u/Patrick)\
**Post date:** [April 14, 2023, 9:30pm UTC](https://fortran-lang.discourse.group/t/this-is-my-third-day-trying-to-install-gcc/5569/14 "2023-04-14T21:30:11Z")

</div>

“To be a programmer you must understand the basics of how your operating system works.” How well are you informed about how the engine of your car really works? I am no friend of Microsoft. Even the concept of “Windows” they borrowed from Xerox.

---

<div class="post-metadata">

**Author:** ![Patrick](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/patrick/32/3170_2.png) [@Patrick](https://fortran-lang.discourse.group/u/Patrick)\
**Post date:** [April 14, 2023, 9:42pm UTC](https://fortran-lang.discourse.group/t/this-is-my-third-day-trying-to-install-gcc/5569/15 "2023-04-14T21:42:51Z")

</div>

“At the very least the compiler is running now 🙂” Of all the information that came my way yours was the only information that didn’t send me tail biting in circles.

---

<div class="post-metadata">

**Author:** ![certik](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/certik/32/4_2.png) [@certik](https://fortran-lang.discourse.group/u/certik)\
**Post date:** [April 15, 2023, 1:05am UTC](https://fortran-lang.discourse.group/t/this-is-my-third-day-trying-to-install-gcc/5569/16 "2023-04-15T01:05:47Z")

</div>

@Patrick welcome to the Fortran discourse. I am happy that you were able to get the issue resolved. Please don’t forget to thank the people who helped you. Also a reminder that we have a code of conduct: [https://fortran-lang.discourse.group/t/welcome-to-discourse](https://fortran-lang.discourse.group/t/welcome-to-discourse), please follow it.

---

<div class="post-metadata">

**Author:** ![vmagnin](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/vmagnin/32/28_2.png) [@vmagnin](https://fortran-lang.discourse.group/u/vmagnin)\
**Post date:** [April 15, 2023, 9:11am UTC](https://fortran-lang.discourse.group/t/this-is-my-third-day-trying-to-install-gcc/5569/17 "2023-04-15T09:11:42Z")

</div>

> [@Patrick](#):
>
> How well are you informed about how the engine of your car really works? I am no friend of Microsoft. Even the concept of “Windows” they borrowed from Xerox.

@Patrick , you will find in this community fans of Windows, Linux, macOS, FreeBSD and other systems. Although Fortran was born before all of them, it needs them to work. All these operating systems share some common concepts that must be learned to program in Fortran or whatever other language. There is a book about the history of Fortran subtitled “Abstracting away the machine”, but that is only an ideal that is never really achieved.
