From 51048c791688da926b01376ff980a19c316480da Mon Sep 17 00:00:00 2001 From: Joshua Kammeraad Date: Fri, 26 Jun 2026 00:32:29 -0700 Subject: [PATCH] Remove MPI from SlaterGPU (unused; blocks USE_MPI=OFF stack) SlaterGPU contains no MPI code: no MPI_* calls, no , no target links MPI::*, and sgpu.exe links no MPI. Its find_package(MPI REQUIRED) and the find_dependency(MPI REQUIRED) in the installed SlaterGPUConfig were pure dead weight. Worse, the config line transitively re-required MPI in every consumer at find_package(SlaterGPU) time, which blocks a USE_MPI=OFF build of the SlaterGPU -> ZEST -> XCtera stack. Removing both makes SlaterGPU cleanly MPI-agnostic; USE_MPI now lives only in the ZEST/XCtera layers that actually use it (they find and link MPI themselves). Part of ZEST#92. Co-Authored-By: Claude Opus 4.8 --- CMakeLists.txt | 9 +++++---- SlaterGPUConfig.cmake.in | 5 ++++- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 64aa9dc..8869b6b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,7 +22,11 @@ if("$ENV{USE_ACC}" STREQUAL "OFF") set(USE_ACC OFF) endif() message(STATUS "USE_ACC: ${USE_ACC}") -set(USE_MPI True) +# NOTE: SlaterGPU contains no MPI code (no MPI_* calls, no , no target +# links MPI::*). MPI is owned entirely by the ZEST/XCtera layers above, which +# find and link it themselves. So there is intentionally no find_package(MPI) +# or USE_MPI flag here — keeping the layer MPI-agnostic is what lets a +# USE_MPI=OFF stack configure without MPI present. See ZEST#92. set(USE_OMP True) set(RED_DOUBLE True) @@ -47,9 +51,6 @@ endif() set(CMAKE_CXX_FLAGS_RELEASE "-O2") -if(USE_MPI) - find_package(MPI REQUIRED) -endif() if (USE_OMP) find_package(OpenMP REQUIRED) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}") diff --git a/SlaterGPUConfig.cmake.in b/SlaterGPUConfig.cmake.in index 9ed9cc8..5684611 100644 --- a/SlaterGPUConfig.cmake.in +++ b/SlaterGPUConfig.cmake.in @@ -3,8 +3,11 @@ include(CMakeFindDependencyMacro) # Find required dependencies +# NOTE: no find_dependency(MPI) — SlaterGPU uses no MPI itself. Re-requiring it +# here would force every consumer to locate MPI at find_package(SlaterGPU) time, +# which blocks a USE_MPI=OFF stack. Consumers that use MPI (ZEST/XCtera) find it +# themselves. See ZEST#92. find_dependency(OpenMP REQUIRED) -find_dependency(MPI REQUIRED) find_dependency(BLAS REQUIRED) find_dependency(LAPACK REQUIRED)