Intel® oneAPI Base Toolkit
Support for the core tools and libraries within the base toolkit that are used to build and deploy high-performance data-centric applications.
419 Discussions

OneAPI 2023.0 clang++ doesn't link with standard library Ubuntu 22.04 LTS.

fwilliams42
Beginner
658 Views

I've just installed the newly released 2023.0.0 OneAPI Base Toolkit on my Ubuntu 22.04 LTS machine. CUDA 12.0 and the Codeplay Nvidia add-on have also been installed.

Attempting to run the Getting Started from Codeplay I encounter issues with Intel's clang++ not finding or linking to the linux headers. In fact, this issue occurs even for a hello world program not  finding iostream.

Printing out my CPATH environment variable gives

/opt/intel/oneapi/vpl/2023.0.0/include:/opt/intel/oneapi/tbb/2021.8.0/env/../include:/opt/intel/oneapi/mpi/2021.8.0//include:/opt/intel/oneapi/mkl/2023.0.0/include:/opt/intel/oneapi/ipp/2021.7.0/include:/opt/intel/oneapi/ippcp/2021.6.3/include:/opt/intel/oneapi/ipp/2021.7.0/include:/opt/intel/oneapi/dpl/2022.0.0/linux/include:/opt/intel/oneapi/dpcpp-ct/2023.0.0/include:/opt/intel/oneapi/dnnl/2023.0.0/cpu_dpcpp_gpu_dpcpp/include:/opt/intel/oneapi/dev-utilities/2021.8.0/include:/opt/intel/oneapi/dal/2023.0.0/include:/opt/intel/oneapi/ccl/2021.8.0/include/cpu_gpu_dpcpp

Adding /usr/include/c++/11/ and /usr/include/x86_64-linux-gnu/c++/11 as found elsewhere on the internet to CPATH so it can find cstddef I then get

/usr/bin/ld: cannot find -lstdc++: No such file or directory

I've had no issues developing with C++ and CUDA using gcc/g++ and nvcc prior to this, and I've followed and installed all packages mentioned by the Intel OneAPI and Codeplay guides and installers.

What configuration do I need to provide to have the OneAPI clang++ link against the standard library correctly?

 
0 Kudos
2 Replies
fwilliams42
Beginner
628 Views

I was able to resolve the issue on my own.

Running clang++ -v revealed clang was linking against the gcc-12 headers / libraries. However, these actually weren't present on my system. The solution to this was to additionally install the g++-12 package with

sudo apt install g++-12

 

NoorjahanSk_Intel
Moderator
603 Views

Hi,


Thanks for reaching out to us.


Glad to know that your issue is resolved. If you need any additional information, please post a new question as this thread will no longer be monitored by Intel.


Thanks & Regards,

Noorjahan.


0 Kudos
Reply