An error occurs when using C++17 parallel algorithms with nvhpc module and gcc module such as gcc/10.2.0

Newer gcc module such as gcc/10.2.0 is required to be able to use C++17 parallel algorithms.

The following error occurs during the compilation like nvc++ -autopar=gpu ... when using C++ parallel algorithms with nvhpc module and newer gcc module such as gcc/10.2.0.

 

"/apps/t3/sles12sp2/isv/nvidia/hpc_sdk/Linux_x86_64/21.7/compilers/include-stdpar/thrust/mr/new.h", line 44: error: namespace "std" has no member "align_val_t"
          return ::operator new(bytes, std::align_val_t(alignment));
                                            ^

"/apps/t3/sles12sp2/isv/nvidia/hpc_sdk/Linux_x86_64/21.7/compilers/include-stdpar/thrust/mr/new.h", line 66: error: namespace "std" has no member "align_val_t"
          ::operator delete(p, bytes, std::align_val_t(alignment));

If you encounter this error, please try this:

$ makelocalrc -x -d . -gcc `which gcc` -gpp `which g++`

$ export NVLOCALRC=$PWD/localrc