Using newer gcc in /opt/netapps: Difference between revisions
Jump to navigation
Jump to search
Add gcc-5.0 |
No edit summary |
||
| Line 30: | Line 30: | ||
There is now | == GCC-5.0 == | ||
There is now (as yet unreleased) GCC-5.0 as well. You can use the above script, but set GCCBASE lie this: | |||
GCCBASE="/opt/netapps/gnu/gcc/5.0" | GCCBASE="/opt/netapps/gnu/gcc/5.0" | ||
Revision as of 09:15, 16 February 2015
Gcc-4.9.1 is in /opt/netapps/gnu/gcc. In order for you to use it, this may have to be appended to your .profile, .bash_profile or whatever applies.
# This is a bash snippet, to be sourced from .profile
GCCBASE="/opt/netapps/gnu/gcc"
# If you want the newer tools by default, put them at the beginning of $PATH
export PATH="${PATH}:${GCCBASE}/bin"
# Have Make pick the newer compiler
export CXX="${GCCBASE}/bin/g++"
# For good measure: default compiler flags for the C++ course
export CXXFLAGS="${CXXFLAGS} -Wall -std=c++11"
# This is for during compile: prefer newer headers
CPLUS_INCLUDE_PATH="${GCCBASE}/include:${CPLUS_INCLUDE_PATH}"
# This is for linking during build: prefer newer libraries
export LD_LIBRARY_PATH="${GCCBASE}/lib/../lib64:${LD_LIBRARY_PATH}"
# This is for runtime linking: prefer older libraries
export LD_RUN_PATH="${LD_RUNPATH}:${GCCBASE}/lib/../lib64"
# Man should also find the newer manpages
export MANPATH="${MANPATH}:${GCCBASE}/share/man"
Please note: /opt is *NOT* in ld.so.conf, and should not be
GCC-5.0
There is now (as yet unreleased) GCC-5.0 as well. You can use the above script, but set GCCBASE lie this:
GCCBASE="/opt/netapps/gnu/gcc/5.0"