Using newer gcc in /opt/netapps: Difference between revisions

From LWP-Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 8: Line 8:
Please note: /opt is *NOT* in ld.so.conf, and should not be
Please note: /opt is *NOT* in ld.so.conf, and should not be


After sourcing the sourceme, you can call the newer g++ as
The environment variables that are set in the sourceme snippet influence Make-like programs (GNU make, icmake). So projects using such utilities will automatically build your programs using the newer compiler.


${CXX}
If you want to build by calling the compiler directly, you cannot just call 'g++'. Instean, call the newer compiler as $CXX, like this:


This is what Make commonly does, so projects using Makefiles will automatically use the newer compiler.
${CXX} -o hello hello.cc
 
NB: if you are reading this page as a participant (or attendee) of the C++ course, please ask your questions on the mailing list first, not through the Service Desk.


== Later versions ==
== Later versions ==

Revision as of 10:39, 1 September 2015


Gcc-5.2 is in /opt/netapps/gnu/gcc/5.2. In order for you to use it, this may have to be appended to your .profile:

GCCSNIPPET=/opt/netapps/gnu/gcc/5.2/sourceme
[ -r ${GCCSNIPPET} ] && . ${GCCSNIPPET}

Please note: /opt is *NOT* in ld.so.conf, and should not be

The environment variables that are set in the sourceme snippet influence Make-like programs (GNU make, icmake). So projects using such utilities will automatically build your programs using the newer compiler.

If you want to build by calling the compiler directly, you cannot just call 'g++'. Instean, call the newer compiler as $CXX, like this:

${CXX} -o hello hello.cc

NB: if you are reading this page as a participant (or attendee) of the C++ course, please ask your questions on the mailing list first, not through the Service Desk.

Later versions

You may find that still later versions are available. Check /opt/netapps/gnu/gcc, and alter the above script by adjusting the line

GCCBASE="/opt/netapps/gnu/gcc/5.2"