Commit 547b00d9 authored by Sachin Setiya's avatar Sachin Setiya

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
parent dde0ba5a
......@@ -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
......
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()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment