g77_17.txt

(61 KB) Pobierz
Go to the first, previous, next, last section, table of contents.

----------------------------------------------------------------------------

Installing GNU Fortran

The following information describes how to install g77.

The information in this file generally pertains to dealing with source
distributions of g77 and gcc. It is possible that some of this information
will be applicable to some binary distributions of these products--however,
since these distributions are not made by the maintainers of g77,
responsibility for binary distributions rests with whoever built and first
distributed them.

Nevertheless, efforts to make g77 easier to both build and install from
source and package up as a binary distribution are ongoing.

Prerequisites

The procedures described to unpack, configure, build, and install g77 assume
your system has certain programs already installed.

The following prerequisites should be met by your system before you follow
the g77 installation instructions:

gzip
     To unpack the gcc and g77 distributions, you'll need the gunzip utility
     in the gzip distribution. Most UNIX systems already have gzip
     installed. If yours doesn't, you can get it from the FSF. Note that
     you'll need tar and other utilities as well, but all UNIX systems have
     these. There are GNU versions of all these available--in fact, a
     complete GNU UNIX system can be put together on most systems, if
     desired.
`gcc-2.7.2.2.tar.gz'
     You need to have this, or some other applicable, version of gcc on your
     system. The version should be an exact copy of a distribution from the
     FSF. It is approximately 7MB large. If you've already unpacked
     `gcc-2.7.2.2.tar.gz' into a directory (named `gcc-2.7.2.2') called the
     source tree for gcc, you can delete the distribution itself, but you'll
     need to remember to skip any instructions to unpack this distribution.
     Without an applicable gcc source tree, you cannot build g77. You can
     obtain an FSF distribution of gcc from the FSF.
`g77-0.5.20.tar.gz'
     You probably have already unpacked this distribution, or you are
     reading an advanced copy of this manual, which is contained in this
     distribution. This distribution approximately 1MB large. You can obtain
     an FSF distribution of g77 from the FSF, the same way you obtained gcc.
100MB disk space
     For a complete bootstrap build, about 100MB of disk space is required
     for g77 by the author's current GNU/Linux system. Some juggling can
     reduce the amount of space needed; during the bootstrap process, once
     Stage 3 starts, during which the version of gcc that has been copied
     into the `stage2/' directory is used to rebuild the system, you can
     delete the `stage1/' directory to free up some space. It is likely that
     many systems don't require the complete bootstrap build, as they
     already have a recent version of gcc installed. Such systems might be
     able to build g77 with only about 75MB of free space.
patch
     Although you can do everything patch does yourself, by hand, without
     much trouble, having patch installed makes installation of new versions
     of GNU utilities such as g77 so much easier that it is worth getting.
     You can obtain patch the same way you obtained gcc and g77. In any
     case, you can apply patches by hand--patch files are designed for
     humans to read them.
make
     Your system must have make, and you will probably save yourself a lot
     of trouble if it is GNU make (sometimes referred to as gmake).
cc   Your system must have a working C compiler. See section `Installing GNU
     CC' in Using and Porting GNU CC, for more information on prerequisites
     for installing gcc.
bison
     If you do not have bison installed, you can usually work around any
     need for it, since g77 itself does not use it, and gcc normally
     includes all files generated by running it in its distribution. You can
     obtain bison the same way you obtained gcc and g77. See section Missing
     bison?, for information on how to work around not having bison.
makeinfo
     If you are missing makeinfo, you can usually work around any need for
     it. You can obtain makeinfo the same way you obtained gcc and g77. See
     section Missing makeinfo?, for information on getting around the lack
     of makeinfo.
root access
     To perform the complete installation procedures on a system, you need
     to have root access to that system, or equivalent access. Portions of
     the procedure (such as configuring and building g77) can be performed
     by any user with enough disk space and virtual memory. However, these
     instructions are oriented towards less-experienced users who want to
     install g77 on their own personal systems. System administrators with
     more experience will want to determine for themselves how they want to
     modify the procedures described below to suit the needs of their
     installation.

Problems Installing

This is a list of problems (and some apparent problems which don't really
mean anything is wrong) that show up when configuring, building, installing,
or porting GNU Fortran.

See section `Installation Problems' in Using and Porting GNU CC, for more
information on installation problems that can afflict either gcc or g77.

General Problems

These problems can occur on most or all systems.

GNU C Required

Compiling g77 requires GNU C, not just ANSI C. Fixing this wouldn't be very
hard (just tedious), but the code using GNU extensions to the C language is
expected to be rewritten for 0.6 anyway, so there are no plans for an
interim fix.

This requirement does not mean you must already have gcc installed to build
g77. As long as you have a working C compiler, you can use a bootstrap build
to automate the process of first building gcc using the working C compiler
you have, then building g77 and rebuilding gcc using that just-built gcc,
and so on.

Patching GNU CC Necessary

g77 currently requires application of a patch file to the gcc compiler tree.
The necessary patches should be folded in to the mainline gcc distribution.

Some combinations of versions of g77 and gcc might actually require no
patches, but the patch files will be provided anyway as long as there are
more changes expected in subsequent releases. These patch files might
contain unnecessary, but possibly helpful, patches. As a result, it is
possible this issue might never be resolved, except by eliminating the need
for the person configuring g77 to apply a patch by hand, by going to a more
automated approach (such as configure-time patching).

Building GNU CC Necessary

It should be possible to build the runtime without building cc1 and other
non-Fortran items, but, for now, an easy way to do that is not yet
established.

Missing strtoul

On SunOS4 systems, linking the f771 program produces an error message
concerning an undefined symbol named `_strtoul'.

This is not a g77 bug. See section Patching GNU Fortran, for information on
a workaround provided by g77.

The proper fix is either to upgrade your system to one that provides a
complete ANSI C environment, or improve gcc so that it provides one for all
the languages and configurations it supports.

Note: In earlier versions of g77, an automated workaround for this problem
was attempted. It worked for systems without `_strtoul', substituting the
incomplete-yet-sufficient version supplied with g77 for those systems.
However, the automated workaround failed mysteriously for systems that
appeared to have conforming ANSI C environments, and it was decided that,
lacking resources to more fully investigate the problem, it was better to
not punish users of those systems either by requiring them to work around
the problem by hand or by always substituting an incomplete strtoul()
implementation when their systems had a complete, working one.
Unfortunately, this meant inconveniencing users of systems not having
strtoul(), but they're using obsolete (and generally unsupported) systems
anyway.

Object File Differences

A comparison of object files after building Stage 3 during a bootstrap build
will result in `gcc/f/zzz.o' being flagged as different from the Stage 2
version. That is because it contains a string with an expansion of the
__TIME__ macro, which expands to the current time of day. It is nothing to
worry about, since `gcc/f/zzz.c' doesn't contain any actual code. It does
allow you to override its use of __DATE__ and __TIME__ by defining macros
for the compilation--see the source code for details.

Cleanup Kills Stage Directories

It'd be helpful if g77's `Makefile.in' or `Make-lang.in' would create the
various `stagen' directories and their subdirectories, so developers and
expert installers wouldn't have to reconfigure after cleaning up.

Cross-compiler Problems

g77 has been in alpha testing since September of 1992, and in public beta
testing since February of 1995. Alpha testing was done by a small number of
people worldwide on a fairly wide variety of machines, involving
self-compilation in most or all cases. Beta testing has been done primarily
via self-compilation, but in more and more cases, cross-compilation (and
"criss-cross compilation", where a version of a compiler is built on one
machine to run on a second and generate code that runs on a third) has been
tried and has succeeded, to varying extents.

Generally, g77 can be ported to any configuration to which gcc, f2c, and
libf2c can be ported and made to work together, aside from the known
problems described in this manual. If you want to port g77 to a particular
...
Zgłoś jeśli naruszono regulamin