1 *Note:* This file is automatically generated from the files
2 `install0.texi' and `g77install.texi'. `INSTALL' is *not* a source
3 file, although it is normally included within source distributions.
5 This file contains installation information for the GNU Fortran
6 compiler. Copyright (C) {No Value For "copyrights-install"} Free
7 Software Foundation, Inc. You may copy, distribute, and modify it
8 freely as long as you preserve this copyright notice and permission
11 Installing GNU Fortran
12 **********************
14 The following information describes how to install `g77'.
16 The information in this file generally pertains to dealing with
17 *source* distributions of `g77' and `gcc'. It is possible that some of
18 this information will be applicable to some *binary* distributions of
19 these products--however, since these distributions are not made by the
20 maintainers of `g77', responsibility for binary distributions rests with
21 whoever built and first distributed them.
23 Nevertheless, efforts to make `g77' easier to both build and install
24 from source and package up as a binary distribution are ongoing.
26 *Warning:* The information below is still under development, and
27 might not accurately reflect the `g77' code base of which it is a part.
28 Efforts are made to keep it somewhat up-to-date, but they are
29 particularly concentrated on any version of this information that is
30 distributed as part of a *released* `g77'.
32 In particular, while this information is intended to apply to the
33 FSF-0.5.25 version of `g77', only an official *release* of that version
34 is expected to contain documentation that is most consistent with the
35 `g77' product in that version.
37 The following information was last updated on 1999-05-10:
42 The procedures described to unpack, configure, build, and install
43 `g77' assume your system has certain programs already installed.
45 The following prerequisites should be met by your system before you
46 follow the `g77' installation instructions:
49 To unpack the `gcc' and `g77' distributions, you'll need the
50 `gunzip' utility in the `gzip' distribution. Most UNIX systems
51 already have `gzip' installed. If yours doesn't, you can get it
54 Note that you'll need `tar' and other utilities as well, but all
55 UNIX systems have these. There are GNU versions of all these
56 available--in fact, a complete GNU UNIX system can be put together
57 on most systems, if desired.
59 The version of GNU `gzip' used to package this release is
60 1.2.4. (The version of GNU `tar' used to package this release is
64 You need to have this, or some other applicable, version of `gcc'
65 on your system. The version should be an exact copy of a
66 distribution from the FSF. Its size is approximately 8.4MB.
68 If you've already unpacked `gcc-2.8.1.tar.gz' into a directory
69 (named `gcc-2.8.1') called the "source tree" for `gcc', you can
70 delete the distribution itself, but you'll need to remember to
71 skip any instructions to unpack this distribution.
73 Without an applicable `gcc' source tree, you cannot build `g77'.
74 You can obtain an FSF distribution of `gcc' from the FSF.
77 You probably have already unpacked this package, or you are
78 reading an advance copy of these installation instructions, which
79 are contained in this distribution. The size of this package is
82 You can obtain an FSF distribution of `g77' from the FSF, the same
83 way you obtained `gcc'.
86 The amount of disk space needed to unpack, build, install, and use
87 `g77' depends on the type of system you're using, how you build
88 `g77', and how much of it you install (primarily, which languages
91 The sizes shown below assume all languages distributed in
92 `gcc-2.8.1', plus `g77', will be built and installed. These sizes
93 are indicative of GNU/Linux systems on Intel x86 running COFF and
94 on Digital Alpha (AXP) systems running ELF. These should be
95 fairly representative of 32-bit and 64-bit systems, respectively.
97 Note that all sizes are approximate and subject to change without
98 notice! They are based on preliminary releases of g77 made shortly
99 before the public beta release.
101 -- `gcc' and `g77' distributions occupy 10MB packed, 40MB
102 unpacked. These consist of the source code and documentation,
103 plus some derived files (mostly documentation), for `gcc' and
104 `g77'. Any deviations from these numbers for different kinds
105 of systems are likely to be very minor.
107 -- A "bootstrap" build requires an additional 91MB for a total
108 of 132MB on an ix86, and an additional 136MB for a total of
111 -- Removing `gcc/stage1' after the build recovers 13MB for a
112 total of 119MB on an ix86, and recovers 21MB for a total of
115 After doing this, the integrity of the build can still be
116 verified via `make compare', and the `gcc' compiler modified
117 and used to build itself for testing fairly quickly, using
118 the copy of the compiler kept in `gcc/stage2'.
120 -- Removing `gcc/stage2' after the build further recovers 39MB
121 for a total of 80MB, and recovers 57MB for a total of 98MB on
124 After doing this, the compiler can still be installed,
125 especially if GNU `make' is used to avoid gratuitous rebuilds
126 (or, the installation can be done by hand).
128 -- Installing `gcc' and `g77' copies 23MB onto the `--prefix'
129 disk for a total of 103MB on an ix86, and copies 31MB onto
130 the `--prefix' disk for a total of 130MB on an Alpha.
132 After installation, if no further modifications and builds of
133 `gcc' or `g77' are planned, the source and build directory may be
134 removed, leaving the total impact on a system's disk storage as
135 that of the amount copied during installation.
137 Systems with the appropriate version of `gcc' installed don't
138 require the complete bootstrap build. Doing a "straight build"
139 requires about as much space as does a bootstrap build followed by
140 removing both the `gcc/stage1' and `gcc/stage2' directories.
142 Installing `gcc' and `g77' over existing versions might require
143 less *new* disk space, but note that, unlike many products, `gcc'
144 installs itself in a way that avoids overwriting other installed
145 versions of itself, so that other versions may easily be invoked
146 (via `gcc -V VERSION').
148 So, the amount of space saved as a result of having an existing
149 version of `gcc' and `g77' already installed is not
150 much--typically only the command drivers (`gcc', `g77', `g++', and
151 so on, which are small) and the documentation is overwritten by
152 the new installation. The rest of the new installation is done
153 without replacing existing installed versions (assuming they have
154 different version numbers).
157 Your system must have `make', and you will probably save yourself
158 a lot of trouble if it is GNU `make' (sometimes referred to as
159 `gmake'). In particular, you probably need GNU `make' to build
160 outside the source directory (with `configure''s `--srcdir'
163 The version of GNU `make' used to develop this release is
167 Your system must have a working C compiler. If it doesn't, you
168 might be able to obtain a prebuilt binary of some version of `gcc'
169 from the network or on CD-ROM, perhaps from the FSF. The best
170 source of information about binaries is probably a system-specific
171 Usenet news group, initially via its FAQ.
173 *Note Installing GNU CC: (gcc)Installation, for more information
174 on prerequisites for installing `gcc'.
177 All UNIX systems have `sed', but some have a broken version that
178 cannot handle configuring, building, or installing `gcc' or `g77'.
180 The version of GNU `sed' used to develop this release is
181 2.05. (Note that GNU `sed' version 3.0 was withdrawn by the
182 FSF--if you happen to have this version installed, replace it with
183 version 2.05 immediately. See a GNU distribution site for further
186 `root' access or equivalent
187 To perform the complete installation procedures on a system, you
188 need to have `root' access to that system, or equivalent access to
189 the `--prefix' directory tree specified on the `configure' command
192 Portions of the procedure (such as configuring and building `g77')
193 can be performed by any user with enough disk space and virtual
196 However, these instructions are oriented towards less-experienced
197 users who want to install `g77' on their own personal systems.
199 System administrators with more experience will want to determine
200 for themselves how they want to modify the procedures described
201 below to suit the needs of their installation.
204 The version of GNU `autoconf' used to develop this release is
207 `autoconf' is not needed in the typical case of installing `gcc'
208 and `g77'. *Note Missing tools?::, for information on when it
209 might be needed and how to work around not having it.
212 The version of GNU `bison' used to develop this release is
215 `bison' is not needed in the typical case of installing `gcc' and
216 `g77'. *Note Missing tools?::, for information on when it might
217 be needed and how to work around not having it.
220 The version of GNU `gperf' used to develop this release is
223 `gperf' is not needed in the typical case of installing `gcc' and
224 `g77'. *Note Missing tools?::, for information on when it might
225 be needed and how to work around not having it.
228 The version of GNU `makeinfo' used to develop this release is
231 `makeinfo' is part of the GNU `texinfo' package; `makeinfo'
232 version 1.68 is distributed as part of GNU `texinfo' version
235 `makeinfo' is not needed in the typical case of installing `gcc'
236 and `g77'. *Note Missing tools?::, for information on when it
237 might be needed and how to work around not having it.
239 An up-to-date version of GNU `makeinfo' is still convenient when
240 obtaining a new version of a GNU distribution such as `gcc' or
241 `g77', as it allows you to obtain the `.diff.gz' file instead of
242 the entire `.tar.gz' distribution (assuming you have installed
246 The version of GNU `patch' used to develop this release is
249 Beginning with `g77' version 0.5.23, it is no longer necessary to
250 patch the `gcc' back end to build `g77'.
252 An up-to-date version of GNU `patch' is still convenient when
253 obtaining a new version of a GNU distribution such as `gcc' or
254 `g77', as it allows you to obtain the `.diff.gz' file instead of
255 the entire `.tar.gz' distribution (assuming you have installed the
256 tools needed to rebuild derived files, such as `makeinfo').
261 This is a list of problems (and some apparent problems which don't
262 really mean anything is wrong) that show up when configuring, building,
263 installing, or porting GNU Fortran.
265 *Note Installation Problems: (gcc)Installation Problems, for more
266 information on installation problems that can afflict either `gcc' or
272 These problems can occur on most or all systems.
277 Compiling `g77' requires GNU C, not just ANSI C. Fixing this
278 wouldn't be very hard (just tedious), but the code using GNU extensions
279 to the C language is expected to be rewritten for 0.6 anyway, so there
280 are no plans for an interim fix.
282 This requirement does not mean you must already have `gcc' installed
283 to build `g77'. As long as you have a working C compiler, you can use a
284 "bootstrap" build to automate the process of first building `gcc' using
285 the working C compiler you have, then building `g77' and rebuilding
286 `gcc' using that just-built `gcc', and so on.
291 `g77' no longer requires application of a patch file to the `gcc'
292 compiler tree. In fact, no such patch file is distributed with `g77'.
293 This is as of version 0.5.23 and `egcs' version 1.0.
295 Building GNU CC Necessary
296 .........................
298 It should be possible to build the runtime without building `cc1'
299 and other non-Fortran items, but, for now, an easy way to do that is
302 Missing strtoul or bsearch
303 ..........................
305 On SunOS4 systems, linking the `f771' program used to produce an
306 error message concerning an undefined symbol named `_strtoul', because
307 the `strtoul' library function is not provided on that system.
309 Other systems have, in the past, been reported to not provide their
310 own `strtoul' or `bsearch' function.
312 Some versions `g77' tried to default to providing bare-bones
313 versions of `bsearch' and `strtoul' automatically, but every attempt at
314 this has failed for at least one kind of system.
316 To limit the failures to those few systems actually missing the
317 required routines, the bare-bones versions are still provided, in
318 `egcs/gcc/f/proj.c', if the appropriate macros are defined. These are
319 `NEED_BSEARCH' for `bsearch' and `NEED_STRTOUL' for `NEED_STRTOUL'.
321 Therefore, if you are sure your system is missing `bsearch' or
322 `strtoul' in its library, define the relevant macro(s) before building
323 `g77'. This can be done by editing `egcs/gcc/f/proj.c' and inserting
324 either or both of the following `#define' statements before the comment
327 /* Insert #define statements here. */
332 Then, continue configuring and building `g77' as usual.
334 Or, you can define these on the `make' command line. To build with
335 the bundled `cc' on SunOS4, for example, try:
336 make bootstrap BOOT_CFLAGS='-O2 -g -DNEED_STRTOUL'
338 If you then encounter problems compiling `egcs/gcc/f/proj.c', it
339 might be due to a discrepancy between how `bsearch' or `strtoul' are
340 defined by that file and how they're declared by your system's header
343 In that case, you'll have to use some basic knowledge of C to work
344 around the problem, perhaps by editing `egcs/gcc/f/proj.c' somewhat.
346 Cleanup Kills Stage Directories
347 ...............................
349 It'd be helpful if `g77''s `Makefile.in' or `Make-lang.in' would
350 create the various `stageN' directories and their subdirectories, so
351 developers and expert installers wouldn't have to reconfigure after
354 That help has arrived as of version 0.5.23 of `g77' and version 1.1
355 of `egcs'. Configuration itself no longer creates any particular
356 directories that are unique to `g77'. The build procedures in
357 `Make-lang.in' take care of that, on demand.
359 LANGUAGES Macro Ignored
360 .......................
362 Prior to version 0.5.23 of `g77' and version 1.1 of `egcs', `g77'
363 would sometimes ignore the absence of `f77' and `F77' in the
364 `LANGUAGES' macro definition used for the `make' command being
367 As of `g77' version 0.5.23 and `egcs' version 1.1, `g77' now obeys
368 this macro in all relevant situations.
370 However, in versions of `gcc' through 2.8.1, non-`g77' portions of
371 `gcc', such as `g++', are known to go ahead and perform various
372 language-specific activities when their respective language strings do
373 not appear in the `LANGUAGES' macro in effect during that invocation of
376 It is expected that these remaining problems will be fixed in a
377 future version of `gcc'.
379 System-specific Problems
380 ------------------------
382 A linker bug on some versions of AIX 4.1 might prevent building when
383 `g77' is built within `gcc'. It might also occur when building within
386 Cross-compiler Problems
387 -----------------------
389 `g77' has been in alpha testing since September of 1992, and in
390 public beta testing since February of 1995. Alpha testing was done by
391 a small number of people worldwide on a fairly wide variety of
392 machines, involving self-compilation in most or all cases. Beta
393 testing has been done primarily via self-compilation, but in more and
394 more cases, cross-compilation (and "criss-cross compilation", where a
395 version of a compiler is built on one machine to run on a second and
396 generate code that runs on a third) has been tried and has succeeded,
399 Generally, `g77' can be ported to any configuration to which `gcc',
400 `f2c', and `libf2c' can be ported and made to work together, aside from
401 the known problems described in this manual. If you want to port `g77'
402 to a particular configuration, you should first make sure `gcc' and
403 `libf2c' can be ported to that configuration before focusing on `g77',
404 because `g77' is so dependent on them.
406 Even for cases where `gcc' and `libf2c' work, you might run into
407 problems with cross-compilation on certain machines, for several
410 * There is one known bug (a design bug to be fixed in 0.6) that
411 prevents configuration of `g77' as a cross-compiler in some cases,
412 though there are assumptions made during configuration that
413 probably make doing non-self-hosting builds a hassle, requiring
416 * `gcc' might still have some trouble being configured for certain
417 combinations of machines. For example, it might not know how to
418 handle floating-point constants.
420 * Improvements to the way `libg2c' is built could make building
421 `g77' as a cross-compiler easier--for example, passing and using
422 `$(LD)' and `$(AR)' in the appropriate ways. (This is improved in
423 the `egcs' version of `g77', especially as of version 1.1.)
425 * There are still some challenges putting together the right
426 run-time libraries (needed by `libg2c') for a target system,
427 depending on the systems involved in the configuration. (This is
428 a general problem with cross-compilation, and with `gcc' in
431 Changing Settings Before Building
432 =================================
434 Here are some internal `g77' settings that can be changed by editing
435 source files in `egcs/gcc/f/' before building.
437 This information, and perhaps even these settings, represent
438 stop-gap solutions to problems people doing various ports of `g77' have
439 encountered. As such, none of the following information is expected to
440 be pertinent in future versions of `g77'.
442 Larger File Unit Numbers
443 ------------------------
445 As distributed, whether as part of `f2c' or `g77', `libf2c' accepts
446 file unit numbers only in the range 0 through 99. For example, a
447 statement such as `WRITE (UNIT=100)' causes a run-time crash in
448 `libf2c', because the unit number, 100, is out of range.
450 If you know that Fortran programs at your installation require the
451 use of unit numbers higher than 99, you can change the value of the
452 `MXUNIT' macro, which represents the maximum unit number, to an
453 appropriately higher value.
455 To do this, edit the file `egcs/libf2c/libI77/fio.h' in your `g77'
456 source tree, changing the following line:
460 Change the line so that the value of `MXUNIT' is defined to be at
461 least one *greater* than the maximum unit number used by the Fortran
462 programs on your system.
464 (For example, a program that does `WRITE (UNIT=255)' would require
465 `MXUNIT' set to at least 256 to avoid crashing.)
467 Then build or rebuild `g77' as appropriate.
469 *Note:* Changing this macro has *no* effect on other limits your
470 system might place on the number of files open at the same time. That
471 is, the macro might allow a program to do `WRITE (UNIT=100)', but the
472 library and operating system underlying `libf2c' might disallow it if
473 many other files have already been opened (via `OPEN' or implicitly via
474 `READ', `WRITE', and so on). Information on how to increase these
475 other limits should be found in your system's documentation.
480 Some Fortran programs require output (writes) to be flushed to the
481 operating system (under UNIX, via the `fflush()' library call) so that
482 errors, such as disk full, are immediately flagged via the relevant
483 `ERR=' and `IOSTAT=' mechanism, instead of such errors being flagged
484 later as subsequent writes occur, forcing the previously written data
485 to disk, or when the file is closed.
487 Essentially, the difference can be viewed as synchronous error
488 reporting (immediate flagging of errors during writes) versus
489 asynchronous, or, more precisely, buffered error reporting (detection
490 of errors might be delayed).
492 `libg2c' supports flagging write errors immediately when it is built
493 with the `ALWAYS_FLUSH' macro defined. This results in a `libg2c' that
494 runs slower, sometimes quite a bit slower, under certain
495 circumstances--for example, accessing files via the networked file
496 system NFS--but the effect can be more reliable, robust file I/O.
498 If you know that Fortran programs requiring this level of precision
499 of error reporting are to be compiled using the version of `g77' you
500 are building, you might wish to modify the `g77' source tree so that
501 the version of `libg2c' is built with the `ALWAYS_FLUSH' macro defined,
502 enabling this behavior.
504 To do this, find this line in `egcs/libf2c/f2c.h' in your `g77'
507 /* #define ALWAYS_FLUSH */
509 Remove the leading `/* ', so the line begins with `#define', and the
512 Then build or rebuild `g77' as appropriate.
514 Maximum Stackable Size
515 ----------------------
517 `g77', on most machines, puts many variables and arrays on the stack
518 where possible, and can be configured (by changing
519 `FFECOM_sizeMAXSTACKITEM' in `egcs/gcc/f/com.c') to force smaller-sized
520 entities into static storage (saving on stack space) or permit
521 larger-sized entities to be put on the stack (which can improve
522 run-time performance, as it presents more opportunities for the GBE to
523 optimize the generated code).
525 *Note:* Putting more variables and arrays on the stack might cause
526 problems due to system-dependent limits on stack size. Also, the value
527 of `FFECOM_sizeMAXSTACKITEM' has no effect on automatic variables and
528 arrays. *Note But-bugs::, for more information.
530 Floating-point Bit Patterns
531 ---------------------------
533 The `g77' build will crash if an attempt is made to build it as a
534 cross-compiler for a target when `g77' cannot reliably determine the
535 bit pattern of floating-point constants for the target. Planned
536 improvements for version 0.6 of `g77' will give it the capabilities it
537 needs to not have to crash the build but rather generate correct code
538 for the target. (Currently, `g77' would generate bad code under such
539 circumstances if it didn't crash during the build, e.g. when compiling
540 a source file that does something like `EQUIVALENCE (I,R)' and `DATA
543 Initialization of Large Aggregate Areas
544 ---------------------------------------
546 A warning message is issued when `g77' sees code that provides
547 initial values (e.g. via `DATA') to an aggregate area (`COMMON' or
548 `EQUIVALENCE', or even a large enough array or `CHARACTER' variable)
549 that is large enough to increase `g77''s compile time by roughly a
552 This size currently is quite small, since `g77' currently has a
553 known bug requiring too much memory and time to handle such cases. In
554 `egcs/gcc/f/data.c', the macro `FFEDATA_sizeTOO_BIG_INIT_' is defined
555 to the minimum size for the warning to appear. The size is specified
556 in storage units, which can be bytes, words, or whatever, on a
559 After changing this macro definition, you must (of course) rebuild
560 and reinstall `g77' for the change to take effect.
562 Note that, as of version 0.5.18, improvements have reduced the scope
563 of the problem for *sparse* initialization of large arrays, especially
564 those with large, contiguous uninitialized areas. However, the warning
565 is issued at a point prior to when `g77' knows whether the
566 initialization is sparse, and delaying the warning could mean it is
567 produced too late to be helpful.
569 Therefore, the macro definition should not be adjusted to reflect
570 sparse cases. Instead, adjust it to generate the warning when densely
571 initialized arrays begin to cause responses noticeably slower than
572 linear performance would suggest.
577 `g77' used to warn when it was used to compile Fortran code for a
578 target configuration that is not basically a 32-bit machine (such as an
579 Alpha, which is a 64-bit machine, especially if it has a 64-bit
580 operating system running on it). That was because `g77' was known to
581 not work properly on such configurations.
583 As of version 0.5.20, `g77' is believed to work well enough on such
584 systems. So, the warning is no longer needed or provided.
586 However, support for 64-bit systems, especially in areas such as
587 cross-compilation and handling of intrinsics, is still incomplete. The
588 symptoms are believed to be compile-time diagnostics rather than the
589 generation of bad code. It is hoped that version 0.6 will completely
590 support 64-bit systems.
595 This procedure configures, builds, and installs `g77' "out of the
596 box" and works on most UNIX systems. Each command is identified by a
597 unique number, used in the explanatory text that follows. For the most
598 part, the output of each command is not shown, though indications of
599 the types of responses are given in a few cases.
601 To perform this procedure, the installer must be logged in as user
602 `root'. Much of it can be done while not logged in as `root', and
603 users experienced with UNIX administration should be able to modify the
604 procedure properly to do so.
606 Following traditional UNIX conventions, it is assumed that the
607 source trees for `g77' and `gcc' will be placed in `/usr/src'. It also
608 is assumed that the source distributions themselves already reside in
609 `/usr/FSF', a naming convention used by the author of `g77' on his own
612 /usr/FSF/gcc-2.8.1.tar.gz
613 /usr/FSF/g77-0.5.25.tar.gz
615 If you vary *any* of the steps below, you might run into trouble,
616 including possibly breaking existing programs for other users of your
617 system. Before doing so, it is wise to review the explanations of some
618 of the steps. These explanations follow this list of steps.
622 sh[ 2]# gunzip -c < /usr/FSF/gcc-2.8.1.tar.gz | tar xf -
623 [Might say "Broken pipe"...that is normal on some systems.]
625 sh[ 3]# gunzip -c < /usr/FSF/g77-0.5.25.tar.gz | tar xf -
626 ["Broken pipe" again possible.]
628 sh[ 4]# ln -s gcc-2.8.1 gcc
630 sh[ 5]# ln -s g77-0.5.25 g77
632 sh[ 6]# mv -i g77/* gcc
633 [No questions should be asked by mv here; or, you made a mistake.]
636 sh[ 8]# ./configure --prefix=/usr
637 [Do not do the above if gcc is not installed in /usr/bin.
638 You might need a different --prefix=..., as
641 sh[ 9]# make bootstrap
642 [This takes a long time, and is where most problems occur.]
645 [This verifies that the compiler is `sane'.
646 If any files are printed, you have likely found a g77 bug.]
648 sh[11]# rm -fr stage1
650 sh[12]# make -k install
651 [The actual installation.]
654 [Verify that g77 is installed, obtain version info.]
658 *Note Updating Your Info Directory: Updating Documentation, for
659 information on how to update your system's top-level `info' directory
660 to contain a reference to this manual, so that users of `g77' can
661 easily find documentation instead of having to ask you for it.
663 Elaborations of many of the above steps follows:
665 Step 1: `cd /usr/src'
666 You can build `g77' pretty much anyplace. By convention, this
667 manual assumes `/usr/src'. It might be helpful if other users on
668 your system knew where to look for the source code for the
669 installed version of `g77' and `gcc' in any case.
671 Step 3: `gunzip -d < /usr/FSF/g77-0.5.25.tar.gz | tar xf -'
672 It is not always necessary to obtain the latest version of `g77'
673 as a complete `.tar.gz' file if you have a complete, earlier
674 distribution of `g77'. If appropriate, you can unpack that earlier
675 version of `g77', and then apply the appropriate patches to
676 achieve the same result--a source tree containing version
679 Step 4: `ln -s gcc-2.8.1 gcc'
681 Step 5: `ln -s g77-0.5.25 g77'
682 These commands mainly help reduce typing, and help reduce visual
683 clutter in examples in this manual showing what to type to install
686 *Note Unpacking::, for information on using distributions of `g77'
687 made by organizations other than the FSF.
689 Step 6: `mv -i g77/* gcc'
690 After doing this, you can, if you like, type `rm g77' and `rmdir
691 g77-0.5.25' to remove the empty directory and the symbol link to
692 it. But, it might be helpful to leave them around as quick
693 reminders of which version(s) of `g77' are installed on your
696 *Note Unpacking::, for information on the contents of the `g77'
697 directory (as merged into the `gcc' directory).
699 Step 8: `./configure --prefix=/usr'
700 This is where you specify that the `g77' and `gcc' executables are
701 to be installed in `/usr/bin/', the `g77' and `gcc' documentation
702 is to be installed in `/usr/info/' and `/usr/man/', and so on.
704 You should ensure that any existing installation of the `gcc'
705 executable is in `/usr/bin/'.
707 However, if that existing version of `gcc' is not 2.8.1, or if you
708 simply wish to avoid risking overwriting it with a newly built
709 copy of the same version, you can specify `--prefix=/usr/local'
710 (which is the default) or some other path, and invoke the newly
711 installed version directly from that path's `bin' directory.
713 *Note Where in the World Does Fortran (and GNU CC) Go?: Where to
714 Install, for more information on determining where to install
715 `g77'. *Note Configuring gcc::, for more information on the
716 configuration process triggered by invoking the `./configure'
719 Step 9: `make bootstrap'
720 *Note Installing GNU CC: (gcc)Installation, for information on the
721 kinds of diagnostics you should expect during this procedure.
723 *Note Building gcc::, for complete `g77'-specific information on
726 Step 10: `make compare'
727 *Note Where to Port Bugs: Bug Lists, for information on where to
728 report that you observed files having different contents during
731 *Note How to Report Bugs: Bug Reporting, for information on *how*
732 to report bugs like this.
734 Step 11: `rm -fr stage1'
735 You don't need to do this, but it frees up disk space.
737 Step 12: `make -k install'
738 If this doesn't seem to work, try:
740 make -k install install-libf77
742 Or, make sure you're using GNU `make'.
744 *Note Installation of Binaries::, for more information.
746 *Note Updating Your Info Directory: Updating Documentation, for
747 information on entering this manual into your system's list of
751 If this command prints approximately 25 lines of output, including
752 the GNU Fortran Front End version number (which should be the same
753 as the version number for the version of `g77' you just built and
754 installed) and the version numbers for the three parts of the
755 `libf2c' library (`libF77', `libI77', `libU77'), and those version
756 numbers are all in agreement, then there is a high likelihood that
757 the installation has been successfully completed.
759 You might consider doing further testing. For example, log in as
760 a non-privileged user, then create a small Fortran program, such
765 PRINT *, 'Hello World #', I
769 Compile, link, and run the above program, and, assuming you named
770 the source file `smtest.f', the session should look like this:
772 sh# g77 -o smtest smtest.f
786 If invoking `g77' doesn't seem to work, the problem might be that
787 you've installed it in a location that is not in your shell's
788 search path. For example, if you specified `--prefix=/gnu', and
789 `/gnu/bin' is not in your `PATH' environment variable, you must
790 explicitly specify the location of the compiler via `/gnu/bin/g77
793 After proper installation, you don't need to keep your gcc and g77
794 source and build directories around anymore. Removing them can
795 free up a lot of disk space.
797 Complete Installation
798 =====================
800 Here is the complete `g77'-specific information on how to configure,
801 build, and install `g77'.
806 The `gcc' source distribution is a stand-alone distribution. It is
807 designed to be unpacked (producing the `gcc' source tree) and built as
808 is, assuming certain prerequisites are met (including the availability
809 of compatible UNIX programs such as `make', `cc', and so on).
811 However, before building `gcc', you will want to unpack and merge
812 the `g77' distribution in with it, so that you build a Fortran-capable
813 version of `gcc', which includes the `g77' command, the necessary
814 run-time libraries, and this manual.
816 Unlike `gcc', the `g77' source distribution is *not* a stand-alone
817 distribution. It is designed to be unpacked and, afterwards,
818 immediately merged into an applicable `gcc' source tree. That is, the
819 `g77' distribution *augments* a `gcc' distribution--without `gcc',
820 generally only the documentation is immediately usable.
822 A sequence of commands typically used to unpack `gcc' and `g77' is:
825 sh# gunzip -c /usr/FSF/gcc-2.8.1.tar.gz | tar xf -
826 sh# gunzip -c /usr/FSF/g77-0.5.25.tar.gz | tar xf -
827 sh# ln -s gcc-2.8.1 gcc
828 sh# ln -s g77-0.5.25 g77
831 *Notes:* The commands beginning with `gunzip...' might print `Broken
832 pipe...' as they complete. That is nothing to worry about, unless you
833 actually *hear* a pipe breaking. The `ln' commands are helpful in
834 reducing typing and clutter in installation examples in this manual.
835 Hereafter, the top level of `gcc' source tree is referred to as `gcc',
836 and the top level of just the `g77' source tree (prior to issuing the
837 `mv' command, above) is referred to as `g77'.
839 There are three top-level names in a `g77' distribution:
845 All three entries should be moved (or copied) into a `gcc' source
846 tree (typically named after its version number and as it appears in the
847 FSF distributions--e.g. `gcc-2.8.1').
849 `g77/f' is the subdirectory containing all of the code,
850 documentation, and other information that is specific to `g77'. The
851 other two files exist to provide information on `g77' to someone
852 encountering a `gcc' source tree with `g77' already present, who has
853 not yet read these installation instructions and thus needs help
854 understanding that the source tree they are looking at does not come
855 from a single FSF distribution. They also help people encountering an
856 unmerged `g77' source tree for the first time.
858 *Note:* Please use *only* `gcc' and `g77' source trees as
859 distributed by the FSF. Use of modified versions is likely to result
860 in problems that appear to be in the `g77' code but, in fact, are not.
861 Do not use such modified versions unless you understand all the
862 differences between them and the versions the FSF distributes--in which
863 case you should be able to modify the `g77' (or `gcc') source trees
864 appropriately so `g77' and `gcc' can coexist as they do in the stock
867 Merging Distributions
868 ---------------------
870 After merging the `g77' source tree into the `gcc' source tree, you
871 have put together a complete `g77' source tree.
873 As of version 0.5.23, `g77' no longer modifies the version number of
874 `gcc', nor does it patch `gcc' itself.
876 `g77' still depends on being merged with an appropriate version of
877 `gcc'. For version 0.5.25 of `g77', the specific version of `gcc'
880 However, other versions of `gcc' might be suitable "hosts" for this
883 GNU version numbers make it easy to figure out whether a particular
884 version of a distribution is newer or older than some other version of
885 that distribution. The format is, generally, MAJOR.MINOR.PATCH, with
886 each field being a decimal number. (You can safely ignore leading
887 zeros; for example, 1.5.3 is the same as 1.5.03.) The MAJOR field only
888 increases with time. The other two fields are reset to 0 when the
889 field to their left is incremented; otherwise, they, too, only increase
890 with time. So, version 2.6.2 is newer than version 2.5.8, and version
891 3.0 is newer than both. (Trailing `.0' fields often are omitted in
892 announcements and in names for distributions and the directories they
895 If your version of `gcc' is older than the oldest version supported
896 by `g77' (as casually determined by listing the contents of
897 `egcs/gcc/f/INSTALL/', which contains these installation instructions
898 in plain-text format), you should obtain a newer, supported version of
899 `gcc'. (You could instead obtain an older version of `g77', or try and
900 get your `g77' to work with the old `gcc', but neither approach is
901 recommended, and you shouldn't bother reporting any bugs you find if you
902 take either approach, because they're probably already fixed in the
903 newer versions you're not using.)
905 If your version of `gcc' is newer than the newest version supported
906 by `g77', it is possible that your `g77' will work with it anyway. If
907 the version number for `gcc' differs only in the PATCH field, you might
908 as well try that version of `gcc'. Since it has the same MAJOR and
909 MINOR fields, the resulting combination is likely to work.
911 So, for example, if a particular version of `g77' has support for
912 `gcc' versions 2.8.0 and 2.8.1, it is likely that `gcc-2.8.2' would
913 work well with `g77'.
915 However, `gcc-2.9.0' would almost certainly not work with that
916 version of `g77' without appropriate modifications, so a new version of
917 `g77' would be needed.
919 This complexity is the result of `gcc' and `g77' being separate
920 distributions. By keeping them separate, each product is able to be
921 independently improved and distributed to its user base more frequently.
923 However, the GBE interface defined by `gcc' typically undergoes some
924 incompatible changes at least every time the MINOR field of the version
925 number is incremented, and such changes require corresponding changes to
926 the `g77' front end (FFE).
928 Where in the World Does Fortran (and GNU CC) Go?
929 ------------------------------------------------
931 Before configuring, you should make sure you know where you want the
932 `g77' and `gcc' binaries to be installed after they're built, because
933 this information is given to the configuration tool and used during the
936 A `g77' installation normally includes installation of a
937 Fortran-aware version of `gcc', so that the `gcc' command recognizes
938 Fortran source files and knows how to compile them.
940 For this to work, the version of `gcc' that you will be building as
941 part of `g77' *must* be installed as the "active" version of `gcc' on
944 Sometimes people make the mistake of installing `gcc' as
945 `/usr/local/bin/gcc', leaving an older, non-Fortran-aware version in
946 `/usr/bin/gcc'. (Or, the opposite happens.) This can result in `gcc'
947 being unable to compile Fortran source files, because when the older
948 version of `gcc' is invoked, it complains that it does not recognize
949 the language, or the file name suffix.
951 So, determine whether `gcc' already is installed on your system,
952 and, if so, *where* it is installed, and prepare to configure the new
953 version of `gcc' you'll be building so that it installs over the
954 existing version of `gcc'.
956 You might want to back up your existing copy of `/usr/bin/gcc', and
957 the entire `/usr/lib' directory, before you perform the actual
958 installation (as described in this manual).
960 Existing `gcc' installations typically are found in `/usr' or
961 `/usr/local'. (This means the commands are installed in `/usr/bin' or
962 `/usr/local/bin', the libraries in `/usr/lib' or `/usr/local/lib', and
965 If you aren't certain where the currently installed version of `gcc'
966 and its related programs reside, look at the output of this command:
968 gcc -v -o /tmp/delete-me -xc /dev/null -xnone
970 All sorts of interesting information on the locations of various
971 `gcc'-related programs and data files should be visible in the output
972 of the above command. (The output also is likely to include a
973 diagnostic from the linker, since there's no `main_()' function.)
974 However, you do have to sift through it yourself; `gcc' currently
975 provides no easy way to ask it where it is installed and where it looks
976 for the various programs and data files it calls on to do its work.
978 Just *building* `g77' should not overwrite any installed
979 programs--but, usually, after you build `g77', you will want to install
980 it, so backing up anything it might overwrite is a good idea. (This is
981 true for any package, not just `g77', though in this case it is
982 intentional that `g77' overwrites `gcc' if it is already installed--it
983 is unusual that the installation process for one distribution
984 intentionally overwrites a program or file installed by another
985 distribution, although, in this case, `g77' is an augmentation of the
988 Another reason to back up the existing version first, or make sure
989 you can restore it easily, is that it might be an older version on
990 which other users have come to depend for certain behaviors. However,
991 even the new version of `gcc' you install will offer users the ability
992 to specify an older version of the actual compilation programs if
993 desired, and these older versions need not include any `g77' components.
994 *Note Specifying Target Machine and Compiler Version: (gcc)Target
995 Options, for information on the `-V' option of `gcc'.
1000 `g77' is configured automatically when you configure `gcc'. There
1001 are two parts of `g77' that are configured in two different
1002 ways--`g77', which "camps on" to the `gcc' configuration mechanism, and
1003 `libg2c', which uses a variation of the GNU `autoconf' configuration
1006 Generally, you shouldn't have to be concerned with either `g77' or
1007 `libg2c' configuration, unless you're configuring `g77' as a
1008 cross-compiler. In this case, the `libg2c' configuration, and possibly
1009 the `g77' and `gcc' configurations as well, might need special
1010 attention. (This also might be the case if you're porting `gcc' to a
1011 whole new system--even if it is just a new operating system on an
1012 existing, supported CPU.)
1014 To configure the system, see *Note Installing GNU CC:
1015 (gcc)Installation, following the instructions for running `./configure'.
1016 Pay special attention to the `--prefix=' option, which you almost
1017 certainly will need to specify.
1019 (Note that `gcc' installation information is provided as a
1020 plain-text file in `gcc/INSTALL'.)
1022 The information printed by the invocation of `./configure' should
1023 show that the `f' directory (the Fortran language) has been configured.
1024 If it does not, there is a problem.
1026 *Note:* Configuring with the `--srcdir' argument, or by starting in
1027 an empty directory and typing a command such as `../gcc/configure' to
1028 build with separate build and source directories, is known to work with
1029 GNU `make', but it is known to not work with other variants of `make'.
1030 Irix5.2 and SunOS4.1 versions of `make' definitely won't work outside
1031 the source directory at present.
1033 `g77''s portion of the `configure' script used to issue a warning
1034 message about this when configuring for building binaries outside the
1035 source directory, but no longer does this as of version 0.5.23.
1037 Instead, `g77' simply rejects most common attempts to build it using
1038 a non-GNU `make' when the build directory is not the same as the source
1039 directory, issuing an explanatory diagnostic.
1044 Building `g77' requires building enough of `gcc' that these
1045 instructions assume you're going to build all of `gcc', including
1046 `g++', `protoize', and so on. You can save a little time and disk
1047 space by changes the `LANGUAGES' macro definition in `gcc/Makefile.in'
1048 or `gcc/Makefile', but if you do that, you're on your own. One change
1049 is almost *certainly* going to cause failures: removing `c' or `f77'
1050 from the definition of the `LANGUAGES' macro.
1052 After configuring `gcc', which configures `g77' and `libg2c'
1053 automatically, you're ready to start the actual build by invoking
1056 *Note:* You *must* have run the `configure' script in `gcc' before
1057 you run `make', even if you're using an already existing `gcc'
1058 development directory, because `./configure' does the work to recognize
1059 that you've added `g77' to the configuration.
1061 There are two general approaches to building GNU CC from scratch:
1064 This method uses minimal native system facilities to build a
1065 barebones, unoptimized `gcc', that is then used to compile
1066 ("bootstrap") the entire system.
1069 This method assumes a more complete native system exists, and uses
1070 that just once to build the entire system.
1072 On all systems without a recent version of `gcc' already installed,
1073 the bootstrap method must be used. In particular, `g77' uses
1074 extensions to the C language offered, apparently, only by `gcc'.
1076 On most systems with a recent version of `gcc' already installed,
1077 the straight method can be used. This is an advantage, because it
1078 takes less CPU time and disk space for the build. However, it does
1079 require that the system have fairly recent versions of many GNU
1080 programs and other programs, which are not enumerated here.
1085 A complete bootstrap build is done by issuing a command beginning
1086 with `make bootstrap ...', as described in *Note Installing GNU CC:
1087 (gcc)Installation. This is the most reliable form of build, but it
1088 does require the most disk space and CPU time, since the complete system
1089 is built twice (in Stages 2 and 3), after an initial build (during
1090 Stage 1) of a minimal `gcc' compiler using the native compiler and
1093 You might have to, or want to, control the way a bootstrap build is
1094 done by entering the `make' commands to build each stage one at a time,
1095 as described in the `gcc' manual. For example, to save time or disk
1096 space, you might want to not bother doing the Stage 3 build, in which
1097 case you are assuming that the `gcc' compiler you have built is
1098 basically sound (because you are giving up the opportunity to compare a
1099 large number of object files to ensure they're identical).
1101 To save some disk space during installation, after Stage 2 is built,
1102 you can type `rm -fr stage1' to remove the binaries built during Stage
1105 Also, see *Note Installing GNU CC: (gcc)Installation, for important
1106 information on building `gcc' that is not described in this `g77'
1107 manual. For example, explanations of diagnostic messages and whether
1108 they're expected, or indicate trouble, are found there.
1113 If you have a recent version of `gcc' already installed on your
1114 system, and if you're reasonably certain it produces code that is
1115 object-compatible with the version of `gcc' you want to build as part
1116 of building `g77', you can save time and disk space by doing a straight
1119 To build just the compilers along with the necessary run-time
1120 libraries, issue the following command:
1124 If you run into problems using this method, you have two options:
1126 * Abandon this approach and do a bootstrap build.
1128 * Try to make this approach work by diagnosing the problems you're
1129 running into and retrying.
1131 Especially if you do the latter, you might consider submitting any
1132 solutions as bug/fix reports. *Note Known Causes of Trouble with GNU
1135 However, understand that many problems preventing a straight build
1136 from working are not `g77' problems, and, in such cases, are not likely
1137 to be addressed in future versions of `g77'. Consider treating them as
1140 Pre-installation Checks
1141 -----------------------
1143 Before installing the system, which includes installing `gcc', you
1144 might want to do some minimum checking to ensure that some basic things
1147 Here are some commands you can try, and output typically printed by
1148 them when they work:
1153 Driving: ./g77 -B./ -v -c -xf77-version /dev/null -xnone
1154 Reading specs from ./specs
1156 cpp -lang-c -v -isystem ./include -undef -D__GNUC__=2 ...
1157 GNU CPP version 2.8.1 (Alpha GNU/Linux with ELF)
1158 #include "..." search starts here:
1159 #include <...> search starts here:
1161 /usr/alpha-linux/include
1162 /usr/lib/gcc-lib/alpha-linux/2.8.1/include
1165 ./f771 -fnull-version -quiet -dumpbase g77-version.f -version ...
1166 GNU F77 version 2.8.1 (alpha-linux) compiled ...
1167 GNU Fortran Front End version 0.5.25
1168 as -nocpp -o /tmp/cca14485.o /tmp/cca14485.s
1169 ld -m elf64alpha -G 8 -O1 -dynamic-linker /lib/ld-linux.so.2 ...
1171 __G77_LIBF77_VERSION__: 0.5.25
1172 @(#)LIBF77 VERSION 19970919
1173 __G77_LIBI77_VERSION__: 0.5.25
1174 @(#) LIBI77 VERSION pjw,dmg-mods 19980405
1175 __G77_LIBU77_VERSION__: 0.5.25
1176 @(#) LIBU77 VERSION 19970919
1177 sh# ./xgcc -B./ -v -o /tmp/delete-me -xc /dev/null -xnone
1178 Reading specs from ./specs
1180 ./cpp -lang-c -v -isystem ./include -undef ...
1181 GNU CPP version 2.8.1 (Alpha GNU/Linux with ELF)
1182 #include "..." search starts here:
1183 #include <...> search starts here:
1185 /usr/alpha-linux/include
1186 /usr/lib/gcc-lib/alpha-linux/2.8.1/include
1189 ./cc1 /tmp/cca18063.i -quiet -dumpbase null.c -version ...
1190 GNU C version 2.8.1 (alpha-linux) compiled ...
1191 as -nocpp -o /tmp/cca180631.o /tmp/cca18063.s
1192 ld -m elf64alpha -G 8 -O1 -dynamic-linker /lib/ld-linux.so.2 ...
1193 /usr/lib/crt1.o: In function `_start':
1194 ../sysdeps/alpha/elf/start.S:77: undefined reference to `main'
1195 ../sysdeps/alpha/elf/start.S:77: undefined reference to `main'
1198 (Note that long lines have been truncated, and `...' used to
1199 indicate such truncations.)
1201 The above two commands test whether `g77' and `gcc', respectively,
1202 are able to compile empty (null) source files, whether invocation of
1203 the C preprocessor works, whether libraries can be linked, and so on.
1205 If the output you get from either of the above two commands is
1206 noticeably different, especially if it is shorter or longer in ways
1207 that do not look consistent with the above sample output, you probably
1208 should not install `gcc' and `g77' until you have investigated further.
1210 For example, you could try compiling actual applications and seeing
1211 how that works. (You might want to do that anyway, even if the above
1214 To compile using the not-yet-installed versions of `gcc' and `g77',
1215 use the following commands to invoke them.
1217 To invoke `g77', type:
1219 /usr/src/gcc/g77 -B/usr/src/gcc/ ...
1221 To invoke `gcc', type:
1223 /usr/src/gcc/xgcc -B/usr/src/gcc/ ...
1225 Installation of Binaries
1226 ------------------------
1228 After configuring, building, and testing `g77' and `gcc', when you
1229 are ready to install them on your system, type:
1231 make -k CC=gcc install
1233 As described in *Note Installing GNU CC: (gcc)Installation, the
1234 values for the `CC' and `LANGUAGES' macros should be the same as those
1235 you supplied for the build itself.
1237 So, the details of the above command might vary if you used a
1238 bootstrap build (where you might be able to omit both definitions, or
1239 might have to supply the same definitions you used when building the
1240 final stage) or if you deviated from the instructions for a straight
1243 If the above command does not install `libg2c.a' as expected, try
1246 make -k ... install install-libf77
1248 We don't know why some non-GNU versions of `make' sometimes require
1249 this alternate command, but they do. (Remember to supply the
1250 appropriate definition for `CC' where you see `...' in the above
1253 Note that using the `-k' option tells `make' to continue after some
1254 installation problems, like not having `makeinfo' installed on your
1255 system. It might not be necessary for your system.
1257 *Note:* `g77' no longer installs files not directly part of `g77',
1258 such as `/usr/bin/f77', `/usr/lib/libf2c.a', and `/usr/include/f2c.h',
1259 or their `/usr/local' equivalents.
1261 *Note Distributing Binaries::, for information on how to accommodate
1262 systems with no existing non-`g77' `f77' compiler and systems with
1265 Updating Your Info Directory
1266 ----------------------------
1268 As part of installing `g77', you should make sure users of `info'
1269 can easily access this manual on-line.
1271 `g77' does this automatically by invoking the `install-info' command
1272 when you use `make install' to install `g77'.
1274 If that fails, or if the `info' directory it updates is not the one
1275 normally accessed by users, consider invoking it yourself. For example:
1277 install-info --info-dir=/usr/info /usr/info/g77.info
1279 The above example assumes the `g77' documentation already is
1280 installed in `/usr/info' and that `/usr/info/dir' is the file you wish
1281 to update. Adjust the command accordingly, if those assumptions are
1287 A build of `gcc' might fail due to one or more tools being called
1288 upon by `make' (during the build or install process), when those tools
1289 are not installed on your system.
1291 This situation can result from any of the following actions
1292 (performed by you or someone else):
1294 * Changing the source code or documentation yourself (as a developer
1295 or technical writer).
1297 * Applying a patch that changes the source code or documentation
1298 (including, sometimes, the official patches distributed by the
1301 * Deleting the files that are created by the (missing) tools.
1303 The `make maintainer-clean' command is supposed to delete these
1304 files, so invoking this command without having all the appropriate
1305 tools installed is not recommended.
1307 * Creating the source directory using a method that does not
1308 preserve the date-time-modified information in the original
1311 For example, the UNIX `cp -r' command copies a directory tree
1312 without preserving the date-time-modified information. Use `cp
1315 The reason these activities cause `make' to try and invoke tools
1316 that it probably wouldn't when building from a perfectly "clean" source
1317 directory containing `gcc' and `g77' is that some files in the source
1318 directory (and the corresponding distribution) aren't really source
1319 files, but *derived* files that are produced by running tools with the
1320 corresponding source files as input. These derived files "depend", in
1321 `make' terminology, on the corresponding source files.
1323 `make' determines that a file that depends on another needs to be
1324 updated if the date-time-modified information for the source file shows
1325 that it is newer than the corresponding information for the derived
1328 If it makes that determination, `make' runs the appropriate commands
1329 (specified in the "Makefile") to update the derived file, and this
1330 process typically calls upon one or more installed tools to do the work.
1332 The "safest" approach to dealing with this situation is to recreate
1333 the `gcc' and `g77' source directories from complete `gcc' and `g77'
1334 distributions known to be provided by the FSF.
1336 Another fairly "safe" approach is to simply install the tools you
1337 need to complete the build process. This is especially appropriate if
1338 you've changed the source code or applied a patch to do so.
1340 However, if you're certain that the problem is limited entirely to
1341 incorrect date-time-modified information, that there are no
1342 discrepancies between the contents of source files and files derived
1343 from them in the source directory, you can often update the
1344 date-time-modified information for the derived files to work around the
1345 problem of not having the appropriate tools installed.
1347 On UNIX systems, the simplest way to update the date-time-modified
1348 information of a file is to use the use the `touch' command.
1350 How to use `touch' to update the derived files updated by each of
1351 the tools is described below. *Note:* New versions of `g77' might
1352 change the set of files it generates by invoking each of these tools.
1353 If you cannot figure out for yourself how to handle such a situation,
1354 try an older version of `g77' until you find someone who can (or until
1355 you obtain and install the relevant tools).
1360 If you cannot install `autoconf', make sure you have started with a
1361 *fresh* distribution of `gcc' and `g77', do *not* do `make
1362 maintainer-clean', and, to ensure that `autoconf' is not invoked by
1363 `make' during the build, type these commands:
1366 sh# touch configure libU77/configure
1373 If you cannot install `bison', make sure you have started with a
1374 *fresh* distribution of `gcc', do *not* do `make maintainer-clean',
1375 and, to ensure that `bison' is not invoked by `make' during the build,
1376 type these commands:
1379 sh# touch bi-parser.c bi-parser.h c-parse.c c-parse.h cexp.c
1380 sh# touch cp/parse.c cp/parse.h objc-parse.c
1387 If you cannot install `gperf', make sure you have started with a
1388 *fresh* distribution of `gcc', do *not* do `make maintainer-clean',
1389 and, to ensure that `gperf' is not invoked by `make' during the build,
1390 type these commands:
1400 If `makeinfo' is needed but unavailable when installing (via `make
1401 install'), some files, like `libg2c.a', might not be installed, because
1402 once `make' determines that it cannot invoke `makeinfo', it cancels any
1405 If you cannot install `makeinfo', an easy work-around is to specify
1406 `MAKEINFO=true' on the `make' command line, or to specify the `-k'
1407 option (`make -k install').
1409 Another approach is to force the relevant files to be up-to-date by
1410 typing these commands and then re-trying the installation step:
1413 sh# touch f/g77.info f/BUGS f/INSTALL f/NEWS
1417 Distributing Binaries
1418 =====================
1420 If you are building `g77' for distribution to others in binary form,
1421 first make sure you are aware of your legal responsibilities (read the
1422 file `gcc/COPYING' thoroughly).
1424 Then, consider your target audience and decide where `g77' should be
1427 For systems like GNU/Linux that have no native Fortran compiler (or
1428 where `g77' could be considered the native compiler for Fortran and
1429 `gcc' for C, etc.), you should definitely configure `g77' for
1430 installation in `/usr/bin' instead of `/usr/local/bin'. Specify the
1431 `--prefix=/usr' option when running `./configure'.
1433 You might also want to set up the distribution so the `f77' command
1434 is a link to `g77', although a script that accepts "classic" UNIX `f77'
1435 options and translates the command-line to the appropriate `g77'
1436 command line would be more appropriate. If you do this, *please* also
1437 provide a "man page" in `man/man1/f77.1' describing the command. (A
1438 link to `man/man1/g77.1' is appropriate if `bin/f77' is a link to
1441 For a system that might already have `f2c' installed, consider
1442 whether inter-operation with `g77' will be important to users of `f2c'
1443 on that system. If you want to improve the likelihood that users will
1444 be able to use both `f2c' and `g77' to compile code for a single program
1445 without encountering link-time or run-time incompatibilities, make sure
1446 that, whenever they intend to combine `f2c'-produced code with
1447 `g77'-produced code in an executable, they:
1449 * Use the `lib/gcc-lib/.../include/g2c.h' file generated by the
1450 `g77' build in place of the `f2c.h' file that normally comes with
1451 `f2c' (or versions of `g77' prior to 0.5.23) when compiling *all*
1452 of the `f2c'-produced C code
1454 * Link to the `lib/gcc-lib/.../libg2c.a' library built by the `g77'
1455 build instead of the `libf2c.a' library that normally comes with
1456 `f2c' (or versions of `g77' prior to 0.5.23)
1458 How you choose to effect the above depends on whether the existing
1459 installation of `f2c' must be maintained.
1461 In any case, it is important to try and ensure that the installation
1462 keeps working properly even after subsequent re-installation of `f2c',
1463 which probably involves overwriting `/usr/local/lib/libf2c.a' and
1464 `/usr/local/include/f2c.h', or similar.
1466 At least, copying `libg2c.a' and `g2c.h' into the appropriate
1467 "public" directories allows users to more easily select the version of
1468 `libf2c' they wish to use for a particular build. The names are
1469 changed by `g77' to make this coexistence easier to maintain; even if
1470 `f2c' is installed later, the `g77' files normally installed by its
1471 installation process aren't disturbed. Use of symbolic links from one
1472 set of files to another might result in problems after a subsequent
1473 reinstallation of either `f2c' or `g77', so be sure to alert users of
1474 your distribution accordingly.
1476 (Make sure you clearly document, in the description of your
1477 distribution, how installation of your distribution will affect
1478 existing installations of `gcc', `f2c', `f77', `libf2c.a', and so on.
1479 Similarly, you should clearly document any requirements you assume will
1480 be met by users of your distribution.)
1482 For other systems with native `f77' (and `cc') compilers, configure
1483 `g77' as you (or most of your audience) would configure `gcc' for their
1484 installations. Typically this is for installation in `/usr/local', and
1485 would not include a new version of `/usr/bin/f77' or
1486 `/usr/local/bin/f77', so users could still use the native `f77'.
1488 In any case, for `g77' to work properly, you *must* ensure that the
1489 binaries you distribute include:
1492 This is the command most users use to compile Fortran.
1495 This is the command some users use to compile Fortran, typically
1496 when compiling programs written in other languages at the same
1497 time. The `bin/gcc' executable file must have been built from a
1498 `gcc' source tree into which a `g77' source tree was merged and
1499 configured, or it will not know how to compile Fortran programs.
1502 This is the documentation for `g77'. If it is not included, users
1503 will have trouble understanding diagnostics messages and other
1504 such things, and will send you a lot of email asking questions.
1506 Please edit this documentation (by editing `egcs/gcc/f/*.texi' and
1507 doing `make doc' from the `/usr/src/gcc' directory) to reflect any
1508 changes you've made to `g77', or at least to encourage users of
1509 your binary distribution to report bugs to you first.
1511 Also, whether you distribute binaries or install `g77' on your own
1512 system, it might be helpful for everyone to add a line listing
1513 this manual by name and topic to the top-level `info' node in
1514 `/usr/info/dir'. That way, users can find `g77' documentation more
1515 easily. *Note Updating Your Info Directory: Updating
1519 This is the short man page for `g77'. It is not always kept
1520 up-to-date, but you might as well include it for people who really
1524 This is the directory containing the "private" files installed by
1525 and for `gcc', `g77', `g++', and other GNU compilers.
1527 `lib/gcc-lib/.../f771'
1528 This is the actual Fortran compiler.
1530 `lib/gcc-lib/.../libg2c.a'
1531 This is the run-time library for `g77'-compiled programs.
1533 Whether you want to include the slightly updated (and possibly
1534 improved) versions of `cc1', `cc1plus', and whatever other binaries get
1535 rebuilt with the changes the GNU Fortran distribution makes to the GNU
1536 back end, is up to you. These changes are highly unlikely to break any
1537 compilers, because they involve doing things like adding to the list of
1538 acceptable compiler options (so, for example, `cc1plus' accepts, and
1539 ignores, options that only `f771' actually processes).
1541 Please assure users that unless they have a specific need for their
1542 existing, older versions of `gcc' command, they are unlikely to
1543 experience any problems by overwriting it with your version--though
1544 they could certainly protect themselves by making backup copies first!
1546 Otherwise, users might try and install your binaries in a "safe"
1547 place, find they cannot compile Fortran programs with your distribution
1548 (because, perhaps, they're invoking their old version of the `gcc'
1549 command, which does not recognize Fortran programs), and assume that
1550 your binaries (or, more generally, GNU Fortran distributions in
1551 general) are broken, at least for their system.
1553 Finally, *please* ask for bug reports to go to you first, at least
1554 until you're sure your distribution is widely used and has been well
1555 tested. This especially goes for those of you making any changes to
1556 the `g77' sources to port `g77', e.g. to OS/2. <fortran@gnu.org> has
1557 received a fair number of bug reports that turned out to be problems
1558 with other peoples' ports and distributions, about which nothing could
1559 be done for the user. Once you are quite certain a bug report does not
1560 involve your efforts, you can forward it to us.