CUDA version not available message with nvc++ on Ubuntu

Thanks to ofbinull I got my code running, although it looks like a hack, and a simple nvc++ -stdpar -std=c++17 cuda_cpp.cpp -o cuda should be able to do the job. So this is what worked for me:

nvc++ -I/opt/nvidia/hpc_sdk/Linux_x86_64/21.2/compilers/include-stdpar -fast -g -Wall -stdpar -c -o cuda_cpp.o cuda_cpp.cpp

and then

nvc++ -o cuda cuda_cpp.o -stdpar

What doesn’t seem right is that I have to add a link to include-stdpar and the strange error with Thrust if I follow the instruction in this blog