User Tools

Site Tools


nix:gcc

Differences

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
nix:gcc [2016/04/22 15:51]
kauffman [Building GCC in your home directory]
nix:gcc [2021/01/20 12:25] (current)
kauffman
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.
 +
 +<​code>​
 +$ module --terse avail |grep gcc
 +/​etc/​environment-modules/​modules:​
 +gcc/4.9.4
 +gcc/5.5.0
 +gcc/6.5.0
 +gcc/7.5.0
 +gcc/8.4.0
 +gcc/9.3.0
 +gcc/10.2.0
 +</​code>​
 +
 +<​code>​
 +$ module load gcc/4.9.4
 +</​code>​
 +
 +<​code>​
 +$ echo "$PATH | $INCLUDE | $LD_LIBRARY_PATH | $MANPATH"​
 +/​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 | 
 +/​usr/​local/​gcc/​4.9.4/​man:/​usr/​share/​man
 +</​code>​
 +
 +<​code>​
 +$ gcc --version
 +gcc (GCC) 4.9.4
 +</​code>​
 +
 +<​code>​
 +$ module unload gcc
 +</​code>​
 +
 +
 ===== Building GCC in your home directory ===== ===== Building GCC in your home directory =====
 https://​gcc.gnu.org/​wiki/​InstallingGCC https://​gcc.gnu.org/​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 ===== ===== Requirements =====
   - About 6.5G of scratch space.   - About 6.5G of scratch space.
-  - 1.5G for the actual install. This means if you require a higher quota you will need to request this before proceeding.+  - ~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. You will want to use /var/tmp, /tmp, or /local as the place to checkout and build GCC.
Line 15: Line 54:
 #!/bin/bash #!/bin/bash
  
-PREFIX='​.local/​gcc/​4.9.3'+gccversion='7.1.0'​ 
 +PREFIX="​$HOME/​.local/gcc/${gccversion}"​
  
-# Building gcc in $HOME+# Building gcc 
 +gccversionuc="​${gccversion//​./​_}"​
  
 INSTALLDIR=/​tmp/​$USER INSTALLDIR=/​tmp/​$USER
Line 23: Line 64:
 cd $INSTALLDIR cd $INSTALLDIR
  
-svn co svn://​gcc.gnu.org/​svn/​gcc/​tags/​gcc_4_9_3_release ​gcc-4.9.3 +svn co svn://​gcc.gnu.org/​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=$HOME/$PREFIX \+  --prefix=$PREFIX \
   --enable-languages=c,​c++,​fortran,​go \   --enable-languages=c,​c++,​fortran,​go \
   --enable-shared \   --enable-shared \
Line 40: Line 81:
 # clean up # clean up
 rm -r $INSTALLDIR/​objdir rm -r $INSTALLDIR/​objdir
- 
  
 export PATH=$HOME/​$PREFIX/​bin:​$PATH export PATH=$HOME/​$PREFIX/​bin:​$PATH
Line 49: Line 89:
 echo " ​ export PATH=\$HOME/​$PREFIX/​bin:​\$PATH"​ echo " ​ export PATH=\$HOME/​$PREFIX/​bin:​\$PATH"​
 echo " ​ export LD_LIBRARY_PATH=\$HOME/​$PREFIX/​lib:​\$LD_LIBRARY_PATH"​ echo " ​ export LD_LIBRARY_PATH=\$HOME/​$PREFIX/​lib:​\$LD_LIBRARY_PATH"​
 +</​code>​
 +
 +===== Troubleshooting =====
 +==== '​module'​ command not found ====
 +To resolve you may have to do the following:
 +<​code>​
 +source /​etc/​profile.d/​modules.sh
 </​code>​ </​code>​
/var/lib/dokuwiki/data/attic/nix/gcc.1461358281.txt.gz · Last modified: 2016/04/22 15:51 by kauffman