diff options
author | Daniel Black <daniel.black@au.ibm.com> | 2016-11-01 11:01:48 +1100 |
---|---|---|
committer | Daniel Black <daniel.black@au.ibm.com> | 2016-11-01 11:09:47 +1100 |
commit | ab0e5031e41d0aa72dd77a6dced9eacc8be5c548 (patch) | |
tree | fc6339f99f70c3229e6df42a9f2152524af87fc6 | |
parent | 71e11bce34339a69576321d6c40838fa65208dc7 (diff) | |
download | mariadb-git-ab0e5031e41d0aa72dd77a6dced9eacc8be5c548.tar.gz |
MDEV-11195: Correct enablement of NUMA in innodb/xtradb
No -DHAVE_LIBNUMA=1 was passed to the source compile (and the
global include/my_config.h wasn't used).
This also is Linux only so corrected the cmake macro.
Fixed indenting in cmake macro.
Removed NUMA defination from include/my_config.h as its only
in the storage engine.
Thanks Elena Stepanova and Vladislav Vaintroub for the detailed
list of bugs/questions.
Signed-off-by: Daniel Black <daniel.black@au.ibm.com>
-rw-r--r-- | CMakeLists.txt | 1 | ||||
-rw-r--r-- | cmake/numa.cmake | 37 | ||||
-rw-r--r-- | config.h.cmake | 1 | ||||
-rw-r--r-- | storage/innobase/CMakeLists.txt | 1 | ||||
-rw-r--r-- | storage/xtradb/CMakeLists.txt | 1 |
5 files changed, 24 insertions, 17 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index d0e5cf87475..4272699cb4e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -162,7 +162,6 @@ INCLUDE(install_macros) INCLUDE(systemd) INCLUDE(mysql_add_executable) INCLUDE(crc32-vpmsum) -INCLUDE(numa) # Handle options OPTION(DISABLE_SHARED diff --git a/cmake/numa.cmake b/cmake/numa.cmake index d5234a5ef4f..996042f3262 100644 --- a/cmake/numa.cmake +++ b/cmake/numa.cmake @@ -1,5 +1,6 @@ MACRO (MYSQL_CHECK_NUMA) + IF(CMAKE_SYSTEM_NAME MATCHES "Linux") CHECK_INCLUDE_FILES(numa.h HAVE_NUMA_H) CHECK_INCLUDE_FILES(numaif.h HAVE_NUMAIF_H) @@ -10,22 +11,25 @@ MACRO (MYSQL_CHECK_NUMA) 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( - " - #include <numa.h> - #include <numaif.h> - int main() - { - struct bitmask *all_nodes= numa_all_nodes_ptr; - set_mempolicy(MPOL_DEFAULT, 0, 0); - return all_nodes != NULL; - }" - HAVE_LIBNUMA) - SET(CMAKE_REQUIRED_LIBRARIES ${SAVE_CMAKE_REQUIRED_LIBRARIES}) + SET(SAVE_CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES}) + SET(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} numa) + CHECK_C_SOURCE_COMPILES( + " + #include <numa.h> + #include <numaif.h> + int main() + { + struct bitmask *all_nodes= numa_all_nodes_ptr; + set_mempolicy(MPOL_DEFAULT, 0, 0); + return all_nodes != NULL; + }" + HAVE_LIBNUMA) + SET(CMAKE_REQUIRED_LIBRARIES ${SAVE_CMAKE_REQUIRED_LIBRARIES}) + IF(HAVE_LIBNUMA) + ADD_DEFINITIONS(-DHAVE_LIBNUMA=1) + ENDIF() ELSE() - SET(HAVE_LIBNUMA 0) + SET(HAVE_LIBNUMA 0) ENDIF() IF(WITH_NUMA AND NOT HAVE_LIBNUMA) @@ -33,6 +37,9 @@ MACRO (MYSQL_CHECK_NUMA) UNSET(WITH_NUMA CACHE) MESSAGE(FATAL_ERROR "Could not find numa headers/libraries") ENDIF() + ELSE() + SET(HAVE_LIBNUMA 0) + ENDIF() ENDMACRO() diff --git a/config.h.cmake b/config.h.cmake index 08b0422a520..00aa03483ee 100644 --- a/config.h.cmake +++ b/config.h.cmake @@ -106,7 +106,6 @@ #cmakedefine HAVE_LIBWRAP 1 #cmakedefine HAVE_SYSTEMD 1 #cmakedefine HAVE_CRC32_VPMSUM 1 -#cmakedefine HAVE_LIBNUMA 1 /* Does "struct timespec" have a "sec" and "nsec" field? */ #cmakedefine HAVE_TIMESPEC_TS_SEC 1 diff --git a/storage/innobase/CMakeLists.txt b/storage/innobase/CMakeLists.txt index d9b50935d27..237de77d213 100644 --- a/storage/innobase/CMakeLists.txt +++ b/storage/innobase/CMakeLists.txt @@ -24,6 +24,7 @@ INCLUDE(lzo) INCLUDE(lzma) INCLUDE(bzip2) INCLUDE(snappy) +INCLUDE(numa) MYSQL_CHECK_LZ4() MYSQL_CHECK_LZO() diff --git a/storage/xtradb/CMakeLists.txt b/storage/xtradb/CMakeLists.txt index 7e0bb9103d2..6512f247e52 100644 --- a/storage/xtradb/CMakeLists.txt +++ b/storage/xtradb/CMakeLists.txt @@ -23,6 +23,7 @@ INCLUDE(lzo) INCLUDE(lzma) INCLUDE(bzip2) INCLUDE(snappy) +INCLUDE(numa) MYSQL_CHECK_LZ4() MYSQL_CHECK_LZO() |