I am trying to use NVIDIA HPC SDK 25.1 with nvc++ to compile a simple C++ program, but it fails to find . With g++ or nvcc, the same code works fine.
Environment
-
OS: CentOS Linux 8
-
GCC version: 8.5.0 (Red Hat 8.5.0-3)
-
NVHPC version: 25.1
-
Install path: /public/software/compiler/nvhpc_sdk
test.cpp:
int main() {
std::cout << "Hello from nvc++" << std::endl;
return 0;
}
nvcc test.cpp -o test # works, runs and prints “Hello from nvc++”
nvc++ test.cpp -o test # fails
“test.cpp”, line 1: catastrophic error: cannot open source file “iostream”
1 catastrophic error detected in the compilation of “test.cpp”.
Compilation terminated.
[root@admin nccl-tests-2.17.1]# ls /usr/include/c++/8/iostream
/usr/include/c++/8/iostream
Running nvc++ -### test.cpp shows many --sys_include paths, but not /usr/include/c++/8.
Why does nvc++ fail to detect the system libstdc++ headers by default on CentOS 8?
Do I need to run makelocalrc or some additional configuration to point it to GCC 8.5.0?
Is it recommended to avoid setting CPATH/CPLUS_INCLUDE_PATH in the modulefile?
Thanks in advance for your help!