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 /cmake | |
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>
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/numa.cmake | 37 |
1 files changed, 22 insertions, 15 deletions
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() |