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.
414 Discussions

On upgrading to Ubuntu 22.0.4 the standard libraries are no longer found.

Illya
Novice
2,904 Views

I get the following compilation error on all my projects where they used to all work before

/opt/intel/oneapi/compiler/2022.2.1/linux/bin-llvm/../include/sycl/CL/__spirv/spirv_types.hpp:26:10: fatal error: 'cstddef' file not found

Ubuntu 22.04
OneAPI Base Toolkit 2023.0.0

 I have tried using  export CPATH=$CPATH:/usr/include/c++/11/, did not help.

Tried compiler flag -I/usr/include/c++/11/ but this just moves the problem to another 'not found' error, cannot find <bits/c++config.h>

Note: compiling a simple Helloworld non DPC++ program compiles fine using gcc compiler.

My linux knowledge is very limited. Any advice please. Thank you.

Screenshot from 2023-02-10 13-58-07.png

Screenshot from 2023-02-10 14-00-28.png

0 Kudos
1 Solution
VarshaS_Intel
Moderator
2,701 Views

Hi,


Thanks for sharing the multiple solutions.


Could you please let us know if you have any other queries? If not, could you please confirm whether we can close this thread from our end?


Thanks & Regards,

Varsha


View solution in original post

0 Kudos
6 Replies
Tzachi
Beginner
2,810 Views

sudo apt install libstdc++-12-dev

 

should solve the problem. 

0 Kudos
VarshaS_Intel
Moderator
2,791 Views

Hi,

 

Thanks for posting in Intel Communities.

 

Since you are facing an error "cannot find <bits/c++config.h>" after exporting the cstddef files. Could you please try using the below commands for installation:

 

sudo apt-get update
sudo apt install libstdc++-12
sudo apt-get install build-essential

 

After doing the installations and updates, if you are still getting the same issues, could you please repair the Intel oneAPI Toolkit?

 

Thanks & Regards,

Varsha

 

0 Kudos
Illya
Novice
2,770 Views

I had already completed a total wipe and re-install of the system to install 22.04. Last time was an upgrade to 22.04. Reinstalled the oneAPI base toolkit. 

(After the úpgrade´) performed a repair of the oneAPI Base toolkit, it did not work. A uninstall followed by reinstall did not work.

All the VSCode and CMake projects now compile ok. No fiddling was carried out.

Gcc 12 was  not put on to the system doing a wipe installation of 22.04.  Why it installed on the upgrade is a puzzle.

The only compiler now on the system is gcc 11.03. 

A colleague came across the same problem when upgrading,  deleted gcc 12 and it all worked. Reinstalled gcc 12 ad continue to work.

Another colleague comment  ¨you need the -dev libraries, they're split on ubuntu, there is the same issue on the github:

0 Kudos
Illya
Novice
2,753 Views

The error:

In file included from example.cpp:1:
In file included from /home/seth295c/sycl_workspace/llvm/build/bin/../include/sycl/CL/sycl.hpp:11:
In file included from /home/seth295c/sycl_workspace/llvm/build/bin/../include/sycl/CL/sycl/accessor.hpp:11:
/home/seth295c/sycl_workspace/llvm/build/bin/../include/sycl/CL/__spirv/spirv_types.hpp:13:10: fatal error: 'cstddef' file not found
#include <cstddef>
         ^~~~~~~~~
1 error generated.

(After the ´upgrade´)  performed a repair of the oneAPI Base toolkit, it did not work. A uninstall followed by reinstall did not work.

 

Possible solutions:

1.

GCC_TOOLCHAIN = "/auto/software/gcc/x86_64/gcc-9.1.0/"

"which gcc" shows /auto/software/gcc/x86_64/gcc-9.1.0/bin/gcc

So you might change the path for '--gcc-toolchain='.

2.

If installed gcc 12 then uninstall it, test compilation, if ok re-install

sudo apt-get update
sudo apt install libstdc++-12
sudo apt-get install build-essential

3.

ipcx print search-dirs

4.

dpkg --list | grep compiler

5.

Change gcc version default

https://stackoverflow.com/questions/7832892/how-to-change-the-default-gcc-compiler-in-ubuntu

http://charette.no-ip.com:81/programming/2011-12-24_GCCv47/

6.

Wipe the system and reinstall everything → ok, back up and running.
VSCode projects now compile. Intelś examples now compile after a restart even though setvars.sh sourced for each terminal.
Installation of oneAPI Base Tool kit want ok, straight forward following setup instructions.
Now only have one gcc installed, version 11.3. gcc 12 no where to be found, nor the others 10 or 9 . gcc 12 is not installed via the upgrade to 22.04.

0 Kudos
VarshaS_Intel
Moderator
2,702 Views

Hi,


Thanks for sharing the multiple solutions.


Could you please let us know if you have any other queries? If not, could you please confirm whether we can close this thread from our end?


Thanks & Regards,

Varsha


0 Kudos
VarshaS_Intel
Moderator
2,651 Views

Hi,


Glad to know that your issue is resolved. Thanks for accepting the solution. This thread will no longer be monitored by Intel. If you have any other queries, please start a new thread.


Have a good day!


Thanks & Regards,

Varsha


0 Kudos
Reply