User Tools

Site Tools


nix:gcc

This is an old revision of the document!


GCC

Building GCC in your home directory

https://gcc.gnu.org/wiki/InstallingGCC

You will want to prepare a sandwich and a drink once we start compiling.

Requirements

  1. About 6.5G of scratch space.
  2. ~1G for the actual install. This means if you require a higher quota you will need to request this before proceeding.

You will want to use /var/tmp, /tmp, or /local as the place to checkout and build GCC.

Example

#!/bin/bash

PREFIX="$HOME/.local/gcc/4.9.3"

# Building gcc in $HOME

INSTALLDIR=/tmp/$USER
mkdir -p $INSTALLDIR
cd $INSTALLDIR

svn co svn://gcc.gnu.org/svn/gcc/tags/gcc_4_9_3_release gcc-4.9.3
cd gcc-4.9.3
./contrib/download_prerequisites
cd ../
mkdir objdir
cd objdir
$PWD/../gcc-4.9.3/configure \
  --prefix=$PREFIX \
  --enable-languages=c,c++,fortran,go \
  --enable-shared \
  --enable-multiarch \
  --enable-threads=posix
make -j4
make install

# clean up
rm -r $INSTALLDIR/objdir


export PATH=$HOME/$PREFIX/bin:$PATH
export LD_LIBRARY_PATH=$HOME/$PREFIX/lib:$LD_LIBRARY_PATH

echo "You should add the following to your .bashrc"
echo "to make the exports permanent"
echo "  export PATH=\$HOME/$PREFIX/bin:\$PATH"
echo "  export LD_LIBRARY_PATH=\$HOME/$PREFIX/lib:\$LD_LIBRARY_PATH"

If building a package you will want to use checkinstall. Replace make install something like the following:

checkinstall \
  --strip=no \
  --stripso=no \
  --umask=022 \
  --install=no \
  --pkgname='gcc-uofc-cs' \
  --pkgversion='4.9.3' \
  --pkgrelease='1' \
  --pkggroup='devel' \
  --maintainer='Techstaff \<techstaff@cs.uchicago.edu\>' \
  --review-control \
  make install
/var/lib/dokuwiki/data/attic/nix/gcc.1463002722.txt.gz · Last modified: 2016/05/11 16:38 by kauffman

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki