Commit 2d25d09a authored by Vladislav Vaintroub's avatar Vladislav Vaintroub Committed by GitHub

Merge pull request #253 from grooverdan/10.2-MDEV-11195-numa-build

MDEV-11195: Correct enablement of NUMA in innodb/xtradb
parents 7afcc7d1 58ac8dd2
......@@ -162,7 +162,6 @@ INCLUDE(install_macros)
INCLUDE(systemd)
INCLUDE(mysql_add_executable)
INCLUDE(crc32-vpmsum)
INCLUDE(numa)
# Handle options
OPTION(DISABLE_SHARED
......
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,29 +11,33 @@ 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})
ELSE()
SET(HAVE_LIBNUMA 0)
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)
SET(NUMA_LIBRARY "numa")
ENDIF()
ENDIF()
IF(WITH_NUMA AND NOT HAVE_LIBNUMA)
# Forget it in cache, abort the build.
UNSET(WITH_NUMA CACHE)
UNSET(NUMA_LIBRARY CACHE)
MESSAGE(FATAL_ERROR "Could not find numa headers/libraries")
ENDIF()
ENDIF()
ENDMACRO()
......@@ -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
......
......@@ -24,6 +24,7 @@ INCLUDE(lzo)
INCLUDE(lzma)
INCLUDE(bzip2)
INCLUDE(snappy)
INCLUDE(numa)
MYSQL_CHECK_LZ4()
MYSQL_CHECK_LZO()
......@@ -174,11 +175,6 @@ IF(WITH_INNODB)
SET(WITH_INNOBASE_STORAGE_ENGINE TRUE)
ENDIF()
UNSET(NUMA_LIBRARY)
IF(HAVE_LIBNUMA)
SET(NUMA_LIBRARY "numa")
ENDIF()
MYSQL_ADD_PLUGIN(innobase ${INNOBASE_SOURCES} STORAGE_ENGINE
# MODULE_ONLY
# MODULE_OUTPUT_NAME ha_innodb
......
......@@ -23,6 +23,7 @@ INCLUDE(lzo)
INCLUDE(lzma)
INCLUDE(bzip2)
INCLUDE(snappy)
INCLUDE(numa)
MYSQL_CHECK_LZ4()
MYSQL_CHECK_LZO()
......@@ -497,11 +498,6 @@ SET(INNOBASE_SOURCES
ut/ut0wqueue.cc
ut/ut0timer.cc)
UNSET(NUMA_LIBRARY)
IF(HAVE_LIBNUMA)
SET(NUMA_LIBRARY "numa")
ENDIF()
MYSQL_ADD_PLUGIN(xtradb ${INNOBASE_SOURCES} STORAGE_ENGINE
DISABLED # until upgraded to 5.7, see also mysql-test/include/have_xtradb.combinations
RECOMPILE_FOR_EMBEDDED
......
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