From 4a585b15f613211112a666c5584ed7c5c089f674 Mon Sep 17 00:00:00 2001 From: Jameson Nash Date: Tue, 23 Dec 2025 10:59:59 -0500 Subject: [PATCH] cmake: document options and set defaults for influential variables MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add documentation strings and defaults for CMake cache variables including TARGET, BINARY, threading options, vector extensions, memory tuning, and precision types. Treat empty string values as "not set" to allow auto-detection while keeping options visible in ccmake. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- CMakeLists.txt | 69 +++++++++++++++++++++++++++++++++++++++------- cmake/system.cmake | 41 +++++++++++++++++++++------ 2 files changed, 92 insertions(+), 18 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 96c2a43642..1fc2bd3f0a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -78,6 +78,61 @@ set(SYMBOLPREFIX "" CACHE STRING "Add a prefix to all exported symbol names in set(SYMBOLSUFFIX "" CACHE STRING "Add a suffix to all exported symbol names in the shared library, e.g. _64 for INTERFACE64 builds" ) +# Target architecture - auto-detected if not specified +set(TARGET "" CACHE STRING "Target CPU architecture (e.g. HASWELL, SANDYBRIDGE, NEHALEM, ARMV8, POWER9). Auto-detected if not specified.") + +# Binary type (32-bit or 64-bit) +set(BINARY "" CACHE STRING "Build a 32-bit or 64-bit library (32 or 64). Auto-detected if not specified. Note: 32-bit disables AVX.") + +# Threading options +set(USE_THREAD "" CACHE STRING "Enable multi-threading (0=disabled, 1=enabled). Auto-detected based on NUM_THREADS if not specified.") +option(USE_OPENMP "Use OpenMP for threading instead of pthreads" OFF) +set(NUM_THREADS "" CACHE STRING "Maximum number of threads. Auto-detected from CPU cores if not specified.") +set(NUM_PARALLEL "1" CACHE STRING "Number of parallel OpenBLAS instances when using OpenMP (default: 1)") + +# 64-bit integer interface +option(INTERFACE64 "Use 64-bit integers for array indices (equivalent to -i8 in ifort)" OFF) + +# Vector extension control +option(NO_AVX "Disable AVX kernel support (use for compatibility with older systems)" OFF) +option(NO_AVX2 "Disable AVX2 optimizations" OFF) +option(NO_AVX512 "Disable AVX512 optimizations" OFF) + +# Memory tuning options +set(BUFFERSIZE "" CACHE STRING "Memory buffer size factor (32<