intel / llvm

Intel staging area for llvm.org contribution. Home for Intel LLVM-based projects.
Other
1.26k stars 740 forks source link

[CUDA][SYCL] Persistent compilation error with missing cstddef, cstdint header files #15432

Open jgtong opened 2 months ago

jgtong commented 2 months ago

Describe the bug

Compilation of DPC++ with CUDA support keeps error'ing out at the late stage during the compilation process. The error message I see is

 /llvm/libdevice/imf/../imf_impl_utils.hpp:12:10: fatal error: 'cstddef' file not found

This error occurred after system admins upgraded the node to Ubuntu 24.04.1. The libstdc++-13-dev and libstdc++-12-dev packages are installed. We also tried setting the following variables

CC=/path/to/gcc-{12,13}/gcc
CXX=/path/to/g++-{12,13}
CPLUS_INCLUDE_PATH=/path/to/c++/{12,13}/include

and still gives the same error. The cstddef and cstdint header files do exist on the system, but not sure why the compiler is not picking them up

To reproduce

1. git clone https://github.com/intel/llvm.git -b sycl
2. cd llvm
3. python3 ./buildbot/configure.py --cuda (Note, I also have tried --use-libcxx --libcxx-include /path/to/c++/{12,13}/include --libcxx-library /path/to/c++/{12,13}/lib64
4. python3 ./buildbot/compile.py

Environment

Additional context

No response

KornevNikita commented 2 months ago

Hi @jgtong, do CMAKE_C_COMPILER and CMAKE_CXX_COMPILER have the right path in /.../llvm/build/CMakeCache.txt?

JackAKirk commented 1 month ago

Which cuda runtime version are you using and are you sure ubuntu 24.04 supports it? cuda toolkit only supports 24.04 for latest versions, please consult cuda toolkit docs.

jgtong commented 1 month ago

Hi @jgtong, do CMAKE_C_COMPILER and CMAKE_CXX_COMPILER have the right path in /.../llvm/build/CMakeCache.txt?

Yes, I can confirm that CMAKE_C_COMPILER and CMAKE_CXX_COMPILER have the correct gcc path. In this case, I am using gcc-13 and g++-13

jgtong commented 1 month ago

Which cuda runtime version are you using and are you sure ubuntu 24.04 supports it? cuda toolkit only supports 24.04 for latest versions, please consult cuda toolkit docs.

Yes, I was using Ubuntu 24.04 and NV CUDA Toolkit version 12.6

JackAKirk commented 1 month ago

Which cuda runtime version are you using and are you sure ubuntu 24.04 supports it? cuda toolkit only supports 24.04 for latest versions, please consult cuda toolkit docs.

Yes, I was using Ubuntu 24.04 and NV CUDA Toolkit version 12.6

I think this is likely to be an issue with incompatible gcc modules. I suggest you experiment with only having a single e.g. libstdc++-13-dev version loaded.

jgtong commented 1 month ago

@JackAKirk

Thanks, I do have the correct module loaded and even exported the CC/CXX variables to `/path/to/{gcc-13,g++-13}' respectively