Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Recommendations for best, free Fortran 2005 compiler?

Status
Not open for further replies.

fortranforever

Programmer
Mar 4, 2012
4
US
Hi everyone,
I am considering using Fortran or C++ for some work I have to do reading in large data sets and doing numerical calculations for financial studies. Although I have coded in C years ago, and more recently Visual Basic, I am more or less a beginner level programmer and considering learning C++ or Fortran for this work. I was going to use C++ and then surprised to read on the web that Fortran may be more suited to this purpose with a lot of arrays, matrices, matrix math and such. Anyway, could not find a good, free Fortran 2005 compiler to use. Of utmost importance to me is a good/user friendly debugging environment, as I'm sure given my level I will be making a lot of mistakes !!

Any recommendations for a good, free Fortran compiler (and C++ too for that matter) would be most welcome !!!

Best,
Rich
 
For what you will be doing, it certainly sounds like Fortran would be easier to deal with than C++. Fortran does have, out of the box, a way to deal with matrices and vectors in a very friendly manner.

The one compiler I use is g95, because I can download it for the 2 or 3 platforms I program in.

 
Thanks Salgerman!
So I tried to install gfortran, which seemed like it was newer than g95 and pretty comprehensive. However, when I type gfortran in the cmd line it doesn't recognize it. I did try to actually run it to make sure I hadn't just installed and not executed it, but it made no difference.

Can anyone provide instructions or a link on how to install gfortran? I can't seem to get it to work on my Windows XP.
 
I do not know if gfortran works in Windows all by itself; a quick on-line look seems to reveal that you need MinGW, too, in order to use gfortran.

I have not installed g95 in a long time, but it seems that that one does not require MinGW...it would run just by itself...from DOS. Since you already tried to install gfortran and there seems to be a bit of a conflict between gfortran and g95, there is already a work around, g95 on-line pages indicate that you should use g95-MinGW-41.exe, if you want to have both compilers side-by-side.

Make sure you do setup your PATH environment variable to add the path to where you installed the compiler, by the way...things don't just work magically in a computer, you know.

 
As far as I rememeber, it is quite easy to install gfortran on Windows : it comes with an embedded MinGW version...

On my computer, I just defined two environment variables :
- PATH : "c:\program file\gfortran\bin;..."
- C_INCLUDE_PATH : "c:\program file\gfortran\include"

I don't know whether the second one is really necessary.

François Jacq
 
You could try the Salford/Silverfrost compiler. Not high performance but has a nice GUI. Can even use the Visual C++ express GUI.

Once you've sorted out the bad stuff, rebuild with gfortran/g95 for better performance.
 
As I am thinking about to procure a new compiler myself, I would enter the questions:

- does gFrotran come with a GUI or can I use Visual Studio with it ?
- Is this compiler free of charge for commercial use as well ?

Norbert


The optimist believes we live in the best of all possible worlds - the pessimist fears this might be true.
 
gfortran doesn't come with an IDE. You could try Photran, which is an Eclipse (Java) based editor.

Personally, I don't like eclipse but that is just me. I find that it doesn't use vertical space efficiently and doesn't cater for the large amount of horizontal space available on most widescreens nowadays.

Re: commercial use: read the GPL which comes with gcc/gfortran.

 
Thanks all!
I did install MinGW initially and did not get anything to work.
However, I did not change anything in the Path.
I will try this next and report back.
If that doesn't work, maybe I will try g95 as it seems to be simpler.

I thought the hard part was going to be learning the language and writing the code, but I can't even get out of the blocks yet!!
 
Well, I'm almost embarrassed to say I still can not get this to work. I do not see a directory of gfortran created anywhere. I downloaded MinGW from here, and clicked on the blue hyperlink at top next to "Looking for the latest version:"


I checked off C++, gfortran and c.
I was able to create a directory called MinGW but all that's in it is an uninstall program. I never saw a gfortran directory or executable to run.

Any input on if I'm missing a step would be very, very welcome.
I did, btw, add the MinGW directory to my environment path, but did not add anything else, and it made no difference.

The only other area I noticed is in a subdirectory MinGW/libexec/mingw-get and there is a file in there called mingw-get-0.dll.

I don't know what a dll is.
I was expecting somewhere to see a file called gfortran.exe, or something similar, but never could find one.

I still think I haven't run the executable that "loads" gfortran so that I can run it.
 
o.k....just to add to the mix...here is another alternative that I have used and actually prefer over standalone msys/mingw.

I am talking about cygwin.

I used to have to compile for Solaris, RedHat and Windows and wanted to use the exact same make files and compiler. So, I installed g95 in Solaris and RedHat and because both file systems were mounted as soon as I logged in, there was no issue on using the same make files...

Then, on Windows, I installed cygwin and downloaded g95 for cygwin...installation was a snap. Cygwin does have linux-like links, unlike Windows short-cuts (they are not real links), and so, I was able to type make from cygwin and actually access the same make files I had on my RedHat box (via samba).

Let alone all those other advantages of having linux commands for other tasks (bash scripting, grep, sort, cut, uniq, etc.)

....but all that is besides the point, I guess...just wanted share a bit on the reason behind my use of cygwin...

Anyway...maybe this does not even apply if fortranforever only knows Windows and a cygwin environment will not make him feel at home in anyway...

gsal



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top