Installation of gcc, g77 and gpc 2.0

Japanese version is here.

The contents of this page is obsolete for recent C and Fortran compilers. If you don't need Pascal, you may want to visit EGCS project homepage.

Here described an installation sequence of latest version of gcc, g77 and gpc (GNU compilers of C, Fortran and Pascal). Summarizing it first:

  1. getting source archives.
  2. unpacking archives of gcc and gpc, and make.
  3. unpacking the g77 archive onto gcc source directory, and make.

FYI, versions of related binaries of our system are:

And I had gcc-2.7.0 installed from binary distribution.

Getting Sources

There are many many sites distributing sources of gcc and g77. You may find them everywhere, so try the nearest. Following are some major ones in Japan.

File names should be:


Latest gpc package corresponding to gcc is at

in Japan. Master is at:

File name is


Installation of gpc

For building gpc, you need gcc compiler which does *not* include g77 extension. So make pure gcc compiler first, and make gpc with it.

  1. Unpack source archives. It is recommended to extract gcc and gpc to different directory.

    	tar zxf gcc-
    	tar zxf gpc-2.0.tar.gz
  2. At first, Make pure gcc for gpc compilation. Option "--prefix" designates /usr as an install directory.

    	cd gcc-
    	./configure --prefix=/usr
    	make LANGUAGES=c
  3. Next, make gpc. Use version of gcc built previously.

    	cd ../gpc-2.0
    	./configure --with-gccsrc=../gcc- --with-gccbin=../gcc-
  4. "make" and "make install" as root. Large binaries should be placed at /usr/lib/gcc-lib/i?86-unknown-linux/, and you may want to "strip" them. You may also want to "gzip" the info files, which are installed to /usr/info.

Installation of gcc and g77

  1. If you have made gpc, clean the gcc source tree as distributed.

    	cd ../gcc-
    	make distclean
    	cd ..

    If you have not, just unpack the gcc source archives.

    	tar zxf gcc-
  2. Unpack the g77 source archive. "f" directory in the archive must be placed at the root of gcc source tree. Following procedure is recommended in "INSTALL" file of g77.

    	ln -s gcc- g77-
    	tar zxf g77-
    	rm g77-
  3. patch g77 extensions to gcc source

    	cd gcc-
    	patch -p1 < f/gbe/
  4. If you already use f2c and want coexist it with g77, create a file whose name is "f2c-exists-ok" in directory gcc- On the other hand, if you want use g77 as "f77", create "f77-install-ok". It is convenient to use "touch" command. Read gcc- for details.

  5. Run "configure" and "make" as follows. In the following, I designate /usr as an installation directory. Read gcc- for more detail.

    	./configure --prefix=/usr
    	make LANGUAGES=c
    	make stage1
    	make CC="stage1/xgcc -Bstage1/" CFLAGS="-O"
    	make stage2
    	rm -rf stage1
    	make CC="stage2/xgcc -Bstage2/" CFLAGS="-O"

    The procedures after the 2nd line can be replaced by

    	make bootstrap

    if you have enough disk space.

  6. Install the binaries as root. In usual cases, it is recommended to "make compare" to check the consistency of the binaries, but it has no effect in ELF case.

    	make install CC="stage2/xgcc -Bstage2/" CFLAGS="-O"\
    	LANGUAGES="c c++ objective-c g77"

    In my experience, first trial of "make install" was failed in creating g77 info, but second trial (just type "make install" again) was successful. (why?)

  7. Binaries are placed at /usr/bin and /usr/lib/gcc-lib/i?86-unknown-linux/ Strip them and gzip the info files as the case of gpc.

(last updated on 10 Feb 1996)