User Tools

Site Tools



This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
nix:gcc [2016/04/22 10:22]
nix:gcc [2021/01/20 12:24]
Line 1: Line 1:
 ====== GCC ====== ====== GCC ======
 +===== GCC Versions that are already installed on CS infrastructure =====
 +Usually, we install multiple versions. The default version of GCC probably won't be changed system wide... ever.
 +We are now taking more advantage of environment modules. This means depending on when you read this you could load the version of GCC you want to use.
 +$ module --terse avail |grep gcc
 +$ module load gcc/4.9.4
 +/​usr/​local/​gcc/​4.9.4/​bin:/​home/​kauffman3/​bin:/​usr/​local/​bin:/​usr/​bin:/​bin:/​usr/​local/​games:/​usr/​games:/​opt/​puppetlabs/​bin ​
 +| /​usr/​local/​gcc/​4.9.4/​include | /​usr/​local/​gcc/​4.9.4/​lib | 
 +$ gcc --version
 +gcc (GCC) 4.9.4
 +$ module unload gcc
 ===== Building GCC in your home directory ===== ===== Building GCC in your home directory =====
 https://​​wiki/​InstallingGCC https://​​wiki/​InstallingGCC
-Strap in cause this will take a while. You will want to prepare a sandwich and a drink once we start compiling. 
 +You will want to prepare a sandwich and a drink once we start compiling.
 +===== Requirements =====
 +  - About 6.5G of scratch space.
 +  - ~1G for the actual install. This means if you require a higher [[ techstaff:​quota|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 ==== ==== Example ====
Line 9: Line 47:
 #!/bin/bash #!/bin/bash
-# Building gcc in $HOME+# Building gcc 
Line 17: Line 57:
-svn co svn://​​svn/​gcc/​tags/​gcc_4_9_3_release ​gcc-4.9.3 +svn co svn://​​svn/​gcc/​tags/​gcc_${gccversionuc}_release ​gcc-${gccversion} 
-cd gcc-4.9.3+cd gcc-${gccversion}
 ./​contrib/​download_prerequisites ./​contrib/​download_prerequisites
 cd ../ cd ../
 mkdir objdir mkdir objdir
 cd objdir cd objdir
-$PWD/​../​gcc-4.9.3/configure \+$PWD/​../​gcc-${gccversion}/configure \
   --prefix=$PREFIX \   --prefix=$PREFIX \
   --enable-languages=c,​c++,​fortran,​go \   --enable-languages=c,​c++,​fortran,​go \
Line 32: Line 72:
 make install make install
-export PATH=$PREFIX/​bin:​$PATH +# clean up 
 +export PATH=$HOME/$PREFIX/​bin:​$PATH 
 echo "You should add the following to your .bashrc"​ echo "You should add the following to your .bashrc"​
 echo "to make the exports permanent"​ echo "to make the exports permanent"​
-echo " ​ export PATH=$PREFIX/​bin:​${PATH}+echo " ​ export PATH=\$HOME/$PREFIX/​bin:​\$PATH"​ 
-echo " ​ export LD_LIBRARY_PATH=$PREFIX/​lib:​${LD_LIBRARY_PATH}"+echo " ​ export LD_LIBRARY_PATH=\$HOME/$PREFIX/​lib:​\$LD_LIBRARY_PATH"​ 
 +===== Troubleshooting ===== 
 +==== '​module'​ command not found ==== 
 +To resolve you may have to do the following:​ 
 +source /​etc/​profile.d/​
 </​code>​ </​code>​
/var/lib/dokuwiki/data/pages/nix/gcc.txt · Last modified: 2021/01/20 12:25 by kauffman