NERSCPowering Scientific Discovery Since 1974

Intel uses very old version of libstdc++ by default [updated]

January 15, 2014 by Mike Stewart, NERSC USG

Status:   Reported to Cray as case 84319, became bug 806610.

Updated October 13, 2014 by Scott French, NERSC USG

When PrgEnv-intel is loaded, the Intel compiler gets libstdc++ from on the default environment on the login node, which is typically quite old. This test case illustrates the problem on Edison:

> cat TestLibVersion.C 
#include <iostream>
int main()
std::cout<<"libstdc++ version is "<< __GLIBCXX__ << std::endl;
> CC -o libver -std=c++11 TestLibVersion.C
> ./libver
libstdc++ version is 20091019

The workaround suggested by Cray is to load a recent version of the GNU compilers (i.e. the gcc module, not the PrgEnv-gnu module), which adds the newer libstdc++ to the environment and makes it accessible to Intel.  For example, on Edison:

> module load gcc
> CC -o libver -std=c++11 TestLibVersion.C
> ./libver
libstdc++ version is 20141030