1- cmake_minimum_required (VERSION 3.10 )
1+ cmake_minimum_required (VERSION 3.12 )
22list (APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR} /cmake" )
33include (FetchContent)
44
@@ -17,7 +17,7 @@ endif()
1717# Metall general configuration
1818# -------------------------------------------------------------------------------- #
1919project (Metall
20- VERSION 0.26
20+ VERSION 0.27
2121 DESCRIPTION "A persistent memory allocator for data-centric analytics"
2222 HOMEPAGE_URL "https://github.com/LLNL/metall" )
2323
@@ -82,33 +82,20 @@ option(JUST_INSTALL_METALL_HEADER "Just install Metall header files (do not buil
8282option (BUILD_UTILITY "Build utility programs" OFF )
8383option (BUILD_DOC "Build API documentation" OFF )
8484option (BUILD_C "Build C examples and libraries" OFF )
85- option (VERBOSE_SYSTEM_SUPPORT_WARNING "Show compile time warning regarding system support" OFF )
86- option (DISABLE_FREE_FILE_SPACE "Disable freeing file space" OFF )
87- option (DISABLE_SMALL_OBJECT_CACHE "Disable small object cache" OFF )
8885option (BUILD_EXAMPLE "Build the examples" OFF )
89- option (BUILD_BENCH "Build the benchmark" OFF )
9086option (BUILD_TEST "Build the test" OFF )
9187option (RUN_LARGE_SCALE_TEST "Run large scale tests" OFF )
9288option (RUN_BUILD_AND_TEST_WITH_CI "Perform build and basic test with CI" OFF )
93- option (BUILD_VERIFICATION "Build verification directory" OFF )
94- option (USE_SORTED_BIN "Use VM space aware algorithm in the bin directory" OFF )
95-
96- set (DEFAULT_VM_RESERVE_SIZE "0" CACHE STRING
97- "Set the default VM reserve size (use the internally defined value if 0 is specified)" )
98- set (MAX_SEGMENT_SIZE "0" CACHE STRING
99- "Set the max segment size (use the internally defined value if 0 is specified)" )
100- set (INITIAL_SEGMENT_SIZE "0" CACHE STRING
101- "Set the initial segment size (use the internally defined value if 0 is specified)" )
89+ option (BUILD_BENCH "Build the benchmark" OFF )
90+ option (BUILD_VERIFICATION "Build verification programs" OFF )
91+ set (COMPILER_DEFS "" CACHE STRING "A list of Metall compile definitions to be added to all targets" )
10292
10393# ---------- Experimental options ---------- #
104- option (USE_ANONYMOUS_NEW_MAP "Use the anonymous map when creating a new map region" OFF )
10594set (UMAP_ROOT "" CACHE PATH "UMap installed root directory" )
10695
10796option (ONLY_DOWNLOAD_GTEST "Only downloading Google Test" OFF )
10897option (SKIP_DOWNLOAD_GTEST "Skip downloading Google Test" OFF )
10998option (BUILD_NUMA "Build programs that require the NUMA policy library (numa.h)" OFF )
110- set (FREE_SMALL_OBJECT_SIZE_HINT "0" CACHE STRING
111- "Try to free the associated pages and file space when objects equal to or larger than that is deallocated" )
11299
113100# -------------------------------------------------------------------------------- #
114101
@@ -153,63 +140,6 @@ endif ()
153140# -------------------------------------------------------------------------------- #
154141# Executables
155142# -------------------------------------------------------------------------------- #
156- if (NOT CMAKE_BUILD_TYPE )
157- set (CMAKE_BUILD_TYPE Release)
158- message (STATUS "CMAKE_BUILD_TYPE is set as Release" )
159- endif ()
160-
161- # ---------- MPI ---------- #
162- find_package (MPI)
163-
164- # ---------- Configure Metall ---------- #
165- if (FREE_SMALL_OBJECT_SIZE_HINT GREATER 0)
166- list (APPEND METALL_DEFS "METALL_FREE_SMALL_OBJECT_SIZE_HINT=${FREE_SMALL_OBJECT_SIZE_HINT} " )
167- message (STATUS "Try to free space for objects >= ${FREE_SMALL_OBJECT_SIZE_HINT} bytes" )
168- endif ()
169-
170- if (VERBOSE_SYSTEM_SUPPORT_WARNING)
171- list (APPEND METALL_DEFS "METALL_VERBOSE_SYSTEM_SUPPORT_WARNING" )
172- message (STATUS "Show compile time warning regarding system support" )
173- endif ()
174-
175- if (DISABLE_FREE_FILE_SPACE)
176- list (APPEND METALL_DEFS "METALL_DISABLE_FREE_FILE_SPACE" )
177- message (STATUS "Disable freeing file space in Metall" )
178- endif ()
179-
180- if (DISABLE_SMALL_OBJECT_CACHE)
181- list (APPEND METALL_DEFS "METALL_DISABLE_OBJECT_CACHE" )
182- message (STATUS "Disable small object cache" )
183- endif ()
184-
185- if (DEFAULT_VM_RESERVE_SIZE GREATER 0)
186- list (APPEND METALL_DEFS "METALL_DEFAULT_VM_RESERVE_SIZE=${DEFAULT_VM_RESERVE_SIZE} " )
187- message (STATUS "METALL_DEFAULT_VM_RESERVE_SIZE=${DEFAULT_VM_RESERVE_SIZE} " )
188- endif ()
189-
190- if (MAX_SEGMENT_SIZE GREATER 0)
191- list (APPEND METALL_DEFS "METALL_MAX_SEGMENT_SIZE=${MAX_SEGMENT_SIZE} " )
192- message (STATUS "METALL_MAX_SEGMENT_SIZE=${MAX_SEGMENT_SIZE} " )
193- endif ()
194-
195- if (INITIAL_SEGMENT_SIZE GREATER 0)
196- list (APPEND METALL_DEFS "METALL_INITIAL_SEGMENT_SIZE=${INITIAL_SEGMENT_SIZE} " )
197- message (STATUS "METALL_INITIAL_SEGMENT_SIZE=${INITIAL_SEGMENT_SIZE} " )
198- endif ()
199-
200- if (USE_SORTED_BIN)
201- list (APPEND METALL_DEFS "METALL_USE_SORTED_BIN" )
202- message (STATUS "Use VM space aware algorithm in the bin directory" )
203- endif ()
204-
205- if (USE_ANONYMOUS_NEW_MAP)
206- if (USE_ANONYMOUS_NEW_MAP AND UMAP_ROOT)
207- message (FATAL_ERROR "USE_ANONYMOUS_NEW_MAP and UMAP_ROOT options cannot coexist" )
208- endif ()
209-
210- list (APPEND METALL_DEFS "METALL_USE_ANONYMOUS_NEW_MAP" )
211- message (STATUS "Use the anonymous map for new map region" )
212- endif ()
213143
214144# Requirements for GCC
215145if (NOT RUN_BUILD_AND_TEST_WITH_CI)
@@ -220,6 +150,18 @@ if (NOT RUN_BUILD_AND_TEST_WITH_CI)
220150 endif ()
221151endif ()
222152
153+ # ---------- Metall Macros ---------- #
154+ foreach (X ${COMPILER_DEFS} )
155+ message (STATUS "Metall compile definition: ${X} " )
156+ endforeach ()
157+
158+
159+ # ---------- CMAKE_BUILD_TYPE ---------- #
160+ if (NOT CMAKE_BUILD_TYPE )
161+ set (CMAKE_BUILD_TYPE Release)
162+ message (STATUS "CMAKE_BUILD_TYPE is set as Release" )
163+ endif ()
164+
223165
224166# ---------- Threads ---------- #
225167find_package (Threads REQUIRED)
@@ -304,8 +246,8 @@ function(common_setup_for_metall_executable name)
304246 # --------------------
305247
306248 # ----- Compile Definitions ----- #
307- foreach (X IN LISTS METALL_DEFS )
308- target_compile_definitions (${name} PRIVATE ${X} )
249+ foreach (X ${COMPILER_DEFS} )
250+ target_compile_definitions (${name} PRIVATE ${X} )
309251 endforeach ()
310252 # --------------------
311253
@@ -325,7 +267,7 @@ function(common_setup_for_metall_executable name)
325267 target_include_directories (${name} PRIVATE ${UMAP_ROOT} /include )
326268 if (LIBUMAP)
327269 target_link_libraries (${name} PRIVATE ${LIBUMAP} )
328- target_compile_definitions (${name} PRIVATE METALL_USE_UMAP)
270+ target_compile_definitions (${name} PRIVATE " METALL_USE_UMAP" )
329271 endif ()
330272 endif ()
331273 # --------------------
0 commit comments