Skip to content

Commit 684ceed

Browse files
committed
[cmake] drop CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES injection on device sources
Forwarding the host compiler's implicit include directories as per-source `INCLUDE_DIRECTORIES` causes CMake to emit them as `-I` flags, which: - duplicates paths the host compiler discovers implicitly (no benefit); - on `btas_um_tensor.cpp` (a CPU .cpp that ends up in the device list) re-passes `/usr/include/c++/13` etc. as user-include paths, which breaks libstdc++'s `#include_next <stdlib.h>` from `<cstdlib>` under gcc-13: the search never reaches the system `/usr/include` because it's been shadowed by the user-include re-entries. nvcc with `-ccbin=g++-N` already picks up host paths via the host driver, so the injection is unnecessary on modern toolchains. Failure observed in CI with gcc-13 + CUDA 12.x: /usr/include/c++/13/cstdlib:79:15: fatal error: stdlib.h: No such file or directory
1 parent 0268d29 commit 684ceed

1 file changed

Lines changed: 0 additions & 6 deletions

File tree

src/CMakeLists.txt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -277,12 +277,6 @@ if(TILEDARRAY_HAS_CUDA OR TILEDARRAY_HAS_HIP)
277277
TiledArray/device/kernel/thrust/reduce_kernel.cu
278278
TiledArray/device/um_storage.cu)
279279

280-
foreach( f IN LISTS TILEDARRAY_DEVICE_SOURCE_FILES )
281-
set_source_files_properties( "${f}"
282-
PROPERTIES
283-
INCLUDE_DIRECTORIES "${CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES}")
284-
endforeach()
285-
286280
# the list of libraries on which TiledArray depends on
287281
list(APPEND _TILEDARRAY_DEPENDENCIES CUDA::cudart CUDA::cublas CUDA::nvtx3)
288282

0 commit comments

Comments
 (0)