# Best fortran compiler for Windows 7?

• Fortran
Machinus
Due to research changes I have to switch from C++ to Fortran development. In the past I have used Microsoft development tools since they are free for students, but afaik they do not have similar software for Fortran, and the Intel software is a little too expensive for me to afford.

Which compilers are the best for Windows? If you use Fortran on Windows, what do you use?

anti-proton
Have you tried the GNU fortran compiler? GNU makes a wonderful compiler, which often outperfroms other compilers, and is totally free.

If you want to use it in Windows 7 you will need to use the CYGWIN system. This creates a tiny POSIX compliant shell for you to use.

http://www.gnu.org/software/gcc/
http://gcc.gnu.org/install/binaries.html

GNU is always a good place to start. The GCC can also compile C, C++, and many more. I use it as an assembler.

Enjoy.

Homework Helper
Gold Member
I visited that www.gnu.org link above. All the steps of understanding are missing.

What does a person need to know if he has Windows XP, or Windows Vista, and he wants to learn to use a programming language like FORTRAN? Person does not understand Windows, but just knows how to USE Windows. Person has either very limited or no programming knowledge. So what is the missing information and the missing steps to begin to learn how to use and create programs in FORTRAN?
... cygwin? What is it? What does it do? How do you apply it? How do you understand it?

anti-proton
I visited that www.gnu.org link above. All the steps of understanding are missing.

What does a person need to know if he has Windows XP, or Windows Vista, and he wants to learn to use a programming language like FORTRAN? Person does not understand Windows, but just knows how to USE Windows. Person has either very limited or no programming knowledge. So what is the missing information and the missing steps to begin to learn how to use and create programs in FORTRAN?
... cygwin? What is it? What does it do? How do you apply it? How do you understand it?

The original question asked about the best compilers from Fortran, not a full explanation of the use of Fortrans with respect to Windows. Fortran isn't really a good language to start with, if your learning. Consider an easier language to start with, like Java or Java Script.

Learning to program isn't hard but it takes work and time. I would advise you to go get a good book, SAMs publishing is great, and pick a language to learn.

Homework Helper
Gold Member
Due to research changes I have to switch from C++ to Fortran development. In the past I have used Microsoft development tools since they are free for students, but afaik they do not have similar software for Fortran, and the Intel software is a little too expensive for me to afford.

Which compilers are the best for Windows? If you use Fortran on Windows, what do you use?

In addition to wanting to know "what", I am also interested in wanting to know "how" and including other required software to be used with the FORTRAN in Windows 7. FORTRAN was offered as a language to learn on for beginners many years ago; maybe that has changed.

Grep
FORTRAN was offered as a language to learn on for beginners many years ago; maybe that has changed.
I've been programming for around 30 years, and I'm not so sure that was good advice even 30 years ago. I'd suggest FORTRAN to a beginner if I felt like torturing them, perhaps.

FORTRAN sees little use outside of certain scientific uses, these days. I'll admit it, I don't like FORTRAN much. It does a few things well, and I won't argue that, but I'd never start writing new software in FORTRAN these days, given a choice.

Pascal, on the other hand, was excellent to teach structured programming. Don't know that I'd still suggest it, but I'd put it well above FORTRAN for teaching. But I digress.

Mentor
Thirty years ago, if you wanted to learn programming, you learned Fortran if you were a science guy, or Cobol if you were a business guy, or Basic if you were a hobbyist. All three are now pretty much niche languages. In the US, the most common introductory programming languages in high schools, colleges and universities nowadays are probably Java and C++. There are many textbooks for introductory Java and C++ courses.

Grep
Thirty years ago, if you wanted to learn programming, you learned Fortran if you were a science guy, or Cobol if you were a business guy, or Basic if you were a hobbyist. All three are now pretty much niche languages. In the US, the most common introductory programming languages in high schools, colleges and universities nowadays are probably Java and C++. There are many textbooks for introductory Java and C++ courses.
Agreed. As I recall, BASIC was based somewhat on FORTRAN, and meant to be simpler for beginners to use. I started on BASIC, myself.

Anyways, to the OP, Cygwin is sort of a UNIX on Windows. Not too hard to install. I'm sure there's instructions on the Cygwin site. When you're installing it, you get to select packages to install. Of those, gcc and friends (including, I presume, FORTRAN) are some of the choices. I figure there must be some other compilers for Windows, but that's the only one I know, these days. A Google search may find more.

Here's one page with a list (first hit on Google looking for "Fortran compilers for Windows"):

http://www.thefreecountry.com/compilers/fortran.shtml

Cygwin's web site is at: http://www.cygwin.com/

There's links to the setup.exe binary you need to run to get started installing it, as well as instructions. It's not really hard to install. That should get you started. If you get stuck, you know where you can find us!

PhysixForum
Simply Fortran by Approximatrix is a Win Doze variant of Gnu F90, and it is absolutely superb.
---
John

Again this is another old thread that's been bumped, but I'll add some more to it anyway.
Since the previous post links to a 30 day trial (it my be good software though, I've never tried it) I'll post a couple of freeware options.

1. The gnu g95-minGW compiler is a good freeware option. It's only a command-line compiler but it has the advantage that it produces stand-alone exe files.

2. The Silverfrost ftn95 compiler. This one comes with a nice IDE (editor and debugger). On the negative side this one needs the supplied Salford library and dll files to run the complied executables, and the freeware version has a nagware time delay of about 8 seconds after program load. The nice thing however is that you can edit and debug in a nice IDE and when you're finished the code is usually portable enough to just compile it with the g95 compiler, linked above, to get a stand alone exe if you want it.

Zitra
I visited that www.gnu.org link above. All the steps of understanding are missing.

What does a person need to know if he has Windows XP, or Windows Vista, and he wants to learn to use a programming language like FORTRAN? Person does not understand Windows, but just knows how to USE Windows. Person has either very limited or no programming knowledge. So what is the missing information and the missing steps to begin to learn how to use and create programs in FORTRAN?
... cygwin? What is it? What does it do? How do you apply it? How do you understand it?

Conceptually, small-scale programming shouldn't be very hard if you're a physicist and used to math and symbolic algebraic manipulations. A program is something which is written in a programming language and can be translated to machine code runnable by a computer. (In layman speak, the latter is a .EXE file.) Conceptually, most programs just manipulate data. The minimal requirements for translating source code to machine code is a program called a compiler, like a FORTRAN or a C compiler.

There are little reasons to still learn FORTRAN unless you're interested in writing fast numerical algorithms or supercomputer simulations, both of which FORTRAN specializes in because of historical reasons. [Anyway, you need to be a specialist to do that, so that's out of bounds anyway if you're still learning.] By CS standards, it isn't a language which promotes good software engineering, so I wouldn't start there to learn programming.

If anything, start of with C or C++, buy a good book on it, and if you're going to do anything numerical there's always the 'Numerical Recipes in C' book.

Last edited by a moderator:
PhysixForum
Fortran is extremely efficient when developing software for numerical modelling, and it is highly valued for this purpose by scientists and engineers. In my opinion, it is also a high-level language that is the servant, not the master, of the person using it.

I mentioned Simply Fortran in a previous post because it is so cheap that it is almost free (compared with most commercial Fortran compilers) yet I have found it better by far than the commercial package, Compaq Visual Fortran, which I have used in the past. It is easily the best sixteen quid I have ever spent on software development.

Simply Fortran is no more than an IDE for Gnu F90, but
- (i) Gnu F90 is now excellent, and
- (ii) SF is, in my view, superb.

Included in the package are,
- a Fortran-aware editor,
- on-the-fly syntax checking,
- very good project organisation tools,
- Source level debugger,
- and more.

Why am I plugging this so hard? In part because I really do believe all that I say about it, and in part because I am extremely keen to see initiatives like this supported, because this benefits all Fortran users.
---
John Wasilewski

FactChecker
NeedMorePower
@John Wasilewski: I downloaded it yesterday, and couldn't agree more! I threw a few programs at it, and compiling was a snap (once I modified a few default settings, but they were straight-forward). I already had CygWin for Octave, but both versions happily co-exist. The $25 registration fee is more than worth it, IMO. Thanks for your input! beezle Well I had to re-register just to respond to some of the drivel that has been posted in this thread. @Greg and @MarcoD: Have you ever programmed anything in Fortran? Like in the past twenty years? Maybe you missed F90 or F2003 or the current F2008? Before dissing the language maybe you should at least try to be familar where it is today and forget your memories of FOTRAN IV or 77 or the 'oh fortran sucks it has gotos' mantra from CS ivory towers. Fortran was and still is a great language and has all the 'modern' features. While its primary use still remains in high performance scientific computing, it is still a general purpose language and one I would take over the likes of C++ any day (java too ignoring the over played issue of 'portability') gsal A couple of things. Just because Fortran had to start with GO TOs, it does not mean you have to use them now; in fact, they are discouraged. And yes, Fortran has been around for a reason over 50 years, and it's a good reason. Fortran has many features, now, that C or C++ don't have. Fortran lends itself for better optimization more easily right out of the box. Sure, sometime ago I read that a benchmarking C++ program had been compiled to run faster than the one in Fortran...but they don't mention what kind of effort they put into optimizing C++ to achieve that...I can assure you it was a lot and by very very knowledgable people and not your regular c++ programmer. In any case, Fortran is easy to learn...you can do a lot with a few structures. It can handle arrays a-la-matlab. Did I mentioned that matlab's back bone's linear algebra package is written in Fortran 90? If has "IF", "DO", "WHILE", "SELECT", "WHERE", "FORALL", masking arrays, etc. I has structures, type definitions, pointers, and the list goes on. Oh, one last thing...up above, I read somebody refering to GNU g95...this is wrong, g95 is not part of the GNU tool chain. I don't remember the history, but g95's author might have been part of the GNU team way back, but I think he split and created g95. I do like the Simply Fortran initiative, too. Stephan_doc Hello to all. I need an Fortran Compiler for Windows 7 version 64 bytes operating system. Who can help me and which is the simplest method to get it. If exist a tuturial that can help me to solve my problem. Thank a lot! gsal Stephan: The easiest thing for you, I think, would be to stop loving 40 bucks and buy Simply Fortran. Stephan_doc another sugestions please? Staff Emeritus Science Advisor Homework Helper There are only so many compilers out there for Fortran. I recommend you consult www.fortran.com for some commercial compilers and various tools. In addition to Absoft, Lahey, etc. Intel markets a compiler but it is a bit pricey. There are some compilers from the UK (NAG and Salford), likewise which cost a bit. The trick with using these tools is to get them to interface with Windows, so you are not running your code in a console window. There are packages of routines available to work with the various compilers, but they too cost$ and take some time to learn. You find yourself learning how Windows works, creating and managing windows and such, and less how to solve your problem with Fortran code.

I personally used to program quite a bit in MS-DOS, but I hit the wall when programming under Windows, even though I had a compiler and some tools, because of the complexity of laying out and managing various windows for input/output, etc. With MS-DOS, you could program on the fly, so to speak, but Windows doesn't permit this kind of spontaneous activity, at least in my experience.

Aero_UoP
I believe Intel's compiler is the best one on Win 7 but as SteamKing said, it's gonna cost you (much $) TimPayFor Simply Fortran is great--but its price is now up to$99 (the last time I checked)

mpresic
I like Absoft Fortran. It is expensive. Especially with the imsslib libraries. Absoft technical support is excellent.

Mentor
What features do the more expensive compilers have that Simply Fortran doesn't have? Which piece of software is easiest to learn how to use?

I used to have a compiler called Compaq Visual Fortran, but it was expensive and only ran on 32 bit machines. When I got a new 64 bit computer, it would no longer run. Of course, they offered a 64 bit version of the software, but you had to buy this even if you had already owned the 32 bit version. No way. Also, the documentation on this software was desperately poorly written.

Chet

Last edited:
Homework Helper
What features do the more expensive compilers have that Simply Fortran doesn't have?

The Simply Fortran compiler is just the GNU gfortran compiler, which is free. So you are not paying Simply Fortran for the compiler itself, just for the IDE that comes with it - and maybe for some documentation and tutorials as well.

If you just want the compiler, plus a set of unix-like utilities for Windows (including a debugger) you can get them from http://gcc.gnu.org/wiki/GFortranBinaries

The main issue with GNU gfortran is that it doesn't fully support either Fortran 2003 or 2008 (nor does it claim to) though it does have a few features from those language versions added on to Fortran 95. In particular, Fortran 95 is not really an object oriented language, though it supports some OO features. Fortran 2003 is a lot closer fuly supporting OO. For example the modularization options in F95 don't play well with attempting to create program libraries where you want to distribute only the binary code. Either you are driven towards putting the entire source code of the library into one file to compile it (which is going back to 1960s style computing!) or it is hard to hide the internal implenentation from the user.

1 person
Professor Mike
Been a fortran writer for over 50 years,. Used to do special routines in assembler so they would run faster. Then fortran optimizing compilers
came along and suddenly fortran function calls were as fast as the hand-coded assembler ones. Goodbye assembler! Thirty years later started learning
C and it reminded me of my assembler days. Fortran subroutines would run faster and were easier to program so goodbye C. The only thing missing
in my fortran compilers was a visualization interface. So I programed up a general fortran callable C routine that would put up a window of arbitrary
size whose pixels could be colored any shade of red, blue and green. Now I have my own visual fortran that can do anything from graphing to
photo processing and make movies. One last anecdote. A few years MIT came out with a set of fast Fourier transforms that they labeled FFTW standing
for Fastest Fourier Transforms in the World. A post-doc of mine unwrapped CFFT(( which was the 3-D Fourier transform which came with
the Cray supercomputer. He then handled all the special cases so that he would;t waste time multiplying by zero, and we benchmarked it
against FFTW which was written in C. Our fortran version ran about 30% faster. I guess MIT should change their name to NFFTW.

Every time a new language comes out with a great feature, the next version of fortran usually has it. This is true of pointers and dynamic memory
allocation and many others. Gfortran is pretty nice and it is free, but my favorite was IBM''s XLF which was bulletproof and had quad-precision because
it as built for the IBM PowerPC chip which had 128 bit registers. Unfortunately when Apple upgraded their operating system from Tiger to Leopard,
all support for IBM software was dropped. I still have Tiger running on my old Mac Pro with a Power PC chip, and whenever I have a bug that
the other compilers can't find, I compile it on XLF and voilla, the error is found.

bkm
For someone wanting to learn programming, I recommend TrueBasic (truebasic.com). It is a nice structured language, easy to learn, and powerful; not like the line-number orientated BASIC's of old. I have written many programs in TB. It is an allocated language, not compiled; hence, is a slower than FORTRAN or C++ (I have programmed in both). With today's GHz clock speed computers, the time difference is trivial.

The error checking is great, and programs can be easily written. There are IO defaults, so the Hollerith coding in FORTRAN can be avoided. Formatted output is much more intuitive than FORTRAN. It has built-in graphics, which FORTRAN lacks.

With today's GHz clock speed computers, the time difference is trivial.
That depends on the application.
There are IO defaults, so the Hollerith coding in FORTRAN can be avoided.
"Hollerith coding" can already be avoided since the Fortran 90 standard (ISO 1991, ANSI 1992).

Thirty years ago, if you wanted to learn programming, you learned Fortran if you were a science guy, or Cobol if you were a business guy, or Basic if you were a hobbyist. All three are now pretty much niche languages. In the US, the most common introductory programming languages in high schools, colleges and universities nowadays are probably Java and C++. There are many textbooks for introductory Java and C++ courses.
Thirty years? That would be in the middle of the 1980s - no way! Make it fifty years - at least!

Mentor
I took a class at UW (Washington, not Wisconsin) in the summer of 1980, and they were still teaching Fortran as their entry-level Comp Sci course. We used keypunch machines and Hollerith cards, with our program deck sandwiched between a set of cards with JCL instructions. A couple of years later, I enrolled in a more advanced Fortran class, but after the instructor mentioned in class that he didn't know much about Fortran, and he wasn't up on the OS in use (recently installed VAX VMS). I don't think this guy was a part-timer, but I'm not sure. The icing on the cake for me was, that after the first hour-and-a half session, all that was on the blackboard (chalk in those days) was some meaningless nothing, written on a slant. I decided this wasn't the class for me. If I wanted to teach myself, I didn't want to have to be paying tuition as well.

The next summer course I took, in 1984, was a class advertised as Pascal, but actually in Modula-2. Sometime later, their intro course changed again, this time to C++. My rant above isn't meant to disparage the CS department at UW -- just the complete lack of preparation of the guy who was teaching the class. The instructor for the Modula-2 class was on the ball and knew what he was doing.

Mentor
This thread pre-dates dinosaurs as well as FORTRAN (hyperbole). I am not positive, but I believe "necroposting" is no-no here.

Mentor
Thirty years? That would be in the middle of the 1980s
Look at the date on the post that you quoted.

This thread pre-dates dinosaurs as well as FORTRAN (hyperbole). I am not positive, but I believe "necroposting" is no-no here.
The thread was no that old. (It was still open for replies.) In any case, it seems to have been re-animated by a one-time poster with more interest in (and knowledge about) his own link than in (about) Fortran.

Last edited:
Mentor
@Krylov I agree. Apparently the rule is not hard and fast, which understandable. Mentor indicated that since it has had a stream of posts over time they feel it can stay.

Older PF threads are meant for reference usually. And they are a resource.

S.G. Janssens
Homework Helper
Historical trivia - I learned Fortran IV back in 1968 in high school, at a special Saturday class at an IBM data center (back in the days when many companies rented time on computers located at data centers). The high school had a Monrobot computer at the time that used some custom language called quickcomp, but a year later (1969), my high school got an IBM 1130 computer where I used Fortran IV, and assembly. My first job in 1973 on HP 2100 series computers was mostly assembly on a multi-computer / multi-threading database online system, using Fortran IV for the offline work. I also did some self-study programming in APL and Cobol at a local college computer center. I didn't start programming in C until the mid 1980's.

So getting back to the original question, since it's now 2016 and not 2011, what Fortran compilers are good for Windows 7 and later, perhaps 64 bit mode and possibly usage of SIMD / SSE instructions? How much of a trade off between good compiler and cost?