mirror of
https://github.com/MariaDB/server.git
synced 2025-03-30 11:55:31 +02:00
MDEV-12924 No --innodb-numa-interleave in mysqld binaries
It changes the cmake WITH_NUMA option to have 3 values Auto:- If libnuma present compile with numa (Default value) OFF:- Compile without libnuma On:- Compile with numa , throw error if libnuma not present Patch Contributer:- Vesa Patch Reviewer:- serg
This commit is contained in:
parent
dde0ba5aaa
commit
547b00d910
2 changed files with 21 additions and 9 deletions
|
@ -129,6 +129,9 @@ IF(DEFINED ENV{CPPFLAGS})
|
|||
ADD_DEFINITIONS($ENV{CPPFLAGS})
|
||||
ENDIF()
|
||||
|
||||
# NUMA
|
||||
SET(WITH_NUMA "AUTO" CACHE STRING "Build with non-uniform memory access, allowing --innodb-numa-interleave. Options are ON|OFF|AUTO. ON = enabled (requires NUMA library), OFF = disabled, AUTO = enabled if NUMA library found.")
|
||||
|
||||
SET(MYSQL_MAINTAINER_MODE "AUTO" CACHE STRING "MySQL maintainer-specific development environment. Options are: ON OFF AUTO.")
|
||||
|
||||
# Packaging
|
||||
|
|
|
@ -1,16 +1,18 @@
|
|||
MACRO (MYSQL_CHECK_NUMA)
|
||||
|
||||
IF(CMAKE_SYSTEM_NAME MATCHES "Linux")
|
||||
STRING(TOLOWER "${WITH_NUMA}" WITH_NUMA_LOWERCASE)
|
||||
|
||||
IF(NOT WITH_NUMA)
|
||||
MESSAGE(STATUS "WITH_NUMA=OFF: NUMA memory allocation policy disabled")
|
||||
|
||||
ELSEIF(NOT WITH_NUMA_LOWERCASE STREQUAL "auto" AND NOT WITH_NUMA_LOWERCASE STREQUAL "on")
|
||||
MESSAGE(FATAL_ERROR "Wrong value for WITH_NUMA")
|
||||
|
||||
ELSEIF(CMAKE_SYSTEM_NAME MATCHES "Linux")
|
||||
CHECK_INCLUDE_FILES(numa.h HAVE_NUMA_H)
|
||||
CHECK_INCLUDE_FILES(numaif.h HAVE_NUMAIF_H)
|
||||
|
||||
IF(HAVE_NUMA_H AND HAVE_NUMAIF_H)
|
||||
OPTION(WITH_NUMA "Explicitly set NUMA memory allocation policy" ON)
|
||||
ELSE()
|
||||
OPTION(WITH_NUMA "Explicitly set NUMA memory allocation policy" OFF)
|
||||
ENDIF()
|
||||
|
||||
IF(WITH_NUMA AND HAVE_NUMA_H AND HAVE_NUMAIF_H)
|
||||
SET(SAVE_CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES})
|
||||
SET(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} numa)
|
||||
CHECK_C_SOURCE_COMPILES(
|
||||
|
@ -31,12 +33,19 @@ MACRO (MYSQL_CHECK_NUMA)
|
|||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
IF(WITH_NUMA AND NOT HAVE_LIBNUMA)
|
||||
IF(WITH_NUMA_LOWERCASE STREQUAL "auto" AND HAVE_LIBNUMA)
|
||||
MESSAGE(STATUS "WITH_NUMA=AUTO: NUMA memory allocation policy enabled")
|
||||
ELSEIF(WITH_NUMA_LOWERCASE STREQUAL "auto" AND NOT HAVE_LIBNUMA)
|
||||
MESSAGE(STATUS "WITH_NUMA=AUTO: NUMA memory allocation policy disabled")
|
||||
ELSEIF(HAVE_LIBNUMA)
|
||||
MESSAGE(STATUS "WITH_NUMA=ON: NUMA memory allocation policy enabled")
|
||||
ELSE()
|
||||
# Forget it in cache, abort the build.
|
||||
UNSET(WITH_NUMA CACHE)
|
||||
UNSET(NUMA_LIBRARY CACHE)
|
||||
MESSAGE(FATAL_ERROR "Could not find numa headers/libraries")
|
||||
MESSAGE(FATAL_ERROR "WITH_NUMA=ON: Could not find NUMA headers/libraries")
|
||||
ENDIF()
|
||||
|
||||
ENDIF()
|
||||
|
||||
ENDMACRO()
|
||||
|
|
Loading…
Add table
Reference in a new issue