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.7.2.3.tar.gz /usr/FSF/g77-0.5.22.tar.gz
Users of the following systems should not blindly follow
these quick-start instructions, because of problems their
systems have coping with straightforward installation of
g77:
Instead, see section Complete Installation, for detailed information
on how to configure, build, and install g77 for your
particular system.
Also, see section Known Causes of Trouble with GNU Fortran,
for information on bugs and other problems known to afflict the
installation process, and how to report newly discovered ones.
If your system is not on the above list, and is a UNIX system or one of its variants, you should be able to follow the instructions below. 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.7.2.3.tar.gz | tar xf - [Might say "Broken pipe"...that is normal on some systems.] sh[ 3]# gunzip -c < /usr/FSF/g77-0.5.22.tar.gz | tar xf - ["Broken pipe" again possible.] sh[ 4]# ln -s gcc-2.7.2.3 gcc sh[ 5]# ln -s g77-0.5.22 g77 sh[ 6]# mv -i g77/* gcc [No questions should be asked by mv here; or, you made a mistake.] sh[ 7]# patch -p1 -E -V t -d gcc < gcc/f/gbe/2.7.2.3.diff [Unless patch complains about rejected patches, this step worked.] sh[ 8]# cd gcc sh[ 9]# touch f77-install-ok [Do not do the above if your system already has an f77 command, unless you've checked that overwriting it is okay.] sh[10]# touch f2c-install-ok [Do not do the above if your system already has an f2c command, unless you've checked that overwriting it is okay. Else, touch f2c-exists-ok.] sh[11]# ./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[12]# make bootstrap [This takes a long time, and is where most problems occur.] sh[13]# make compare [This verifies that the compiler is `sane'. Only the file `f/zzz.o' (aka `tmp-foo1' and `tmp-foo2') should be in the list of object files this command prints as having different contents. If other files are printed, you have likely found a g77 bug.] sh[14]# rm -fr stage1 sh[15]# make -k install [The actual installation.] sh[16]# g77 -v [Verify that g77 is installed, obtain version info.] sh[17]#
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:
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.
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.22 of g77.
g77.
See section Unpacking, for information on
using distributions of g77 made by organizations
other than the FSF.
g77 are
installed on your system.
See section Unpacking, for information
on the contents of the `g77' directory (as merged
into the `gcc' directory).
patch version 2.5 or later,
this should produce a list of files patched.
(Other versions of patch might not work
properly.)
If messages about "fuzz", "offset", or
especially "reject files" are printed, it might
mean you applied the wrong patch file.
If you believe this is the case, it is best to restart
the sequence after deleting (or at least renaming to unused
names) the top-level directories for g77 and gcc
and their symbolic links.
After this command finishes, the gcc directory might
have old versions of several files as saved by patch.
To remove these, after cd gcc, type rm -i *.~*~.
See section Merging Distributions, for more information.
Note: gcc versions circa 2.7.2.2 and 2.7.2.3
are known to have slightly differing versions of the
gcc/ChangeLog file,
depending on how they are obtained.
You can safely ignore diagnostics patch reports
when patching this particular file,
since it is purely a documentation file for implementors.
See `gcc/f/gbe/2.7.2.3.diff' for more information.
f77 (such as a native compiler, or a
script that invokes f2c).
Otherwise, installation will overwrite the f77 command
and the f77 man pages with copies of the corresponding
g77 material.
See section Installing f77, for more
information.
libf2c (though, chances are, you do).
Instead, touch f2c-exists-ok to allow the installation
to continue without any error messages about `/usr/lib/libf2c.a'
already existing.
See section Installing f2c, for more
information.
g77 so that it does not fully
replace the existing installation of gcc is likely
to result in the inability to compile Fortran programs.
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.
g77-specific
information on this step.
make -k install install-libf77 install-f2c-allSee 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.
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#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.