Thanks to assistance from Matthew Seaman,
(Last update 31 October, as gcc-2.95.1 has been updated by gcc-2.95.2. The old version has disappeared from the FTP sites so some custom modifications are required to the Makefile script)
Note: Because of variations in install, multiple toolsets, (never knowing whether a previous install might have affected the next one); some/all(?) of the following information might be wrong; and there are probably better methods for doing the following. Keep this in mind and feel free to think a bit before blindly following the instructions.
FreeBSD comes with an f2c type system for compiling Fortran programs which can cause difficulties/nuances when compiling up crystallographic Fortran programs written more for a pure GNU G77 compiler.
However, FreeBSD has a very nifty package distribution system which also allows the downloading of the egcs compiler which comes with G77. As this is not part of the canned binary distribution, Makefiles exists that will download the latest source from the home website and compile it up. Then all you need to do is a make install to install. This is normally done as root.
After installation, the GNU Fortran compiler should be called using the command g77.
|Assuming you have installed the posts distribution. (if not, as root, run /stand/sysinstall and install the packages distribution). As root, enter the /usr/ports/lang/egcs directory.
|As gcc-2.95.1 has been updated by gcc-2.95.2, edit Makefile and substitute the reference to gcc-2.95.1 with gcc-2.95.2
Type make NO_CHECKSUM=yes
FreeBSD will then try and download the egcs distribution and then configure and compiler up the system up. This may take a while and it could be good to go and have a cup of tea at this point. (Normally you would only have to type "make" but the upgrade of gcc has created some complications)
When FreeBSD finishes compiling up egcs, type make install
FreeBSD will then install the compilers including G77. On some other terminal screens (if using csh), you may have to type rehash to have it register the updated programs.
A note about thisThe slowest part of the above operation can be the download via FTP as defined in the makefile. This can also be impractical if on a dialup or very slow link. A way around this is to have already downloaded the files at a more convenient time and all you have to do is put these files in the /usr/port/distfiles directory in FreeBSD prior to running the above Makefile.
For the above distribution, the required files are:
Lists of GCC EGCS mirrors: