wiki:NotesOnBuildingGcc
Last modified 10 years ago Last modified on 07/20/2009 09:44:30 AM

Notes on building gcc

Versions of gcc

The LSST stack is supported with gcc

  • 4.3.3 (official version)
  • 4.1.2 (previous official version)

Required packages

  • GMP (couldn't get OS-provided version to work properly)
  • MPFR
  • glibc-devel

Building

  • build in separate folder from unpacked source
    tar xf gcc-4.3.3.tar.bz2
    mkdir gcc-4.3.3-build
    cd gcc-4.3.3-build
    ../gcc-4.3.3/configure ...
    
  • configure
    • --prefix=<install dir> (default is /usr/local)
    • --enable-languages=c,c++,fortran (don't need ada, objc, etc.)
    • --with-gmp-lib=/usr/local/lib --with-gmp-include=/usr/local/include (if gmp is installed form source)
    • --with-mpfr-lib=/usr/local/lib --with-mpfr-include=/usr/local/inclide (if mpfr is installed from source)
  • make; make install
  • if you want it to become the default compiler, modify the file /etc/ld.so.conf... by adding the lines
    <install dir>/lib
    <install dir>/lib64 # (only on 64-bit machines)
    
  • ldconfig

LSST Packaging

To manage gcc using eups, turn it into a package in two easy steps:

  • create <install dir>/ups/gcc.table:
    envPrepend(PATH, ${PRODUCT_DIR}/bin)
    envPrepend(LD_LIBRARY_PATH, ${PRODUCT_DIR}/lib64)
    
  • eups declare -c -r <install dir> gcc 4.3.3

See Also