From ce3f3b668d238d8cb987a8afa9128a96eb6f6524 Mon Sep 17 00:00:00 2001 From: Eduard Valeyev Date: Sat, 9 May 2026 21:45:49 -0400 Subject: [PATCH] [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 ` from `` 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 --- src/CMakeLists.txt | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 397fdc7a9a..e0edad8c7e 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -277,12 +277,6 @@ if(TILEDARRAY_HAS_CUDA OR TILEDARRAY_HAS_HIP) TiledArray/device/kernel/thrust/reduce_kernel.cu TiledArray/device/um_storage.cu) - foreach( f IN LISTS TILEDARRAY_DEVICE_SOURCE_FILES ) - set_source_files_properties( "${f}" - PROPERTIES - INCLUDE_DIRECTORIES "${CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES}") - endforeach() - # the list of libraries on which TiledArray depends on list(APPEND _TILEDARRAY_DEPENDENCIES CUDA::cudart CUDA::cublas CUDA::nvtx3)