Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Downloading Fortran Compiler
#1
I am trying to figure out how to download a Fortran compiler that can do the most elementary operations for Windows 7 64-bit
One that is free and easy to use would be preferred but if there is a good one that you have to purchase that works, too.

Honestly I have no idea what I'm doing but from what I've looked at I have found this download site (lahey.com), which offers free 30-day trial versions which I assume you can purchase a full version of if you're satisfied.

Anyone with Fortran knowledge able to enlighten me on better options?

notes: does not have to be Fortran 90 or any other "modern" version

Thanks!
Reply
#2
http://gcc.gnu.org/wiki/GFortranBinariesWindows
Reply
#3
Fiel Wrote:http://gcc.gnu.org/wiki/GFortranBinariesWindows

Following through on that, I installed the GNU FORTRAN Compiler from MinGW.
 Spoiler

I'm trying to download FORTRAN on my (87 y.o.) boss's home computer so I need to write up a list of step-by-step instructions on how I do it. All that's left is to verify this download works.

Will it work if I run gfortran fileName in command prompt?
Reply
#4
Don't download MinGW32 binaries, it's.. outdated and quite possibly garbage in this day and age.

Download MinGW64 binaries instead as they're better and actually updated. By far the easiest to install would probably be STL's Nuwen distro, located here.

As for invoking the command-line, I'll imagine it's similar to how it is for other languages, e.g.

Code:
g++ -O2 fileName -o fileName.exe

is how you'd do it in C++.

You can find more info on the docs.
Reply
#5
Locked Wrote:Don't download MinGW32 binaries, it's.. outdated and quite possibly garbage in this day and age.

Download MinGW64 binaries instead as they're better and actually updated. By far the easiest to install would probably be STL's Nuwen distro, located here.

As for invoking the command-line, I'll imagine it's similar to how it is for other languages, e.g.

Code:
g++ -O2 fileName -o fileName.exe

is how you'd do it in C++.

You can find more info on the docs.

I have installed MinGW (successfully, according to the instructions).

I apologize in advance, but I do not know what I am looking at nor do I know what I'm supposed to be looking for.

What do you mean by WinGW64 binaries?
Is what I already have installed enough to compile fortran code? I'm trying to find something where "ALL I NEED IT TO DO ARE THE MOST ELEMENTARY OPERATIONS THAT I HAVE BEEN DOING AT WORK FOR 58 YEARS."
Reply
#6
Marksman Bryan Wrote:I have installed MinGW (successfully, according to the instructions).

I apologize in advance, but I do not know what I am looking at nor do I know what I'm supposed to be looking for.

What do you mean by WinGW64 binaries?
Is what I already have installed enough to compile fortran code? I'm trying to find something where "ALL I NEED IT TO DO ARE THE MOST ELEMENTARY OPERATIONS THAT I HAVE BEEN DOING AT WORK FOR 58 YEARS."

Probably. It's just always better to get newer versions of the compilers.
Reply
#7
So, turns out I got fortran and python confused and ended up getting python instead of fortran.

Google says to type "g77 -ffree-form fileName.for -o fileName.exe" to compile, but cmd gives me "g77 is not recognized as an internal or external command, operable program or batch file."
Reply
#8
Marksman Bryan Wrote:So, turns out I got fortran and python confused and ended up getting python instead of fortran.

Google says to type "g77 -ffree-form fileName.for -o fileName.exe" to compile, but cmd gives me "g77 is not recognized as an internal or external command, operable program or batch file."

You have to add the directory in which it's installed into your PATH.
Reply
#9
Don't have the knowledge, time, or understanding to figure out how a free compiler works so I downloaded Simply Fortran.

I can get the basic "hello world" program to run, but I still can't my own code to work because I don't understand squat about fortran or where files need to be or how to set up new projects.
I've used Netbeans before for java and I assume this is similar but I cannot figure out for the life of me how it works.

EDIT:

I am trying to compile
Code:
PROGRAM SIMPLE
      A=10.
      B=20.
      C=A+B
      PRINT *,”A=”,A,”,  B=”,B,”, C=”,C
      END

Attempting to build gives
Code:
PRINT *,\x94A=\x94,A,\x94,  B=\x94,B,\x94, C=\x94,C
              1
Error: Expected expression in PRINT statement at (1)
Error(E42): Last command making (build\simple.o) returned a bad status
Error(E02): Make execution terminated

no idea what's going on
Reply
#10
Change the double quotes to single quotes.

http://www.personal.psu.edu/faculty/j/h/...print.html

Your compiler apparently isn't Fortran 90?
Reply
#11
SaptaZapta Wrote:Change the double quotes to single quotes.

http://www.personal.psu.edu/faculty/j/h/...print.html

Your compiler apparently isn't Fortran 90?

Thank you! Always something stupidly simple.
And this frustration is why I chose not to be a comp sci major.

It compiled and ran like I wanted it to. I think I'm done here, but I'll post again if I need any more help.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)