Go to the first, previous, next, last section, table of contents.


Quick Start

This procedure configures, builds, and installs g77 "out of the box" and works on most UNIX systems. Each command is identified by a unique number, used in the explanatory text that follows. For the most part, the output of each command is not shown, though indications of the types of responses are given in a few cases.

To perform this procedure, the installer must be logged in as user root. Much of it can be done while not logged in as root, and users experienced with UNIX administration should be able to modify the procedure properly to do so.

Following traditional UNIX conventions, it is assumed that the source trees for g77 and gcc will be placed in `/usr/src'. It also is assumed that the source distributions themselves already reside in `/usr/FSF', a naming convention used by the author of g77 on his own system:

/usr/FSF/gcc-2.8.1.tar.gz
/usr/FSF/g77-0.5.23.tar.gz

If you vary any of the steps below, you might run into trouble, including possibly breaking existing programs for other users of your system. Before doing so, it is wise to review the explanations of some of the steps. These explanations follow this list of steps.

sh[ 1]# cd /usr/src
sh[ 2]# gunzip -c < /usr/FSF/gcc-2.8.1.tar.gz | tar xf -
[Might say "Broken pipe"...that is normal on some systems.]
sh[ 3]# gunzip -c < /usr/FSF/g77-0.5.23.tar.gz | tar xf -
["Broken pipe" again possible.]
sh[ 4]# ln -s gcc-2.8.1 gcc
sh[ 5]# ln -s g77-0.5.23 g77
sh[ 6]# mv -i g77/* gcc
[No questions should be asked by mv here; or, you made a mistake.]
sh[ 7]# cd gcc
sh[ 8]# ./configure --prefix=/usr
[Do not do the above if gcc is not installed in /usr/bin.
You might need a different --prefix=..., as
described below.]
sh[ 9]# make bootstrap
[This takes a long time, and is where most problems occur.]
sh[10]# make compare
[This verifies that the compiler is `sane'.
If any files are printed, you have likely found a g77 bug.]
sh[11]# rm -fr stage1
sh[12]# make -k install
[The actual installation.]
sh[13]# g77 -v
[Verify that g77 is installed, obtain version info.]
sh[14]#

See section Updating Your Info Directory, for information on how to update your system's top-level info directory to contain a reference to this manual, so that users of g77 can easily find documentation instead of having to ask you for it.

Elaborations of many of the above steps follows:

Step 1: cd /usr/src
You can build g77 pretty much anyplace. By convention, this manual assumes `/usr/src'. It might be helpful if other users on your system knew where to look for the source code for the installed version of g77 and gcc in any case.
Step 3: gunzip -d < /usr/FSF/g77-0.5.23.tar.gz | tar xf -
It is not always necessary to obtain the latest version of g77 as a complete `.tar.gz' file if you have a complete, earlier distribution of g77. If appropriate, you can unpack that earlier version of g77, and then apply the appropriate patches to achieve the same result--a source tree containing version 0.5.23 of g77.
Step 4: ln -s gcc-2.8.1 gcc
Step 5: ln -s g77-0.5.23 g77
These commands mainly help reduce typing, and help reduce visual clutter in examples in this manual showing what to type to install g77. See section Unpacking, for information on using distributions of g77 made by organizations other than the FSF.
Step 6: mv -i g77/* gcc
After doing this, you can, if you like, type `rm g77' and `rmdir g77-0.5.23' to remove the empty directory and the symbol link to it. But, it might be helpful to leave them around as quick reminders of which version(s) of g77 are installed on your system. See section Unpacking, for information on the contents of the `g77' directory (as merged into the `gcc' directory).
Step 8: ./configure --prefix=/usr
This is where you specify that the `g77' and `gcc' executables are to be installed in `/usr/bin/', the g77 and gcc documentation is to be installed in `/usr/info/' and `/usr/man/', and so on. You should ensure that any existing installation of the `gcc' executable is in `/usr/bin/'. However, if that existing version of gcc is not 2.8.1, or if you simply wish to avoid risking overwriting it with a newly built copy of the same version, you can specify `--prefix=/usr/local' (which is the default) or some other path, and invoke the newly installed version directly from that path's `bin' directory. See section Where in the World Does Fortran (and GNU CC) Go?, for more information on determining where to install g77. See section Configuring GNU CC, for more information on the configuration process triggered by invoking the `./configure' script.
Step 9: make bootstrap
See section `Installing GNU CC' in Using and Porting GNU CC, for information on the kinds of diagnostics you should expect during this procedure. See section Building GNU CC, for complete g77-specific information on this step.
Step 10: make compare
See section Where to Report Bugs, for information on where to report that you observed files having different contents during this phase. See section How to Report Bugs, for information on how to report bugs like this.
Step 11: rm -fr stage1
You don't need to do this, but it frees up disk space.
Step 12: make -k install
If this doesn't seem to work, try:
make -k install install-libf77
Or, make sure you're using GNU make. See section Installation of Binaries, for more information. See section Updating Your Info Directory, for information on entering this manual into your system's list of texinfo manuals.
Step 13: g77 -v
If this command prints approximately 25 lines of output, including the GNU Fortran Front End version number (which should be the same as the version number for the version of g77 you just built and installed) and the version numbers for the three parts of the libf2c library (libF77, libI77, libU77), and those version numbers are all in agreement, then there is a high likelihood that the installation has been successfully completed. You might consider doing further testing. For example, log in as a non-privileged user, then create a small Fortran program, such as:
      PROGRAM SMTEST
      DO 10 I=1, 10
         PRINT *, 'Hello World #', I
10    CONTINUE
      END
Compile, link, and run the above program, and, assuming you named the source file `smtest.f', the session should look like this:
sh# g77 -o smtest smtest.f
sh# ./smtest
 Hello World # 1
 Hello World # 2
 Hello World # 3
 Hello World # 4
 Hello World # 5
 Hello World # 6
 Hello World # 7
 Hello World # 8
 Hello World # 9
 Hello World # 10
sh#
If invoking g77 doesn't seem to work, the problem might be that you've installed it in a location that is not in your shell's search path. For example, if you specified `--prefix=/gnu', and `/gnu/bin' is not in your PATH environment variable, you must explicitly specify the location of the compiler via /gnu/bin/g77 -o smtest smtest.f. After proper installation, you don't need to keep your gcc and g77 source and build directories around anymore. Removing them can free up a lot of disk space.


Go to the first, previous, next, last section, table of contents.