Skip to content

Commit 4d858e5

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 | Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent e739888 commit 4d858e5

6 files changed

Lines changed: 168 additions & 60 deletions

File tree

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 33.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)
@@ -82,6 +98,9 @@ set(SYMBOLSUFFIX "" CACHE STRING "Add a suffix to all exported symbol names in
8298
# Target architecture - auto-detected if not specified
8399
set(TARGET "" CACHE STRING "Target CPU architecture (e.g. HASWELL, SANDYBRIDGE, NEHALEM, ARMV8, POWER9). Auto-detected if not specified.")
84100

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

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

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

102124
# Memory tuning options
103125
set(BUFFERSIZE "" CACHE STRING "Memory buffer size factor (32<<n bytes, default: architecture-dependent, typically 25)")
@@ -109,10 +131,12 @@ set(GEMM_MULTITHREAD_THRESHOLD "4" CACHE STRING "Threshold below which GEMM runs
109131
option(USE_SIMPLE_THREADED_LEVEL3 "Use legacy threaded Level 3 implementation" OFF)
110132
option(USE_TLS "Use thread-local storage instead of central memory buffer (requires glibc 2.21+)" OFF)
111133
option(CONSISTENT_FPCSR "Synchronize floating-point CSR between threads (x86/x86_64/aarch64 only)" OFF)
134+
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).")
112135

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

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

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

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

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

178-
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.")
179-
180206
include("${PROJECT_SOURCE_DIR}/cmake/utils.cmake")
181207
include("${PROJECT_SOURCE_DIR}/cmake/system.cmake")
182208

@@ -496,31 +522,41 @@ if (USE_THREAD)
496522
endif()
497523
endif()
498524

499-
#if (MSVC OR NOT NOFORTRAN)
500-
if (NOT NO_CBLAS)
501-
if (NOT ONLY_CBLAS)
502-
# Broken without fortran on unix
503-
add_subdirectory(utest)
525+
# Build unit tests
526+
if (BUILD_UTESTS)
527+
if (NOT NO_CBLAS)
528+
if (NOT ONLY_CBLAS)
529+
# Broken without fortran on unix
530+
add_subdirectory(utest)
531+
endif()
532+
endif()
504533
endif()
534+
535+
# Build BLAS test suite
536+
if (BUILD_TESTS)
537+
if (NOT NOFORTRAN)
538+
if (NOT ONLY_CBLAS)
539+
# Build test and ctest
540+
add_subdirectory(test)
541+
endif()
542+
endif()
543+
if(NOT NO_CBLAS)
544+
if (NOT ONLY_CBLAS)
545+
add_subdirectory(ctest)
546+
endif()
547+
endif()
505548
endif()
506549

550+
# Build LAPACK test suite
507551
if (NOT NOFORTRAN)
508-
if (NOT ONLY_CBLAS)
509-
# Build test and ctest
510-
add_subdirectory(test)
511-
endif()
512-
if (BUILD_TESTING AND NOT BUILD_WITHOUT_LAPACK)
552+
if (BUILD_TESTING AND NOT BUILD_WITHOUT_LAPACK)
513553
add_subdirectory(lapack-netlib/TESTING)
514554
endif()
515555
endif()
516-
if(NOT NO_CBLAS)
517-
if (NOT ONLY_CBLAS)
518-
add_subdirectory(ctest)
519-
endif()
520-
endif()
521-
if (CPP_THREAD_SAFETY_TEST OR CPP_THREAD_SAFETY_GEMV)
522-
add_subdirectory(cpp_thread_test)
523-
endif()
556+
557+
if (CPP_THREAD_SAFETY_TEST OR CPP_THREAD_SAFETY_GEMV)
558+
add_subdirectory(cpp_thread_test)
559+
endif()
524560

525561
if (NOT FIXED_LIBNAME)
526562
set_target_properties(${OpenBLAS_LIBS} PROPERTIES

cmake/arch.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ if (DYNAMIC_ARCH)
6969
endif()
7070
endif()
7171

72-
if (DYNAMIC_LIST)
72+
if (DEFINED DYNAMIC_LIST AND NOT "${DYNAMIC_LIST}" STREQUAL "")
7373
set(DYNAMIC_CORE ARMV8 ${DYNAMIC_LIST})
7474
endif ()
7575
endif ()
@@ -110,7 +110,7 @@ if (DYNAMIC_ARCH)
110110
set(DYNAMIC_CORE ${DYNAMIC_CORE} SKYLAKEX COOPERLAKE SAPPHIRERAPIDS)
111111
string(REGEX REPLACE "-march=native" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
112112
endif ()
113-
if (DYNAMIC_LIST)
113+
if (DEFINED DYNAMIC_LIST AND NOT "${DYNAMIC_LIST}" STREQUAL "")
114114
set(DYNAMIC_CORE PRESCOTT ${DYNAMIC_LIST})
115115
endif ()
116116
endif ()

cmake/prebuild.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ endif ()
132132
# Cannot run getarch on target if we are cross-compiling
133133
if (DEFINED CORE AND CMAKE_CROSSCOMPILING AND NOT (${HOST_OS} STREQUAL "WINDOWSSTORE"))
134134
# Write to config as getarch would
135-
if (DEFINED TARGET_CORE)
135+
if (DEFINED TARGET_CORE AND NOT "${TARGET_CORE}" STREQUAL "")
136136
set(TCORE ${TARGET_CORE})
137137
else()
138138
set(TCORE ${CORE})
@@ -1611,7 +1611,7 @@ else(NOT CMAKE_CROSSCOMPILING)
16111611
if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
16121612
list(APPEND GETARCH_SRC ${PROJECT_SOURCE_DIR}/cpuid.S)
16131613
endif()
1614-
if (DEFINED TARGET_CORE)
1614+
if (DEFINED TARGET_CORE AND NOT "${TARGET_CORE}" STREQUAL "")
16151615
set(GETARCH_FLAGS ${GETARCH_FLAGS} -DFORCE_${TARGET_CORE})
16161616
endif ()
16171617
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
set(_TARGET_SET TRUE)
9091
endif ()
@@ -482,6 +483,10 @@ endif ()
482483
if (USE_OPENMP)
483484
find_package(OpenMP COMPONENTS C REQUIRED)
484485
set(CCOMMON_OPT "${CCOMMON_OPT} -DUSE_OPENMP")
486+
# Set OpenMP schedule type (default is static)
487+
if (OMP_SCHED AND NOT "${OMP_SCHED}" STREQUAL "static")
488+
set(CCOMMON_OPT "${CCOMMON_OPT} -DOMP_SCHED=${OMP_SCHED}")
489+
endif ()
485490
if (NOT NOFORTRAN)
486491
find_package(OpenMP COMPONENTS Fortran REQUIRED)
487492
# Avoid mixed OpenMP linkage
@@ -510,6 +515,11 @@ if(EMBEDDED)
510515
set(CCOMMON_OPT "${CCOMMON_OPT} -mthumb -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16")
511516
endif()
512517

518+
if (ARM_SOFTFP_ABI)
519+
set(CCOMMON_OPT "${CCOMMON_OPT} -mfloat-abi=softfp")
520+
set(FCOMMON_OPT "${FCOMMON_OPT} -mfloat-abi=softfp")
521+
endif ()
522+
513523
if (NEED_PIC)
514524
if (${CMAKE_C_COMPILER} STREQUAL "IBM")
515525
set(CCOMMON_OPT "${CCOMMON_OPT} -qpic=large")
@@ -528,20 +538,21 @@ if (NEED_PIC)
528538
endif()
529539
endif ()
530540

531-
if (X86_64 OR ${CORE} STREQUAL POWER10 OR ARM64 OR LOONGARCH64)
532-
set(SMALL_MATRIX_OPT TRUE)
541+
# Auto-enable SMALL_MATRIX_OPT on supported architectures (internal, not user-configurable)
542+
if (X86_64 OR (DEFINED CORE AND ${CORE} STREQUAL POWER10) OR ARM64 OR LOONGARCH64)
543+
set(SMALL_MATRIX_OPT ON)
533544
endif ()
545+
546+
# Auto-enable GEMM_GEMV_FORWARD on supported architectures (internal, not user-configurable)
534547
if (ARM64)
535-
set(GEMM_GEMV_FORWARD TRUE)
536-
set(SBGEMM_GEMV_FORWARD TRUE)
537-
set(BGEMM_GEMV_FORWARD TRUE)
538-
endif ()
539-
if (POWER)
540-
set(GEMM_GEMV_FORWARD TRUE)
541-
set(SBGEMM_GEMV_FORWARD TRUE)
542-
endif ()
543-
if (RISCV64)
544-
set(GEMM_GEMV_FORWARD TRUE)
548+
set(GEMM_GEMV_FORWARD ON)
549+
set(SBGEMM_GEMV_FORWARD ON)
550+
set(BGEMM_GEMV_FORWARD ON)
551+
elseif (POWER)
552+
set(GEMM_GEMV_FORWARD ON)
553+
set(SBGEMM_GEMV_FORWARD ON)
554+
elseif (RISCV64)
555+
set(GEMM_GEMV_FORWARD ON)
545556
endif ()
546557

547558
if (GEMM_GEMV_FORWARD)
@@ -569,7 +580,8 @@ if (DYNAMIC_ARCH)
569580
endif ()
570581
endif ()
571582

572-
if (DYNAMIC_LIST)
583+
if (DEFINED DYNAMIC_LIST AND NOT "${DYNAMIC_LIST}" STREQUAL "")
584+
message(STATUS "Using custom DYNAMIC_LIST: ${DYNAMIC_LIST}")
573585
set(CCOMMON_OPT "${CCOMMON_OPT} -DDYNAMIC_LIST")
574586
foreach(DCORE ${DYNAMIC_LIST})
575587
set(CCOMMON_OPT "${CCOMMON_OPT} -DDYN_${DCORE}")
@@ -602,6 +614,14 @@ if (NO_AVX512)
602614
set(CCOMMON_OPT "${CCOMMON_OPT} -DNO_AVX512")
603615
endif ()
604616

617+
if (NO_SVE)
618+
set(CCOMMON_OPT "${CCOMMON_OPT} -DNO_SVE")
619+
endif ()
620+
621+
if (NO_SME)
622+
set(CCOMMON_OPT "${CCOMMON_OPT} -DNO_SME")
623+
endif ()
624+
605625
if (USE_THREAD)
606626
# USE_SIMPLE_THREADED_LEVEL3 = 1
607627
# NO_AFFINITY = 1
@@ -630,6 +650,10 @@ if (USE_TLS)
630650
set(CCOMMON_OPT "${CCOMMON_OPT} -DUSE_TLS")
631651
endif ()
632652

653+
if (DEFINED THREAD_TIMEOUT AND NOT "${THREAD_TIMEOUT}" STREQUAL "")
654+
set(CCOMMON_OPT "${CCOMMON_OPT} -DTHREAD_TIMEOUT=${THREAD_TIMEOUT}")
655+
endif ()
656+
633657
# Only for development
634658
# set(CCOMMON_OPT "${CCOMMON_OPT} -DPARAMTEST")
635659
# set(CCOMMON_OPT "${CCOMMON_OPT} -DPREFETCHTEST")
@@ -674,7 +698,12 @@ endif()
674698
endif()
675699
endif()
676700

677-
set(LIBPREFIX "lib${LIBNAMEPREFIX}openblas")
701+
# Use LIBSONAMEBASE for library naming (default: openblas)
702+
if (NOT DEFINED LIBSONAMEBASE OR "${LIBSONAMEBASE}" STREQUAL "")
703+
set(LIBSONAMEBASE "openblas")
704+
endif ()
705+
706+
set(LIBPREFIX "lib${LIBNAMEPREFIX}${LIBSONAMEBASE}")
678707

679708
if (DEFINED LIBNAMESUFFIX AND NOT "${LIBNAMESUFFIX}" STREQUAL "")
680709
set(LIBPREFIX "lib${LIBNAMEPREFIX}openblas${LIBNAMESUFFIX}")
@@ -725,6 +754,10 @@ if (DEFINED HUGETLBFILE_ALLOCATION AND NOT "${HUGETLBFILE_ALLOCATION}" STREQUAL
725754
set(CCOMMON_OPT "${CCOMMON_OPT} -DALLOC_HUGETLBFILE -DHUGETLB_FILE_NAME=${HUGETLBFILE_ALLOCATION})")
726755
endif ()
727756

757+
if (SHMEM_ALLOCATION)
758+
set(CCOMMON_OPT "${CCOMMON_OPT} -DALLOC_SHM")
759+
endif ()
760+
728761
if (STATIC_ALLOCATION)
729762
set(CCOMMON_OPT "${CCOMMON_OPT} -DALLOC_STATIC")
730763
endif ()

0 commit comments

Comments
 (0)