I have recently come out of academia and find myself needing to purchase a FORTRAN compiler for my new machine. I will use it purely for large scale scientific analysis… number crunching. No web apps or anything like that. I would very much like to get something bundled with IMSL subroutines as they have come in useful in the past.
Also, now that I am getting this there are several other people in the office who wnat to jump on board and we have decided it would be best to get the same product so there is no question of portability. However, they would like a C and C++ compiler bundled into the same tool. I have seen a bunch of products out there, but for all this it looks like I might have to go with Microsoft visual studio and an add on FORTRAN compiler as I do not believe Microsoft actually supports one anymore. Any reccomendations?
Have you considered Linux? If so, there is a free version of Fortran 95. I haven’t used it personally, but it looks as if it’s a frontend to the GCC languages. And, of course, you’d have to check to see whether the IMSL libraries are available for it.
Netlib may also have some libraries, with source, available that would cover your needs.
My Fortran use goes back to Fortran77, so I have no current answer. But it might help if you increase the OP. What platform and OS do you want to compile and build on? Is Linux or Solaris an option. What version of Fortran would you prefer to use?
Back in the day, I used a Fortran precompiler on a SPARC 2 which converted the Fortran to C code which could then be compiled with any standard C compiler. A similar updates arrangement may be good for you.
Have a look at the Watcom Open Source project home page and see if it might suit your needs. They offer both a FORTRAN 77 and a C/C++ compiler pacakge for the low low price of about $30.
I used to use the predecessor, Watcom FORTRAN 77 version 11.0, under DOS and it’s a very slick compiler. As for IMSL , you’ll probably have to hunt down that separately.
Time was, there was a package called “Digital Visual FORTRAN,” published by Digital, that was compatible with and very similar to MS Visual C++. It was possible to cross-compile FORTRAN and C++ code into the same binary.
Now it looks like HP has purchased all of Digital, but I couldn’t find anything on HP’s site. It may be worth further investigation.
A mathematically-oriented computer language oiut of the late '50s (semi-acronym for FORmula TRANslation). It is (or at least was) not so hot in terms of data input and formatting, but very well suited to heavy-duty equation processing. I haven’t used it since training, but my recollection is that you could generate a humungous executable from a vanishingly small amount of source code.
(For some reason, I’m also reminded of IBM’s PL/I. The goal of that language was to have the mathematical power of FORTRAN combined with the self-documenting features of COBOL; but according to one wag, they got the mathematical power of COBOL and the self-documentation of FORTRAN.)
Yes, FORTRAN was math-oriented, and is considered the first high-level language. (Those were the days when every program was written in assembler, essentially the raw machine code with prettier names.) With FORTRAN, you could write statements that looked pretty much like something a mathematician would write.
COBOL came along soon after as a business-oriented language. See Grace Hopper, one of the goddesses in the field.
PL/1 was intended to combine the strengths of both FORTRAN and COBOL with the radical new ideas of “structured programming”. Unfortunately, we got both languages, the new control structures, and just about anything else anybody involved could think of. (For a little background on structured programming, see Dijkstra’s famous letter “GOTO considered harmful”/)
In 1977, I started the CS program at a large Math/Enginnering school - they ran CDC machines - and had one of the most powerful number-crunchers on earth.
The TVA had a contract which gave them control-point priority, and would tie it up for a couple of days modeling its drainage area. The midset there was ‘real programmers use FORTRAN’ - the story was that CDC had a (really crappy) COBOL compiler only because the US gov’t required it to submit bids. Dr. Cray then founded his own company, and the rest is history.
FORTRAN then became the exclusively within purview of the number-crunching crowd. Ironically, C and C++ are nearly identical to FORTRAN - but, I far as I can tell, neither support any branching mechanism beyond the IF…ELSE…
FORTRAN at least supported the GOTO - a deadly mechanism for complex IF structures, but arguably better than just the IF.
I really like the COBOL PERFORM verb, but then I’m a dinosaur.
And Crays did Cobol? Fortran was a lot easier to vectorize than Cobol - I don’t remember seeing anything about Cobol for supercomputers. I taught Cyber assembly language for a while after we gave up on our PDP-11.
Well, if there was only an IF, you’d be right, but C has while, for , and switch statements, as well as loop exit statements which can almost always take the place of a goto. I believe there is a goto in C, if you study the BNF in the back of the white book.
BTW, the best paper on gotos in Don Knuth’s in Computing Surveys, around 1975, which starts with a quote from an ad “Do you suffer from painful elimination?”
The structured aspects of PL/1 come from Algol 60, that little gem of a language. PL/1, by the way, predates Dijkstra’s letter by quite a bit, which certainly does not give background on structured programming. Papers by Wirth and others does better. Dijkstra’s techniques, by the way, only really work for people as smart as he was - which is a pretty small set. (Maybe null now.)
I wouldn’t say they’re nearly identical at all, considering that C is pass-by-value while FORTRAN is pass-by-reference. And C has a number of other branching mechanisms as well, including the “case” construction, for loops, while loops, do… while loops, and a ternary conditional value operator. goto isn’t properly a branching mechanism, but C has that, too, although its use is strongly discouraged in all the style guides. And if you want to be too clever for your own good, you could even use a Boolean “and” or “or” for branching.
Back to the OP, I see no reason not to go with gcc. It’s the de facto industry standard in academia for C, and I see no reason to expect it would be otherwise for FORTRAN. And it’s free, so if you try it and decide for some reason that it doesn’t meet your needs, you’ve lost nothing but time.
C and C++ have goto, but FORTRAN had the computed goto and the arithmetic IF statement, two things that would make any C person scream and run home crying.
But even the computed goto is nothing compared to the ALTER verb introduced in early versions of COBOL and then quickly killed by a horrified world.
flight: If you want a Fortran compiler for a modern machine, you would do well to look at gcc, which has a Fortran frontend that can handle FORTRAN 77 and some of Fortran 95, in addition to plenty of nonstandard extensions. You can get gcc for nearly any platform you’d want to compile code under. This has the advantage of being free and well-supported.
However, to get the IMSL library, it looks like you might need to buy the Absoft compiler. I don’t know if that’s worthwhile, or if you can get the IMSL libraries (or equivalents) another way. If LAPACK or something like it could solve your problem, you might be able to avoid buying anything.
I use both Digital Visual FORTRAN and MS FORTRAN Powerstation, both of which came with IMSL. You can often find them on Ebay for very cheap, like $10 or less cheap sometimes. I’ve seen DVF for $5. And they have the Visual Studio front end and tools, too.
vinniepaz, you wanna know how archaic FORTRAN is? FORTRAN is similar to line-numbered BASIC formatted for 80-column punch cards. The same punch cards Hollerith created for tabulating the 1890 census. The format of a line of FORTRAN code is defined by technology that is ONE HUNDRED FOURTEEN YEARS OLD! Babbage himself would feel at home with it.
With that out of my system, it is only fair that I point out that an axe is the descendent of million-year-old technology and is still the tool of choice for some jobs. And I admit an attraction to COBOL because it can be so easy to follow, or could be were my attention span longer. (“Self-commenting code?” It’s a bloody NOVEL!)
More specifics on my situation:
I am looking to run the compilers on windows machines. The reason this is new to me is that I always used a unix server to run code in college as these things were beasts and would have taken a PC half a week. As it is now, my workstation would eat the old unix box I use to use for lunch, so running off my own machine is best for most applications (unless I start getting into CFD).
There have been a lot of good suggestions and I am looking into them now. I realized that DIGITAL use to make their visual compiler that would work with an MS C compiler, but I too had problems trying to figure out what was currently up with that. Also, Microsoft does not seem to FORTRAN Powerstation anymore, at least as far as I can see.
Lastly, everything I do now is in FORTRAN 90, but I use 77 code as part of the programs. Thus, on the UNIX machine I would have to compile the parts seperately using two different compilers (one for 90 and one for 77) and then compile them together. It would be easier to have one that could handle both 77 and 90 (and 95 and 2003 for that matter, though I haven’t had need of them).
Thanks again for all the input. Oh, and to close. Back in 1994 when I was an undergrad I saw a Tshirt that spoke to me. It just had written on the front of it:
FORTRAN has come a long way since 77. FORTRAN 90/95 has many oject-oriented aspects to it now, including ideas such as classes, headers, public/private data, and my favourite, nice, simple dynamically allocated array structures. For pure number crunching, nothing beats it.
To the OP. I use FORTRAN in both linux and Windows. In linux, I use Lahey-Fugitsu FORTRAN 95 and in Windows, I use the digital FORTRAN already mentioned. You’d think there would be a way to get it to cross compile with Develper studio as I think at one time it was part of it. You can also get Lahey fortran for Windows if you want consistent compilation on different OS’s.
You can get IMSL in windows and linux for digital and lahey. Lately I’ve been using LAPACK more because its free and some of the networks I use don’t have IMSL. But IMSL is my favourite.
Since I only every used a few short f77 numerical recipe routines I just made simple modifications to put them into F90 syntax, but you’d think there would be a compilation option you could set to handle them both as is.