I need a compiler for Fortran 77 in linux.
Are there any free compilers out there that people use?
I've heard about g77, but I can't find the rpm or how to install it in linux.
Thanks!
I need a compiler for Fortran 77 in linux.
Are there any free compilers out there that people use?
I've heard about g77, but I can't find the rpm or how to install it in linux.
Thanks!
The means for getting software installed is distribution-specific. For example, in Ubuntu9, I would kick up Synaptic and do a search for Fortran or g77 (apt-get can also be used).
The other distributions I know little about although I've heard of yum and yast for (I think but I'm not sure) RedHat and Suse.
If it's not available through your standard package installer, you'll have to find another solution, such as:
That second method sounds ominous but it's really not (other than ensuring you have the right dependencies). The configure/make/install process that most source packages follow makes it remarkably easy to do in a cross-distribution manner.
Some RPMs can be found here. The GNU software is available here or you may want to check out their mirrors for a faster site.
GCC's Fortran compiler name has changed: g77
has been replaced by gfortran
, which handles Fortran 95 and possibly more recent variants.
The package in Ubuntu is called gfortran
:
sudo apt-get install gfortran
(or use synaptic)
The package in Fedora is called gfortran and is part of gcc, which you probably already have:
sudo yum install gcc
(or use pirut)
Similar searches should work for your distribution as well.
Update: On RedHat 4.1.2 the package seems to be called gcc4-gfortran
. Incidentally, you ought to be able to search for this with yum, and that may be the best answer to your question:
yum search "*fortran*"
There's http://www.g95.org/ that's available.
If I remember well GNU doesn't have a FORTRAN compiler but a FORTRAN preprocessor (or whatever the name for that is). It just translates your code to C and the compiles it with the C compiler. Of course performance becomes crap in the process.
However if you're using FORTRAN I assume it's a kind of computation project. If it's for free (not academic and not course related) you can get Intel FORTRAN compiler for free. In my experience it goes about 3-4 times faster than any free implementation.
You can also use Netbeans and make c&c++ project and make add Fortran with new .f90 file and use Netbeans tools to run and debug . before that you must install gcc and gfortran packages .
In my experience, Red Hat distributions (and those based on it) have gfortran included, but it is an option when you do the installation, so it seems probable that your system was set up without gfortran. If you have installation media, I think you should be able to install gfortran from there.
Otherwise, to get the proper gfortran RPM for your system, I suggest the related rpmfind page.
Once you get gfortran installed, I think the "-std=legacy" (quotes mine) should allow an F77 compile to work.