Best fortran compiler for Windows 7?

  • Fortran
  • Thread starter Machinus
  • Start date
  • #1
3
0

Main Question or Discussion Point

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?
 

Answers and Replies

  • #2
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.
 
  • #3
symbolipoint
Homework Helper
Education Advisor
Gold Member
5,908
1,060
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?
 
  • #4
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.
 
  • #5
symbolipoint
Homework Helper
Education Advisor
Gold Member
5,908
1,060
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.
 
  • #6
297
2
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.
 
  • #7
jtbell
Mentor
15,544
3,452
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.
 
  • #8
297
2
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! :smile:
 
  • #9
Simply Fortran by Approximatrix is a Win Doze variant of Gnu F90, and it is absolutely superb.
---
John
 
  • #10
uart
Science Advisor
2,776
9
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.

- Download the self extracting Windows x86 file, "g95-minGW.exe" here: http://ftp.g95.org/


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.

- Download the "Silverfrost ftn95 personal" here: http://www.silverfrost.com/32/ftn95/ftn95_personal_edition.aspx
 
  • Like
Likes Zitra
  • #11
MarcoD
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:
  • #12
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.

More info can be found at [http://simplyfortran.com/home/].

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
 
  • Like
Likes FactChecker
  • #13
@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!
 
  • #14
1
0
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')
 
  • #15
1,065
53
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.
 
  • #16
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!
 
  • #17
1,065
53
Stephan: The easiest thing for you, I think, would be to stop loving 40 bucks and buy Simply Fortran.
 
  • #18
another sugestions please?
 
  • #19
SteamKing
Staff Emeritus
Science Advisor
Homework Helper
12,798
1,666
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.
 
  • #20
137
5
I believe Intel's compiler is the best one on Win 7 but as SteamKing said, it's gonna cost you (much $)
 
  • #21
1
0
Simply Fortran is great--but its price is now up to $99 (the last time I checked)
 
  • #22
512
121
I like Absoft Fortran. It is expensive. Especially with the imsslib libraries. Absoft technical support is excellent.
 
  • #23
20,106
4,188
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:
  • #24
AlephZero
Science Advisor
Homework Helper
6,994
291
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.
 
  • Like
Likes 1 person
  • #25
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.
 

Related Threads on Best fortran compiler for Windows 7?

Replies
2
Views
14K
Replies
4
Views
69K
Replies
12
Views
10K
Replies
2
Views
7K
Replies
4
Views
13K
  • Last Post
Replies
2
Views
2K
Replies
5
Views
8K
Replies
2
Views
3K
  • Last Post
Replies
2
Views
3K
  • Last Post
Replies
10
Views
3K
Top