From b85bc36b0c1eb40925424d2812e51361d84d0a47 Mon Sep 17 00:00:00 2001 From: Joshua Kammeraad Date: Mon, 13 Apr 2026 22:06:26 -0700 Subject: [PATCH] Make USE_ACC configurable via environment variable Default behavior is unchanged (GPU enabled). Setting USE_ACC=OFF in the environment before cmake configure disables OpenACC/GPU compilation, using the existing CPU fallback paths in subdirectory CMakeLists files. Also switch from True/False to ON/OFF convention for consistency with ZEST and standard CMake idioms. Co-Authored-By: Claude Opus 4.6 (1M context) --- CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 29ec023..b6fc849 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,7 +17,11 @@ project(SlaterGPU VERSION 0.1 DESCRIPTION "Integrals over Slater type orbitals with GPU Acceleration" LANGUAGES C CXX) -set(USE_ACC True) +set(USE_ACC ON) +if("$ENV{USE_ACC}" STREQUAL "OFF") + set(USE_ACC OFF) +endif() +message(STATUS "USE_ACC: ${USE_ACC}") set(USE_MPI True) set(USE_OMP True) set(RED_DOUBLE True)