GCC: Difference between revisions

From CLONWiki
Jump to navigation Jump to search
Boiarino (talk | contribs)
No edit summary
Boiarino (talk | contribs)
No edit summary
Line 9: Line 9:
* ''cd /apps/gcc'' and copy there downloaded packages:
* ''cd /apps/gcc'' and copy there downloaded packages:


  cp /usr/downloads/gcc-4.9.4.tar.gz .
  #cp /usr/downloads/gcc-4.9.4.tar.gz .
  cp /usr/downloads/gmp-4.3.2.tar.bz2 .
  #cp /usr/downloads/gmp-4.3.2.tar.bz2 .
  cp /usr/downloads/mpfr-2.4.2.tar.bz2 .
  #cp /usr/downloads/mpfr-2.4.2.tar.bz2 .
  cp /usr/downloads/mpc-0.8.1.tar.gz .
  #cp /usr/downloads/mpc-0.8.1.tar.gz .
cp /usr/downloads/gcc-8.3.0.tar.gz .
cp /usr/downloads/gmp-6.1.0.tar.bz2 .
cp /usr/downloads/mpfr-3.1.4.tar.bz2 .
cp /usr/downloads/mpc-1.0.3.tar.gz .


* untar all (DO NOT COMPILE !)
* untar all (DO NOT COMPILE !)


  tar xvf gcc-4.9.4.tar.gz
  #tar xvf gcc-4.9.4.tar.gz
  tar xvf gmp-4.3.2.tar.bz2
  #tar xvf gmp-4.3.2.tar.bz2
  tar xvf mpfr-2.4.2.tar.bz2
  #tar xvf mpfr-2.4.2.tar.bz2
  tar xvf mpc-0.8.1.tar.gz
  #tar xvf mpc-0.8.1.tar.gz
tar xvf gcc-8.3.0.tar.gz .
tar xvf gmp-6.1.0.tar.bz2 .
tar xvf mpfr-3.1.4.tar.bz2 .
tar xvf mpc-1.0.3.tar.gz .


* ''cd gcc-4.9.4'' and create symbolic links:
* ''cd gcc-x.y.z'' and create symbolic links:


  ln -s ../gmp-4.3.2 gmp
  #ln -s ../gmp-4.3.2 gmp
  ln -s ../mpc-0.8.1 mpc
  #ln -s ../mpfr-2.4.2 mpfr
  ln -s ../mpfr-2.4.2 mpfr
#ln -s ../mpc-0.8.1 mpc
ln -s ../gmp-6.1.0 gmp
  ln -s ../mpfr-3.1.4 mpfr
ln -s ../mpc-1.0.3 mpc


this way it will be compiled together with gcc
this way it will be compiled together with gcc


* ./configure --prefix=/apps/gcc/4.9.4 --enable-languages=c,c++,fortran
* ./configure --prefix=/apps/gcc/x.y.z --enable-languages=c,c++,fortran


  NOTE: possible options can be checked on https://gcc.gnu.org/install/configure.html
  NOTE: possible options can be checked on https://gcc.gnu.org/install/configure.html

Revision as of 10:03, 28 March 2019

GCC installation:

  • mkdir /apps/gcc if does not exist
  • cd /apps/gcc and copy there downloaded packages:
#cp /usr/downloads/gcc-4.9.4.tar.gz .
#cp /usr/downloads/gmp-4.3.2.tar.bz2 .
#cp /usr/downloads/mpfr-2.4.2.tar.bz2 .
#cp /usr/downloads/mpc-0.8.1.tar.gz .
cp /usr/downloads/gcc-8.3.0.tar.gz .
cp /usr/downloads/gmp-6.1.0.tar.bz2 .
cp /usr/downloads/mpfr-3.1.4.tar.bz2 .
cp /usr/downloads/mpc-1.0.3.tar.gz .
  • untar all (DO NOT COMPILE !)
#tar xvf gcc-4.9.4.tar.gz
#tar xvf gmp-4.3.2.tar.bz2
#tar xvf mpfr-2.4.2.tar.bz2
#tar xvf mpc-0.8.1.tar.gz
tar xvf gcc-8.3.0.tar.gz .
tar xvf gmp-6.1.0.tar.bz2 .
tar xvf mpfr-3.1.4.tar.bz2 .
tar xvf mpc-1.0.3.tar.gz .
  • cd gcc-x.y.z and create symbolic links:
#ln -s ../gmp-4.3.2 gmp
#ln -s ../mpfr-2.4.2 mpfr
#ln -s ../mpc-0.8.1 mpc
ln -s ../gmp-6.1.0 gmp
ln -s ../mpfr-3.1.4 mpfr
ln -s ../mpc-1.0.3 mpc

this way it will be compiled together with gcc

  • ./configure --prefix=/apps/gcc/x.y.z --enable-languages=c,c++,fortran
NOTE: possible options can be checked on https://gcc.gnu.org/install/configure.html
  • make
  • make install




info from Kelvin:

#
# Quick note on how I built gcc 4.9.2
#
0) ensure the environment variable CCC does *not* exist prior to configure
1) make sure /apps/(gmp, mpc, mpfr, isl) exist
2) foreach (gmp, mpc, mpfr, isl) create lib/shared and mv *.so* into it
   -- This is so that gcc links (statically) with the required libraries and,
   thus, does not need to have LD_LIBRARY_PATH set for compiling.
3) setup a separate build environment for gcc (gcc-4.9.2-obj)
3) do the configure (note that this only builds teh 64bit gcc compiler):
   ../gcc-4.9.2/configure --prefix=/apps/gcc/4.9.2 --with-gmp=/apps/gmp --with-mpfr=/apps/mpfr --with-mpc=/apps/mpc --with-isl=/apps/isl/0.12.2 --disable-multilib --enable-languages=c,c++,fortran
4) make
5) make install
6) make clean
7) go back and mv [gmp, mpc, mpfr, isl]/lib/shared/*.so* to appropriate lib area
8) Create /site/cuesw/gcc/4.9.2/use.conf