Skip to content

Commit 2d25d09

Browse files
authored
Merge pull request #253 from grooverdan/10.2-MDEV-11195-numa-build
MDEV-11195: Correct enablement of NUMA in innodb/xtradb
2 parents 7afcc7d + 58ac8dd commit 2d25d09

File tree

5 files changed

+23
-28
lines changed

5 files changed

+23
-28
lines changed

CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,6 @@ INCLUDE(install_macros)
162162
INCLUDE(systemd)
163163
INCLUDE(mysql_add_executable)
164164
INCLUDE(crc32-vpmsum)
165-
INCLUDE(numa)
166165

167166
# Handle options
168167
OPTION(DISABLE_SHARED

cmake/numa.cmake

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
MACRO (MYSQL_CHECK_NUMA)
22

3+
IF(CMAKE_SYSTEM_NAME MATCHES "Linux")
34
CHECK_INCLUDE_FILES(numa.h HAVE_NUMA_H)
45
CHECK_INCLUDE_FILES(numaif.h HAVE_NUMAIF_H)
56

@@ -10,29 +11,33 @@ MACRO (MYSQL_CHECK_NUMA)
1011
ENDIF()
1112

1213
IF(WITH_NUMA AND HAVE_NUMA_H AND HAVE_NUMAIF_H)
13-
SET(SAVE_CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES})
14-
SET(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} numa)
15-
CHECK_C_SOURCE_COMPILES(
16-
"
17-
#include <numa.h>
18-
#include <numaif.h>
19-
int main()
20-
{
21-
struct bitmask *all_nodes= numa_all_nodes_ptr;
22-
set_mempolicy(MPOL_DEFAULT, 0, 0);
23-
return all_nodes != NULL;
24-
}"
25-
HAVE_LIBNUMA)
26-
SET(CMAKE_REQUIRED_LIBRARIES ${SAVE_CMAKE_REQUIRED_LIBRARIES})
27-
ELSE()
28-
SET(HAVE_LIBNUMA 0)
14+
SET(SAVE_CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES})
15+
SET(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} numa)
16+
CHECK_C_SOURCE_COMPILES(
17+
"
18+
#include <numa.h>
19+
#include <numaif.h>
20+
int main()
21+
{
22+
struct bitmask *all_nodes= numa_all_nodes_ptr;
23+
set_mempolicy(MPOL_DEFAULT, 0, 0);
24+
return all_nodes != NULL;
25+
}"
26+
HAVE_LIBNUMA)
27+
SET(CMAKE_REQUIRED_LIBRARIES ${SAVE_CMAKE_REQUIRED_LIBRARIES})
28+
IF(HAVE_LIBNUMA)
29+
ADD_DEFINITIONS(-DHAVE_LIBNUMA=1)
30+
SET(NUMA_LIBRARY "numa")
31+
ENDIF()
2932
ENDIF()
3033

3134
IF(WITH_NUMA AND NOT HAVE_LIBNUMA)
3235
# Forget it in cache, abort the build.
3336
UNSET(WITH_NUMA CACHE)
37+
UNSET(NUMA_LIBRARY CACHE)
3438
MESSAGE(FATAL_ERROR "Could not find numa headers/libraries")
3539
ENDIF()
40+
ENDIF()
3641

3742
ENDMACRO()
3843

config.h.cmake

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,6 @@
106106
#cmakedefine HAVE_LIBWRAP 1
107107
#cmakedefine HAVE_SYSTEMD 1
108108
#cmakedefine HAVE_CRC32_VPMSUM 1
109-
#cmakedefine HAVE_LIBNUMA 1
110109

111110
/* Does "struct timespec" have a "sec" and "nsec" field? */
112111
#cmakedefine HAVE_TIMESPEC_TS_SEC 1

storage/innobase/CMakeLists.txt

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ INCLUDE(lzo)
2424
INCLUDE(lzma)
2525
INCLUDE(bzip2)
2626
INCLUDE(snappy)
27+
INCLUDE(numa)
2728

2829
MYSQL_CHECK_LZ4()
2930
MYSQL_CHECK_LZO()
@@ -174,11 +175,6 @@ IF(WITH_INNODB)
174175
SET(WITH_INNOBASE_STORAGE_ENGINE TRUE)
175176
ENDIF()
176177

177-
UNSET(NUMA_LIBRARY)
178-
IF(HAVE_LIBNUMA)
179-
SET(NUMA_LIBRARY "numa")
180-
ENDIF()
181-
182178
MYSQL_ADD_PLUGIN(innobase ${INNOBASE_SOURCES} STORAGE_ENGINE
183179
# MODULE_ONLY
184180
# MODULE_OUTPUT_NAME ha_innodb

storage/xtradb/CMakeLists.txt

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ INCLUDE(lzo)
2323
INCLUDE(lzma)
2424
INCLUDE(bzip2)
2525
INCLUDE(snappy)
26+
INCLUDE(numa)
2627

2728
MYSQL_CHECK_LZ4()
2829
MYSQL_CHECK_LZO()
@@ -497,11 +498,6 @@ SET(INNOBASE_SOURCES
497498
ut/ut0wqueue.cc
498499
ut/ut0timer.cc)
499500

500-
UNSET(NUMA_LIBRARY)
501-
IF(HAVE_LIBNUMA)
502-
SET(NUMA_LIBRARY "numa")
503-
ENDIF()
504-
505501
MYSQL_ADD_PLUGIN(xtradb ${INNOBASE_SOURCES} STORAGE_ENGINE
506502
DISABLED # until upgraded to 5.7, see also mysql-test/include/have_xtradb.combinations
507503
RECOMPILE_FOR_EMBEDDED

0 commit comments

Comments
 (0)