Nvc++ or pgc++ 20.7, how to choose the standard library

Hi,
I get a segmentation fault which seems to come from using the wrong standard library. How can I tell the compiler which standard library to use?

Kind Regards,
Rob

Hi Rob,

This is set in the compilers configuration file, “localrc”. By default, on install the localrc is generated using the system’s GNU installation. To use a different GNU install run:

makelocalrc -d . -x -gcc=/full/path/to/bin/gcc -gpp=/full/path/to/bin/g++ -g77=/full/path/to/bin/gfortran

This will create a new localrc file in the current directory. You can rename the file to anything you like.

To use this rc file over the default, set the environment variable “NVLOCALRC=/full/path/to/mylocalrc”.

Though, I’ve never seen a case that using the wrong STL would result in a seg fault. C++ standard capability issues at compile time, like using and old STL with C++17, I see often, but I’ve never seen a seg fault due to this.

Though, maybe I’m misunderstanding the question and the problem is that the runtime is picking up and older libstdc++.so? In that case, you’d want to set the LD_LIBRARY_PATH to the new directory containing the libstdc++.so so the loader picks up the correct one.

Hi Mat,

yes thats what I was looking for.

Thanks!