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 revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
nix:gcc [2016/05/09 14:26] – [Building GCC in your home directory] kauffmannix:gcc [2017/12/05 12:03] 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.
 +
 +Here is a list of packages we install as of 2017-05-02:
 +<code>
 +gcc
 +gcc-4.7-uofc-cs
 +gcc-4.9-uofc-cs
 +gcc-5
 +gcc-5-base:amd64
 +gcc-5-multilib
 +gcc-5.4-uofc-cs
 +gcc-6-base:amd64
 +gcc-6-base:i386
 +gcc-6.3-uofc-cs
 +gcc-7.1-uofc-cs
 +</code>
 +
 +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>
 +kauffman3@green:~$ module --terse avail
 +/etc/environment-modules/modules:
 +cmake/3.1.1
 +cmake/3.8.0
 +gcc/4.7.4
 +gcc/4.9.3
 +gcc/5.4.0
 +gcc/6.3.0
 +gcc/7.1.0
 +
 +
 +kauffman3@green:~$ module load gcc/4.7.4
 +
 +kauffman3@green:~$ echo "$PATH | $INCLUDE | $LD_LIBRARY_PATH | $MANPATH"
 +/usr/local/gcc/4.7.4/bin:/home/kauffman3/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/opt/puppetlabs/bin 
 +| /usr/local/gcc/4.7.4/include | /usr/local/gcc/4.7.4/lib | 
 +/usr/local/gcc/4.7.4/man:/usr/share/man
 +
 +kauffman3@green:~$ gcc --version
 +gcc (GCC) 4.7.4
 +
 +kauffman3@green:~$ module unload gcc/4.7.4
 +
 +kauffman3@green:~$ gcc --version
 +gcc (Ubuntu 4.9.4-2ubuntu1~14.04.1) 4.9.4
 +</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
Line 15: Line 65:
 #!/bin/bash #!/bin/bash
  
-PREFIX='.local/gcc/4.9.3'+PREFIX="$HOME/.local/gcc/4.9.3"
  
 # Building gcc in $HOME # Building gcc in $HOME
Line 30: Line 80:
 cd objdir cd objdir
 $PWD/../gcc-4.9.3/configure \ $PWD/../gcc-4.9.3/configure \
-  --prefix=$HOME/$PREFIX \+  --prefix=$PREFIX \
   --enable-languages=c,c++,fortran,go \   --enable-languages=c,c++,fortran,go \
   --enable-shared \   --enable-shared \
Line 49: Line 99:
 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/pages/nix/gcc.txt · Last modified: 2021/01/20 12:25 by kauffman

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki