next up previous
Next: About this document ...

Installing a dual compiler (gcc-4.2.1, OpenMP capable) on a system with another previous default compiler (gcc-4.1.0, Suse10.1)

Paulo Crespo, LIP, Coimbra, Portugal (crespo@lip.pt) 070814

  1. Get the tar ball (SOURCE) from ftp://gcc.gnu.org and put it, as root, into directory /usr/local/gcc.

  2. Unzip it and untar it, as root:
    cd /usr/local/gcc
    bunzip2 gcc-4.2.1. This may take some time.

  3. Before configuring it, check the definitions of the previous default installation:
    gcc -v.
    Copy the output verbose and configure the new compiler. To avoid overwriting add the option --append-suffix=-4.2.1, as follows (in one line), this may take some time:

  4. ./configure --enable-threads=posix --prefix=/usr --with-local-prefix=/usr/local --infodir=/usr/share/info --mandir=/usr/share/man --libdir=/usr/lib --libexecdir=/usr/lib --enable-languages=c,c++,objc --enable-checking=release --with-gxx-include-dir=/usr/include/c++/4.1.0 --enable-ssp --disable-libssp --enable-java-awt=gtk --enable-gtk-cairo --disable-libjava-multilib --with-slibdir=/lib --with-system-zlib+ --enable-shared --enable-__cxa_atexit
    --enable-libstdcxx-allocator=new --without-system-libunwind --with-cpu=generic --host=i586-suse-linux --append-suffix=-4.2.1

  5. Build and install it (proceed only if output of each step is error free):
    make all
    make install

  6. As root, toggle between both compilers with symbolic links in directory /usr/bin, or write explicitly, when compiling, either g++ for the older compiler 4.1.0, or g++-4.2.1 to compile with the new, OpenMP capabale compiler.

  7. As Suse states, have a lot of fun :)




next up previous
Next: About this document ...
Paulo Crespo 2007-08-14