I installed PGI CE 17.4 and 17.10. How can I dynamically switch the version of GCC that my pgcc compiler works with? Currently pgcc always finds GCC 4.4.7, although I have various versions of GCC installed and I have set, e.g., v7.1 as the default version by exporting PATH etc.
you can install your private gcc version, add gcc dir in PATH; run PGIROOT/linux86-64/17.10/bin/makelocalrc, this command will create new localrc in PGIROOT/linux86-64/17.10/bin.
Would that it be so easy. Look at the output of your new gcc
gcc -v hello.c
and the output of the new pgcc compiler with new localrc
pgcc -v hello.c
and make sure the gcc headers used match,gcc libs match, and assembler
and linker used match. If they do not, you will need to manually edit
$PGI/linux86-64/17.10/bin/localrc, and correct things that do not match.
There is also a danger that the compatible PGI libs and headers needed
for the new gcc version will not be present, because ones compatible
with your old gcc version are all that are present. You are running makelocalrc after an installation, not with the installation download.