[CCP14 Home: (Frames | No Frames)]
CCP14 Mirrors: [UK] | [CA] | [US] | [AU]

(This Webpage Page in No Frames Mode)

Collaborative Computational Project Number 14

for Single Crystal and Powder Diffraction

CCP14

Compiling the GNU GCC/G++ C compiler

The CCP14 Homepage is at http://www.ccp14.ac.uk

[Back to CCP14 Web/Config Main Page]

[Why use GCC/G++ | Where to get GCC/G++ and libraries | Extracting tar.Z files | Compiling and Installing GCC]
[Compiling/Installing libstdc++ Libraries]


Latest gcc is 2.95.2 (nov 1999)

NB: The following may be non-optimal as still working out nuances on different systems to get a method that is psuedo bulletproof.

Why use GCC/G++

The free GNU [CCP14 Mirror] GCC/C compiler is actually superior to many commercial compilers and standard UNIX compilers that come with many UNIX systems. Most freeware/UNIX software seems to prefer gcc as the standard compiler.

Compilers like the in-the-box SGI IRIX c compiler can be highly annoying giving various cryptic warnings during compiling and regular wordy messages about getting the registering key for the c compiler that came with the Operating system - despite having paid $X,000 through the nose for the workstation in the first place. (Gripes about the SGI OS setup and implementation are scattered throughout the CCP14 admin area). However, for some programs (secure shell, apache) it can be advisable to use the SGI cc compiler for the moment due to some nuances with gcc 2.8.1 and some libraries related to handling IP addresses.

The present generation of GCC programs can be quite problematic to compile on SGIs and thus the following summaries from the newsgroups are here as the tutorial I put together broke too easily on slightly different SGI systems.

To get things happy to compile programs such as Isearch, you have to do the following:

For SGI also refer:

There are also sites carrying binary GNU compilers for various operating systems and sites of interest for programmer resources. Refer: CCP14 Auto-Mirror

The version of gcc used at the time of writing was gcc-2.95.1 This was compiled on an SGI O2 running IRIX 6.5.6.


Where to get GCC and G++ Libraries

The main GNU website is at http://www.gnu.org. There are a variety of mirrors around the place including a CCP14 auto-mirror at http://gnu.ccp14.ac.uk

Download page is at http://www.gnu.org/order/ftp.html. There are a variety of mirrors around the place including a CCP14 auto-mirror at http://gnu.ccp14.ac.uk/order/ftp.html

You need:

If you use a later version than the above, check the INSTALLATION instructions as they may have differed to what is given below.

Some of the Eurocentric FTP sites you can download the source code (presently 12.3 meg of tar.gz file)


Extracting the Distribution Files

To extract the distribution file type either This creates a subdirectories where the files are ready to configure and compile.


Compiling and Installing GNU GCC

Compiling GNU GCC on SGI IRIX

For SGI also refer:

Suggestion 1 out of 2 (milage may vary)

From: Rado Faletic [[email protected]]
Organization: Australian National University
Newsgroups: comp.sys.sgi.admin
Subject: Re: GCC 2.95.1 under 6.5.5?



I compiled the following under IRIX 6.5.4 with the 7.2.1.3 compilers,
without any hitches:
        gcc-2.95.1
        gcc-chill-2.95.1
        gcc-g++-2.95.1
        gcc-g77-2.95.1
        gcc-java-2.95.1
        gcc-objc-2.95.1

I think I did something like
        $ bash
        $ CC="cc -n32 -mips4 -r5000" MAKE=gmake ./configure --prefix=/opt/gnu
        $ gmake bootstrap

NOTE 1: the "bootstrap" makes the compiler the long way around - 1st it
makes a simple GNU compiler. This simple GNU compiler then goes and
compiles a full blown version of itself. This second compiler then
compiles a third full blow compiler, then compilers 2 and 3 are checked
against eachother for consistency. If eveything goes OK it should
compile without too much fuss.
NOTE 2: you MUST use the GNU make (gmake) program instead of the
standard IRIX make, otherwise it won't compile.


> Has anyone been able to compile gcc 2.95.1 under IRIX 6.5.5?  I am tottaly
> unable to do so.  If anyone has been succesful, would you mind sharing your

Suggestion 2 out of 2 (milage may vary)

Gregory P. Whalin [[email protected]] wrote:
: Has anyone been able to compile gcc 2.95.1 under IRIX 6.5.5?  I am tottaly
: unable to do so.  If anyone has been succesful, would you mind sharing your
: secrets?!  :)

I got 2.95.2 to compile under 6.5.5 just recently with the following 
configure line:

./configure --with-gcc-version-trigger=/usr/local/src/gcc-2.95.2/gcc/version.c \
        --host=mips-sgi-irix6.5 --prefix=/usr/local \
        --enable-languages=c++,f77,java,objc --enable-cpp --enable-threads \
        --disable-shared --norecursion

Hope this helps.

cheers,
        --ryan

---------------------------------------------------------------------     
Ryan Dooley
[email protected]                                             -o)     
573/884/5154 (phone) 573/884/5158 (fax)                           /\\     
EC DF 90 41 8D 64 D9 6D  3D 2A 30 14 F2 AB 6B E3                 _\_v     

To test out the compiled build a "Hello World" program and compile it to test things out.

#include <stdio.h>

  int main(void)
  {
    printf("Hello, world!\n");
    return 0;
  }

Build it using the command gcc hello.c -o hello


Compiling/Installing libstdc++ Libraries

For G++ to work, some extra libraries have to be compiled up that are supplied separately. libstdc++ is the primary library required.


[CCP14 Home: (Frames | No Frames)]
CCP14 Mirrors: [UK] | [CA] | [US] | [AU]

(This Webpage Page in No Frames Mode)

If you have any queries or comments, please feel free to contact the CCP14