Installing with multiple versions of g++

We have a cluster that has multiple versions of gcc available, loadable through environment modules. I would like pgi to use the latest version of g++, which is available through the path, rather than the system version, but simply loading the correct module at install time doesn’t seem to work. For example:

$ which g++
$ pgc++ -DUSE_ATOMIC -std=c++11 -acc -ta=multicore,nvidia:cc35 -Minfo=accel accCounter.cpp -o accCounter_w_atomic
"/usr/include/c++/4.4.7/c++0x_warning.h", line 31: catastrophic error: #error

Reading back through old posts, it seems that this could be fixed with makelocalrc, but I haven’t managed to get that working yet. Is there an example of how to use it to update to the latest g++ ?


gcc versions newer than 5.2 should have PGI 17.1 if they expect pgc++
to work as expected on the newer gcc versions.

makelocalrc will not integrate any gcc version. It will look for the
default version, and expect tools and libs to be accessible.

Here is something we have been working on.
It requires that you perform a ‘Network Install’ of the compilers
so that all the needed pgi headers and pgi libs are present.

cd $PGI/linux86-64/17.1/bin; chmod +x ./addlocalrc

Then run


which will look for all gcc versions, and create localrc files for
each version.

There is also an environment variable called PGI_LOCALRC
that if it points to one of the localrc files that are created by
addlocalrc, the compilers will use that localrc_file.

export PGI_LOCALRC=/full/path/to/the/localrc_file

Or you can
cp localrc_file $PGI/linux86-64/17.1/bin/localrc.hostname