Skip to content

Commit ceb544c

Browse files
vtjnashclaude
andcommitted
cmake: add THREAD_TIMEOUT, prevent in-tree builds, fix ARCH handling
Changes: - Add THREAD_TIMEOUT option for thread spin-wait timeout configuration - Prevent in-tree builds with clear error message (protects Makefiles) - Fix ARCH variable to not redundantly re-set when user provides it - Remove experimental warning (CMake now has full Makefile.rule parity) All Makefile.rule options are now supported in CMake: | Makefile.rule Option | CMake Equivalent | |-------------------------------|-------------------------------------| | LIBNAMEPREFIX | LIBNAMEPREFIX | | LIBNAMESUFFIX | LIBNAMESUFFIX | | TARGET | TARGET | | DYNAMIC_ARCH | DYNAMIC_ARCH | | DYNAMIC_OLDER | DYNAMIC_OLDER | | BINARY | BINARY | | USE_THREAD | USE_THREAD | | USE_LOCKING | USE_LOCKING | | USE_OPENMP | USE_OPENMP | | OMP_SCHED | OMP_SCHED | | NUM_THREADS | NUM_THREADS | | NUM_PARALLEL | NUM_PARALLEL | | BUFFERSIZE | BUFFERSIZE | | NO_STATIC / NO_SHARED | BUILD_STATIC_LIBS / BUILD_SHARED_LIBS | | NO_CBLAS | BUILD_WITHOUT_CBLAS | | ONLY_CBLAS | ONLY_CBLAS | | NO_LAPACK | BUILD_WITHOUT_LAPACK | | NO_LAPACKE | BUILD_WITHOUT_LAPACKE | | BUILD_LAPACK_DEPRECATED | BUILD_LAPACK_DEPRECATED | | LAPACK_STRLEN | LAPACK_STRLEN | | BUILD_RELAPACK | BUILD_RELAPACK | | RELAPACK_REPLACE | RELAPACK_REPLACE | | USE_SIMPLE_THREADED_LEVEL3 | USE_SIMPLE_THREADED_LEVEL3 | | USE_TLS | USE_TLS | | INTERFACE64 | INTERFACE64 | | NO_WARMUP | NO_WARMUP | | NO_AFFINITY | NO_AFFINITY | | BIGNUMA | BIGNUMA | | EMBEDDED | EMBEDDED | | NO_AVX / NO_AVX2 / NO_AVX512 | NO_AVX / NO_AVX2 / NO_AVX512 | | FUNCTION_PROFILE | FUNCTION_PROFILE | | QUAD_PRECISION | QUAD_PRECISION | | THREAD_TIMEOUT | THREAD_TIMEOUT | | DEVICEDRIVER_ALLOCATION | DEVICEDRIVER_ALLOCATION | | HUGETLB_ALLOCATION | HUGETLB_ALLOCATION | | HUGETLBFILE_ALLOCATION | HUGETLBFILE_ALLOCATION | | CONSISTENT_FPCSR | CONSISTENT_FPCSR | | GEMM_MULTITHREAD_THRESHOLD | GEMM_MULTITHREAD_THRESHOLD | | SANITY_CHECK | SANITY_CHECK | | MAX_STACK_ALLOC | MAX_STACK_ALLOC | | SYMBOLPREFIX / SYMBOLSUFFIX | SYMBOLPREFIX / SYMBOLSUFFIX | | CPP_THREAD_SAFETY_TEST | CPP_THREAD_SAFETY_TEST | | CPP_THREAD_SAFETY_GEMV | CPP_THREAD_SAFETY_GEMV | | BUILD_BFLOAT16 / BUILD_HFLOAT16 | BUILD_BFLOAT16 / BUILD_HFLOAT16 | | BLAS3_MEM_ALLOC_THRESHOLD | BLAS3_MEM_ALLOC_THRESHOLD | | BUILD_SINGLE/DOUBLE/COMPLEX/COMPLEX16 | BUILD_SINGLE/DOUBLE/COMPLEX/COMPLEX16 | | ARM_SOFTFP_ABI | ARM_SOFTFP_ABI | | DEBUG | CMAKE_BUILD_TYPE=Debug | | PREFIX | CMAKE_INSTALL_PREFIX | | HOSTCC | CMake toolchain files | 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
1 parent 4bb9754 commit ceb544c

File tree

6 files changed

+168
-60
lines changed

6 files changed

+168
-60
lines changed

CMakeLists.txt

Lines changed: 56 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ cmake_minimum_required(VERSION 3.16.0)
77
set (CMAKE_ASM_SOURCE_FILE_EXTENSIONS "S")
88
project(OpenBLAS C ASM)
99

10+
# Prevent in-tree builds to avoid overwriting Makefiles
11+
if (CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR)
12+
message(FATAL_ERROR "In-tree builds are not allowed. Use: cmake -B build -S .")
13+
endif ()
14+
1015
set(OpenBLAS_MAJOR_VERSION 0)
1116
set(OpenBLAS_MINOR_VERSION 3)
1217
set(OpenBLAS_PATCH_VERSION 30.dev)
@@ -29,6 +34,10 @@ set(LAPACK_STRLEN "" CACHE STRING "When building LAPACK, use this type (e.g. \"i
2934

3035
option(BUILD_TESTING "Build LAPACK testsuite when building LAPACK" ON)
3136

37+
option(BUILD_TESTS "Build the BLAS test suite (test/ and ctest/ directories)" ON)
38+
39+
option(BUILD_UTESTS "Build the unit tests (utest/ directory)" ON)
40+
3241
option(BUILD_BENCHMARKS "Build the collection of BLAS/LAPACK benchmarks" OFF)
3342

3443
option(C_LAPACK "Build LAPACK from C sources instead of the original Fortran" OFF)
@@ -39,8 +48,14 @@ option(DYNAMIC_ARCH "Include support for multiple CPU targets, with automatic se
3948

4049
option(DYNAMIC_OLDER "Include specific support for older x86 cpu models (Penryn,Dunnington,Atom,Nano,Opteron) with DYNAMIC_ARCH" OFF)
4150

51+
set(DYNAMIC_LIST "" CACHE STRING "Manually specify list of CPU targets for DYNAMIC_ARCH instead of default list (semicolon-separated, e.g., 'HASWELL;SKYLAKEX')")
52+
53+
set(TARGET_CORE "" CACHE STRING "Override TARGET for DYNAMIC_ARCH kernel selection. Used to specify which CPU-specific kernels to build.")
54+
4255
option(BUILD_RELAPACK "Build with ReLAPACK (recursive implementation of several LAPACK functions on top of standard LAPACK)" OFF)
4356

57+
option(RELAPACK_REPLACE "Use ReLAPACK to replace standard LAPACK routines instead of adding RELAPACK_ prefixed equivalents (requires BUILD_RELAPACK)" OFF)
58+
4459
option(USE_LOCKING "Use locks even in single-threaded builds to make them callable from multiple threads" OFF)
4560

4661
option(USE_PERL "Use the older PERL scripts for build preparation instead of universal shell scripts" OFF)
@@ -51,6 +66,7 @@ option(FIXED_LIBNAME "Use a non-versioned name for the library and no symbolic l
5166

5267
set(LIBNAMEPREFIX "" CACHE STRING "Add a prefix to the openblas part of the library name" )
5368
set(LIBNAMESUFFIX "" CACHE STRING "Add a suffix after the openblas part of the library name" )
69+
set(LIBSONAMEBASE "openblas" CACHE STRING "Base name for shared library soname (default: openblas)")
5470

5571
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
5672
option(NO_AFFINITY "Disable support for CPU affinity masks to avoid binding processes from e.g. R or numpy/scipy to a single core" ON)
@@ -81,6 +97,9 @@ set(SYMBOLSUFFIX "" CACHE STRING "Add a suffix to all exported symbol names in
8197
# Target architecture - auto-detected if not specified
8298
set(TARGET "" CACHE STRING "Target CPU architecture (e.g. HASWELL, SANDYBRIDGE, NEHALEM, ARMV8, POWER9). Auto-detected if not specified.")
8399

100+
# Force architecture (normally auto-detected from system)
101+
set(ARCH "" CACHE STRING "Force architecture (x86, x86_64, arm, arm64, power, mips, mips64, zarch, loongarch64, riscv64). Auto-detected if not specified.")
102+
84103
# Binary type (32-bit or 64-bit)
85104
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.")
86105

@@ -89,6 +108,7 @@ set(USE_THREAD "" CACHE STRING "Enable multi-threading (0=disabled, 1=enabled).
89108
option(USE_OPENMP "Use OpenMP for threading instead of pthreads" OFF)
90109
set(NUM_THREADS "" CACHE STRING "Maximum number of threads. Auto-detected from CPU cores if not specified.")
91110
set(NUM_PARALLEL "1" CACHE STRING "Number of parallel OpenBLAS instances when using OpenMP (default: 1)")
111+
set(OMP_SCHED "static" CACHE STRING "OpenMP schedule type (static, dynamic, guided, auto, runtime). Default: static")
92112

93113
# 64-bit integer interface
94114
option(INTERFACE64 "Use 64-bit integers for array indices (equivalent to -i8 in ifort)" OFF)
@@ -97,6 +117,8 @@ option(INTERFACE64 "Use 64-bit integers for array indices (equivalent to -i8 in
97117
option(NO_AVX "Disable AVX kernel support (use for compatibility with older systems)" OFF)
98118
option(NO_AVX2 "Disable AVX2 optimizations" OFF)
99119
option(NO_AVX512 "Disable AVX512 optimizations" OFF)
120+
option(NO_SVE "Disable ARM SVE (Scalable Vector Extension) optimizations" OFF)
121+
option(NO_SME "Disable ARM SME (Scalable Matrix Extension) optimizations" OFF)
100122

101123
# Memory tuning options
102124
set(BUFFERSIZE "" CACHE STRING "Memory buffer size factor (32<<n bytes, default: architecture-dependent, typically 25)")
@@ -108,10 +130,12 @@ set(GEMM_MULTITHREAD_THRESHOLD "4" CACHE STRING "Threshold below which GEMM runs
108130
option(USE_SIMPLE_THREADED_LEVEL3 "Use legacy threaded Level 3 implementation" OFF)
109131
option(USE_TLS "Use thread-local storage instead of central memory buffer (requires glibc 2.21+)" OFF)
110132
option(CONSISTENT_FPCSR "Synchronize floating-point CSR between threads (x86/x86_64/aarch64 only)" OFF)
133+
set(THREAD_TIMEOUT "" CACHE STRING "Thread spin-wait timeout as power of 2 cycles, e.g. 26 means 2^26 cycles (~25ms at 3GHz). Range: 4-30. Empty = default (28).")
111134

112135
# System configuration
113136
option(BIGNUMA "Support systems with more than 16 NUMA nodes or more than 256 CPUs (Linux only)" OFF)
114137
option(EMBEDDED "Build for embedded/bare-metal systems (requires custom malloc/free)" OFF)
138+
option(ARM_SOFTFP_ABI "Use soft floating-point ABI on ARM (for compatibility with soft-float systems)" OFF)
115139

116140
# Precision type options (default: build all types if all OFF)
117141
option(BUILD_SINGLE "Build single precision (REAL) functions" OFF)
@@ -120,15 +144,19 @@ option(BUILD_COMPLEX "Build complex (COMPLEX) functions" OFF)
120144
option(BUILD_COMPLEX16 "Build double complex (COMPLEX*16) functions" OFF)
121145
option(BUILD_BFLOAT16 "Build experimental BFLOAT16 functions" OFF)
122146
option(BUILD_HFLOAT16 "Build experimental HFLOAT16 functions" OFF)
147+
option(QUAD_PRECISION "Build with IEEE quad precision support (experimental, x86_64 only)" OFF)
123148

124149
# CBLAS-only mode
125150
option(ONLY_CBLAS "Build only CBLAS interface (no Fortran BLAS, implies NO_LAPACK)" OFF)
126151

127152
# Profiling and debugging
128153
option(FUNCTION_PROFILE "Enable function-level performance profiling" OFF)
129154
option(SANITY_CHECK "Compare results against reference BLAS (slow, for testing only)" OFF)
155+
option(UTEST_CHECK "Enable unit test result checking (implies SANITY_CHECK)" OFF)
130156

131157
# Memory allocation methods
158+
option(SHMEM_ALLOCATION "Use shared memory for buffer allocation" OFF)
159+
option(STATIC_ALLOCATION "Use static memory allocation (for single-threaded or embedded use)" OFF)
132160
option(HUGETLB_ALLOCATION "Use huge pages for thread buffers via shared memory" OFF)
133161
set(HUGETLBFILE_ALLOCATION "" CACHE STRING "Path to hugetlbfs mount for huge page allocation (e.g. /hugepages)")
134162
option(DEVICEDRIVER_ALLOCATION "Use device driver for physically contiguous memory allocation" OFF)
@@ -174,8 +202,6 @@ if(MSVC AND MSVC_STATIC_CRT)
174202
endforeach()
175203
endif()
176204

177-
message(WARNING "CMake support is experimental. It does not yet support all build options and may not produce the same Makefiles that OpenBLAS ships with.")
178-
179205
include("${PROJECT_SOURCE_DIR}/cmake/utils.cmake")
180206
include("${PROJECT_SOURCE_DIR}/cmake/system.cmake")
181207

@@ -439,31 +465,41 @@ if (USE_THREAD)
439465
endif()
440466
endif()
441467

442-
#if (MSVC OR NOT NOFORTRAN)
443-
if (NOT NO_CBLAS)
444-
if (NOT ONLY_CBLAS)
445-
# Broken without fortran on unix
446-
add_subdirectory(utest)
468+
# Build unit tests
469+
if (BUILD_UTESTS)
470+
if (NOT NO_CBLAS)
471+
if (NOT ONLY_CBLAS)
472+
# Broken without fortran on unix
473+
add_subdirectory(utest)
474+
endif()
475+
endif()
447476
endif()
477+
478+
# Build BLAS test suite
479+
if (BUILD_TESTS)
480+
if (NOT NOFORTRAN)
481+
if (NOT ONLY_CBLAS)
482+
# Build test and ctest
483+
add_subdirectory(test)
484+
endif()
485+
endif()
486+
if(NOT NO_CBLAS)
487+
if (NOT ONLY_CBLAS)
488+
add_subdirectory(ctest)
489+
endif()
490+
endif()
448491
endif()
449492

493+
# Build LAPACK test suite
450494
if (NOT NOFORTRAN)
451-
if (NOT ONLY_CBLAS)
452-
# Build test and ctest
453-
add_subdirectory(test)
454-
endif()
455-
if (BUILD_TESTING AND NOT BUILD_WITHOUT_LAPACK)
495+
if (BUILD_TESTING AND NOT BUILD_WITHOUT_LAPACK)
456496
add_subdirectory(lapack-netlib/TESTING)
457497
endif()
458498
endif()
459-
if(NOT NO_CBLAS)
460-
if (NOT ONLY_CBLAS)
461-
add_subdirectory(ctest)
462-
endif()
463-
endif()
464-
if (CPP_THREAD_SAFETY_TEST OR CPP_THREAD_SAFETY_GEMV)
465-
add_subdirectory(cpp_thread_test)
466-
endif()
499+
500+
if (CPP_THREAD_SAFETY_TEST OR CPP_THREAD_SAFETY_GEMV)
501+
add_subdirectory(cpp_thread_test)
502+
endif()
467503

468504
if (NOT FIXED_LIBNAME)
469505
set_target_properties(${OpenBLAS_LIBS} PROPERTIES

cmake/arch.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ if (DYNAMIC_ARCH)
4949
set(DYNAMIC_CORE ${DYNAMIC_CORE} ARMV9SME)
5050
endif()
5151
endif ()
52-
if (DYNAMIC_LIST)
52+
if (DEFINED DYNAMIC_LIST AND NOT "${DYNAMIC_LIST}" STREQUAL "")
5353
set(DYNAMIC_CORE ARMV8 ${DYNAMIC_LIST})
5454
endif ()
5555
endif ()
@@ -90,7 +90,7 @@ if (DYNAMIC_ARCH)
9090
set(DYNAMIC_CORE ${DYNAMIC_CORE} SKYLAKEX COOPERLAKE SAPPHIRERAPIDS)
9191
string(REGEX REPLACE "-march=native" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
9292
endif ()
93-
if (DYNAMIC_LIST)
93+
if (DEFINED DYNAMIC_LIST AND NOT "${DYNAMIC_LIST}" STREQUAL "")
9494
set(DYNAMIC_CORE PRESCOTT ${DYNAMIC_LIST})
9595
endif ()
9696
endif ()

cmake/prebuild.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ endif ()
128128
# Cannot run getarch on target if we are cross-compiling
129129
if (DEFINED CORE AND CMAKE_CROSSCOMPILING AND NOT (${HOST_OS} STREQUAL "WINDOWSSTORE"))
130130
# Write to config as getarch would
131-
if (DEFINED TARGET_CORE)
131+
if (DEFINED TARGET_CORE AND NOT "${TARGET_CORE}" STREQUAL "")
132132
set(TCORE ${TARGET_CORE})
133133
else()
134134
set(TCORE ${CORE})
@@ -1589,7 +1589,7 @@ else(NOT CMAKE_CROSSCOMPILING)
15891589
if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
15901590
list(APPEND GETARCH_SRC ${PROJECT_SOURCE_DIR}/cpuid.S)
15911591
endif()
1592-
if (DEFINED TARGET_CORE)
1592+
if (DEFINED TARGET_CORE AND NOT "${TARGET_CORE}" STREQUAL "")
15931593
set(GETARCH_FLAGS ${GETARCH_FLAGS} -DFORCE_${TARGET_CORE})
15941594
endif ()
15951595
endif ()

cmake/system.cmake

Lines changed: 48 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,8 @@ if(NOT DEFINED CORE AND _TARGET_SET)
8484
endif()
8585

8686
# TARGET_CORE will override TARGET which is used in DYNAMIC_ARCH=1.
87-
if (DEFINED TARGET_CORE)
87+
if (DEFINED TARGET_CORE AND NOT "${TARGET_CORE}" STREQUAL "")
88+
message(STATUS "Using TARGET_CORE=${TARGET_CORE} for kernel selection")
8889
set(TARGET ${TARGET_CORE})
8990
endif ()
9091

@@ -468,6 +469,10 @@ endif ()
468469
if (USE_OPENMP)
469470
find_package(OpenMP COMPONENTS C REQUIRED)
470471
set(CCOMMON_OPT "${CCOMMON_OPT} -DUSE_OPENMP")
472+
# Set OpenMP schedule type (default is static)
473+
if (OMP_SCHED AND NOT "${OMP_SCHED}" STREQUAL "static")
474+
set(CCOMMON_OPT "${CCOMMON_OPT} -DOMP_SCHED=${OMP_SCHED}")
475+
endif ()
471476
if (NOT NOFORTRAN)
472477
find_package(OpenMP COMPONENTS Fortran REQUIRED)
473478
# Avoid mixed OpenMP linkage
@@ -496,6 +501,11 @@ if(EMBEDDED)
496501
set(CCOMMON_OPT "${CCOMMON_OPT} -mthumb -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16")
497502
endif()
498503

504+
if (ARM_SOFTFP_ABI)
505+
set(CCOMMON_OPT "${CCOMMON_OPT} -mfloat-abi=softfp")
506+
set(FCOMMON_OPT "${FCOMMON_OPT} -mfloat-abi=softfp")
507+
endif ()
508+
499509
if (NEED_PIC)
500510
if (${CMAKE_C_COMPILER} STREQUAL "IBM")
501511
set(CCOMMON_OPT "${CCOMMON_OPT} -qpic=large")
@@ -514,20 +524,21 @@ if (NEED_PIC)
514524
endif()
515525
endif ()
516526

517-
if (X86_64 OR ${CORE} STREQUAL POWER10 OR ARM64 OR LOONGARCH64)
518-
set(SMALL_MATRIX_OPT TRUE)
527+
# Auto-enable SMALL_MATRIX_OPT on supported architectures (internal, not user-configurable)
528+
if (X86_64 OR (DEFINED CORE AND ${CORE} STREQUAL POWER10) OR ARM64 OR LOONGARCH64)
529+
set(SMALL_MATRIX_OPT ON)
519530
endif ()
531+
532+
# Auto-enable GEMM_GEMV_FORWARD on supported architectures (internal, not user-configurable)
520533
if (ARM64)
521-
set(GEMM_GEMV_FORWARD TRUE)
522-
set(SBGEMM_GEMV_FORWARD TRUE)
523-
set(BGEMM_GEMV_FORWARD TRUE)
524-
endif ()
525-
if (POWER)
526-
set(GEMM_GEMV_FORWARD TRUE)
527-
set(SBGEMM_GEMV_FORWARD TRUE)
528-
endif ()
529-
if (RISCV64)
530-
set(GEMM_GEMV_FORWARD TRUE)
534+
set(GEMM_GEMV_FORWARD ON)
535+
set(SBGEMM_GEMV_FORWARD ON)
536+
set(BGEMM_GEMV_FORWARD ON)
537+
elseif (POWER)
538+
set(GEMM_GEMV_FORWARD ON)
539+
set(SBGEMM_GEMV_FORWARD ON)
540+
elseif (RISCV64)
541+
set(GEMM_GEMV_FORWARD ON)
531542
endif ()
532543

533544
if (GEMM_GEMV_FORWARD)
@@ -555,7 +566,8 @@ if (DYNAMIC_ARCH)
555566
endif ()
556567
endif ()
557568

558-
if (DYNAMIC_LIST)
569+
if (DEFINED DYNAMIC_LIST AND NOT "${DYNAMIC_LIST}" STREQUAL "")
570+
message(STATUS "Using custom DYNAMIC_LIST: ${DYNAMIC_LIST}")
559571
set(CCOMMON_OPT "${CCOMMON_OPT} -DDYNAMIC_LIST")
560572
foreach(DCORE ${DYNAMIC_LIST})
561573
set(CCOMMON_OPT "${CCOMMON_OPT} -DDYN_${DCORE}")
@@ -588,6 +600,14 @@ if (NO_AVX512)
588600
set(CCOMMON_OPT "${CCOMMON_OPT} -DNO_AVX512")
589601
endif ()
590602

603+
if (NO_SVE)
604+
set(CCOMMON_OPT "${CCOMMON_OPT} -DNO_SVE")
605+
endif ()
606+
607+
if (NO_SME)
608+
set(CCOMMON_OPT "${CCOMMON_OPT} -DNO_SME")
609+
endif ()
610+
591611
if (USE_THREAD)
592612
# USE_SIMPLE_THREADED_LEVEL3 = 1
593613
# NO_AFFINITY = 1
@@ -616,6 +636,10 @@ if (USE_TLS)
616636
set(CCOMMON_OPT "${CCOMMON_OPT} -DUSE_TLS")
617637
endif ()
618638

639+
if (DEFINED THREAD_TIMEOUT AND NOT "${THREAD_TIMEOUT}" STREQUAL "")
640+
set(CCOMMON_OPT "${CCOMMON_OPT} -DTHREAD_TIMEOUT=${THREAD_TIMEOUT}")
641+
endif ()
642+
619643
# Only for development
620644
# set(CCOMMON_OPT "${CCOMMON_OPT} -DPARAMTEST")
621645
# set(CCOMMON_OPT "${CCOMMON_OPT} -DPREFETCHTEST")
@@ -660,7 +684,12 @@ endif()
660684
endif()
661685
endif()
662686

663-
set(LIBPREFIX "lib${LIBNAMEPREFIX}openblas")
687+
# Use LIBSONAMEBASE for library naming (default: openblas)
688+
if (NOT DEFINED LIBSONAMEBASE OR "${LIBSONAMEBASE}" STREQUAL "")
689+
set(LIBSONAMEBASE "openblas")
690+
endif ()
691+
692+
set(LIBPREFIX "lib${LIBNAMEPREFIX}${LIBSONAMEBASE}")
664693

665694
if (DEFINED LIBNAMESUFFIX)
666695
set(LIBPREFIX "${LIBNAMEPREFIX}_${LIBNAMESUFFIX}")
@@ -711,6 +740,10 @@ if (DEFINED HUGETLBFILE_ALLOCATION AND NOT "${HUGETLBFILE_ALLOCATION}" STREQUAL
711740
set(CCOMMON_OPT "${CCOMMON_OPT} -DALLOC_HUGETLBFILE -DHUGETLB_FILE_NAME=${HUGETLBFILE_ALLOCATION})")
712741
endif ()
713742

743+
if (SHMEM_ALLOCATION)
744+
set(CCOMMON_OPT "${CCOMMON_OPT} -DALLOC_SHM")
745+
endif ()
746+
714747
if (STATIC_ALLOCATION)
715748
set(CCOMMON_OPT "${CCOMMON_OPT} -DALLOC_STATIC")
716749
endif ()

0 commit comments

Comments
 (0)