# Path to the compiler

**URL:** <https://fortran-lang.discourse.group/t/path-to-the-compiler/9051>\
**Category:** Uncategorized\
**Created:** [January 9, 2025, 7:25am UTC](https://fortran-lang.discourse.group/t/path-to-the-compiler/9051 "2025-01-09T07:25:06Z")\
**Posts on this page:** 4\
**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:** [January 9, 2025, 7:25am UTC](https://fortran-lang.discourse.group/t/path-to-the-compiler/9051/1 "2025-01-09T07:25:06Z")

</div>

There where I used to compile a Fortran source code, I also had a string to set the path to the compiler. However i have lost that set string. Could someone please suggest what that line of text should be?  
To compile code required the line: gfortran hello.f90  
I seem to remember that the string contained these words:  
c users pader gcc bin gfortran  
What would the complete set path string be? All the characters please. Please tell me in detaijl what to de before I can write: gfortran hello.f90

I am getting no response to my query so I will go elsewhere for help.

---

<div class="post-metadata">

**Author:** ![jorgeg](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/jorgeg/32/6835_2.png) [@jorgeg](https://fortran-lang.discourse.group/u/jorgeg)\
**Post date:** [January 9, 2025, 11:52am UTC](https://fortran-lang.discourse.group/t/path-to-the-compiler/9051/2 "2025-01-09T11:52:08Z")

</div>

Hi Patrick, your question is a bit vague yet not. I am going to assume you are using Linux because that’s what I have.

Based on your question I am going to assume you did not build your own gfortran and it should be installed already…try to do `gfortran --version` if this is not working, then, you can go [here](https://fortran-lang.org/en/learn/os_setup/install_gfortran/) for detailed instructions on how to obtain and install gfortran.

Once you’ve followed the instructions there, gfortran should be in your `$PATH` variable. The `$PATH` variable basically tells your environment where are the executables you want to use. It will have inside of it the `/path/to/gfortran/bin/gfortran` and you will be able to simply do `gfortran hello.f90`.

Based on your question, I’d recommend you follow the [quickstart tutorial](https://fortran-lang.org/en/learn/quickstart/) that is in the Fortran lang website.

Hope this helps!

Cheers from nighttime in Canberra, Australia

---

<div class="post-metadata">

**Author:** ![nbehrnd](https://avatars.discourse-cdn.com/v4/letter/n/e0b2c6/32.png) [@nbehrnd](https://fortran-lang.discourse.group/u/nbehrnd)\
**Post date:** [January 9, 2025, 8:56pm UTC](https://fortran-lang.discourse.group/t/path-to-the-compiler/9051/3 "2025-01-09T20:56:04Z")

</div>

@Patrick In an instance of Windows 10 (because of

> c users pader gcc bin gfortran

you report) `where.exe gfortran` reports `C:\Users\USERNAME\gcc\bin\gfortran.exe` and `where.exe gcc` about `C:\Users\USERNAME\gcc\bin\gcc.exe`. I see both strings added to Windows’ system path variable (you would need to adjust `USERNAME` to e.g., `pader`). It still is best to reboot the computer after an edit of there.

Since I don’t see `gcc` listed among Windows’ list of programs installed, the instance of `gfortran` (GNU Fortran (GCC) 14.1.0) more likely is the result of the simultaneous installation of ([git](https://git-scm.com/) and subsequent [tortoise git](https://tortoisegit.org/)), than Silverfrost’s free Fortran/Plato environment.

---

<div class="post-metadata">

**Author:** ![Harper](https://avatars.discourse-cdn.com/v4/letter/h/b5ac83/32.png) [@Harper](https://fortran-lang.discourse.group/u/Harper)\
**Post date:** [January 9, 2025, 8:56pm UTC](https://fortran-lang.discourse.group/t/path-to-the-compiler/9051/4 "2025-01-09T20:56:23Z")

</div>

As I said elsewhere recently, in a Linux system the command `locate bin/gfortran` should reveal where that compiler is. There may be several of them. I don’t know whether Windows and Mac have `locate`, and if not, what their equivalents are.
