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.
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 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 that is in the Fortran lang website.
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 and subsequent tortoise git), than Silverfrost’s free Fortran/Plato environment.
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.