From 17b4e838791a25c8c1c2df10bbd56e188abcedf3 Mon Sep 17 00:00:00 2001 From: Joshua Kammeraad Date: Thu, 4 Jun 2026 00:12:27 -0700 Subject: [PATCH] Reorder cintw includes so linked libcint cint.h wins The vendored include/cint.h is libcint 4.4.0's header with build-time toggles (I8, CACHE_SIZE_I8) frozen in via #cmakedefine. When cintw is built against a different libcint -- pixi's, or the manual 5.3.0 at LIBCINT_PATH -- the vendored header was winning the search order and hiding the real headers, risking a silent ABI mismatch on FINT width or struct slot offsets. Move LIBCINT_PATH/include and PREFIX/include ahead of SlaterGPU/include in cintw's PRIVATE include path so the linked libcint's own cint.h is the one the wrapper sees. This is a transitional fix scoped to the cintw target. A follow-up can remove the vendored copy entirely once SlaterGPU's target_include_dirs also carry the libcint header path (and the DO_GTO=OFF case is sorted). --- src/libcintw/CMakeLists.txt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/libcintw/CMakeLists.txt b/src/libcintw/CMakeLists.txt index ae64cfa..1aa256d 100644 --- a/src/libcintw/CMakeLists.txt +++ b/src/libcintw/CMakeLists.txt @@ -21,11 +21,15 @@ target_compile_options(cintw PRIVATE ${CINTW_COMP_FLAGS}) if(COMPILE_CINTW_4C) target_compile_definitions(cintw PRIVATE COMPILE_CINTW_4C) endif() +# Put the linked libcint's headers ahead of SlaterGPU/include so that the +# vendored cint.h does not shadow the cint.h that ships with the libcint we +# actually link against. A version/ABI skew between the two (e.g. I8 vs int +# FINT, or BAS_SLOTS drift) would otherwise corrupt integrals silently. target_include_directories(cintw PRIVATE - "${CMAKE_SOURCE_DIR}/include" "${LIBCINT_PATH}/include" - "$ENV{BLAS_INCLUDE_DIR}" "$ENV{PREFIX}/include" # include pixi dependencies + "${CMAKE_SOURCE_DIR}/include" + "$ENV{BLAS_INCLUDE_DIR}" ) # Link against custom libcint if LIBCINT_PATH is set (manual build)