@@ -5,19 +5,19 @@ include(FetchContent)
5
5
# -------------------------------------------------------------------------------- #
6
6
# CMake policy
7
7
# -------------------------------------------------------------------------------- #
8
- if (${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.13" )
8
+ if (${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.13" )
9
9
cmake_policy (SET CMP0077 NEW )
10
- endif ()
10
+ endif ()
11
11
12
- if (${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.24" )
12
+ if (${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.24" )
13
13
cmake_policy (SET CMP0135 NEW )
14
- endif ()
14
+ endif ()
15
15
16
16
# -------------------------------------------------------------------------------- #
17
17
# Metall general configuration
18
18
# -------------------------------------------------------------------------------- #
19
19
project (Metall
20
- VERSION 0.27
20
+ VERSION 0.28
21
21
DESCRIPTION "A persistent memory allocator for data-centric analytics"
22
22
HOMEPAGE_URL "https://github.com/LLNL/metall" )
23
23
@@ -92,6 +92,7 @@ set(COMPILER_DEFS "" CACHE STRING "A list of Metall compile definitions to be ad
92
92
93
93
# ---------- Experimental options ---------- #
94
94
set (UMAP_ROOT "" CACHE PATH "UMap installed root directory" )
95
+ set (PRIVATEER_ROOT "" CACHE PATH "Privateer installed root directory" )
95
96
96
97
option (ONLY_DOWNLOAD_GTEST "Only downloading Google Test" OFF )
97
98
option (SKIP_DOWNLOAD_GTEST "Skip downloading Google Test" OFF )
@@ -113,11 +114,11 @@ endif ()
113
114
# -------------------------------------------------------------------------------- #
114
115
if (INSTALL_HEADER_ONLY )
115
116
message (WARNING "INSTALL_HEADER_ONLY option has been replaced with JUST_INSTALL_METALL_HEADER." )
116
- endif ()
117
+ endif ()
117
118
118
119
if (JUST_INSTALL_METALL_HEADER )
119
120
return ()
120
- endif ()
121
+ endif ()
121
122
# -------------------------------------------------------------------------------- #
122
123
123
124
# -------------------------------------------------------------------------------- #
@@ -138,7 +139,7 @@ endif ()
138
139
# -------------------------------------------------------------------------------- #
139
140
140
141
# -------------------------------------------------------------------------------- #
141
- #Executables
142
+ #Set up for building executables
142
143
# -------------------------------------------------------------------------------- #
143
144
144
145
# Requirements for GCC
@@ -151,9 +152,9 @@ if (NOT RUN_BUILD_AND_TEST_WITH_CI)
151
152
endif ()
152
153
153
154
# ---------- Metall Macros ---------- #
154
- foreach (X ${COMPILER_DEFS} )
155
+ foreach (X ${COMPILER_DEFS} )
155
156
message (STATUS "Metall compile definition:${X} " )
156
- endforeach ()
157
+ endforeach ()
157
158
158
159
159
160
# ---------- CMAKE_BUILD_TYPE ---------- #
@@ -168,12 +169,8 @@ find_package(Threads REQUIRED)
168
169
169
170
170
171
# ---------- filesystem ---------- #
171
- include (include_cxx_filesystem_library )
172
- include_cxx_filesystem_library ()
173
-
174
- # Xcode 11 Beta Release Notes
175
- # Clang now supports the C++17 <filesystem> library for iOS 13, macOS 10.15, watchOS 6, and tvOS 13. (50988273)
176
- # https://developer.apple.com/documentation/xcode_release_notes/xcode_11_beta_release_notes?language=objc
172
+ include (check_cxx_filesystem_library )
173
+ check_cxx_filesystem_library ()
177
174
178
175
179
176
# ---------- UMap ---------- #
@@ -183,6 +180,11 @@ if (UMAP_ROOT)
183
180
endif ()
184
181
endif ()
185
182
183
+ # ---------- Privateer ---------- #
184
+ if (PRIVATEER_ROOT )
185
+ message (STATUS "Privateer Root is:${PRIVATEER_ROOT} " )
186
+ find_library (LIBPRIVATEER NAMES privateer PATHS ${PRIVATEER_ROOT} /lib )
187
+ endif ()
186
188
187
189
# ---------- Boost ---------- #
188
190
# Disable the boost-cmake feature (BoostConfig.cmake or boost-config.cmake) since
@@ -192,7 +194,7 @@ set(Boost_NO_BOOST_CMAKE ON)
192
194
find_package (Boost 1.64 QUIET )
193
195
if (NOT Boost_FOUND )
194
196
FetchContent_Declare (Boost
195
- URL https://boostorg.jfrog.io/artifactory/main/release/1.78 .0/source/boost_1_78_0 .tar.bz2 )
197
+ URL https://boostorg.jfrog.io/artifactory/main/release/1.83 .0/source/boost_1_83_0 .tar.bz2 )
196
198
FetchContent_GetProperties (Boost )
197
199
if (NOT Boost_POPULATED )
198
200
FetchContent_Populate (Boost )
@@ -212,7 +214,7 @@ function(add_common_compile_options name)
212
214
target_compile_options (${name} PRIVATE $< $< CONFIG:Debug> :-Og> )
213
215
target_compile_options (${name} PRIVATE $< $< CONFIG:Debug> :-g3> )
214
216
target_compile_options (${name} PRIVATE $< $< CONFIG:Debug> :-Wextra> )
215
- if (Linux )
217
+ if (CMAKE_SYSTEM_NAME STREQUAL " Linux" )
216
218
target_compile_options (${name} PRIVATE $< $< CONFIG:Debug> :-pg> )
217
219
endif ()
218
220
@@ -223,7 +225,7 @@ function(add_common_compile_options name)
223
225
# Release with debug info
224
226
target_compile_options (${name} PRIVATE $< $< CONFIG:RelWithDebInfo> :-Ofast> )
225
227
target_compile_options (${name} PRIVATE $< $< CONFIG:RelWithDebInfo> :-g3> )
226
- if (Linux )
228
+ if (CMAKE_SYSTEM_NAME STREQUAL " Linux" )
227
229
target_compile_options (${name} PRIVATE $< $< CONFIG:RelWithDebInfo> :-pg> )
228
230
endif ()
229
231
endfunction ()
@@ -246,20 +248,18 @@ function(common_setup_for_metall_executable name)
246
248
# --------------------
247
249
248
250
# ----- Compile Definitions ----- #
249
- foreach (X ${COMPILER_DEFS} )
250
- target_compile_definitions (${name} PRIVATE ${X} )
251
- endforeach ()
251
+ foreach (X ${COMPILER_DEFS} )
252
+ target_compile_definitions (${name} PRIVATE ${X} )
253
+ endforeach ()
252
254
# --------------------
253
255
254
256
# ----- CXX17 Filesystem Lib----- #
255
- #include_cxx_filesystem_library module must be executed first
256
- if (FOUND_CXX17_FILESYSTEM_LIB )
257
- if (REQUIRE_LIB_STDCXX_FS )
257
+ #GNU compilers prior to 9.1 requires linking with stdc++fs
258
+ if (( " ${CMAKE_C_COMPILER_ID} " STREQUAL "GNU" ) OR ( " ${CMAKE_CXX_COMPILER_ID} " STREQUAL "GNU" ) )
259
+ if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9.1 )
258
260
target_link_libraries (${name} PRIVATE stdc++fs )
259
- endif ()
260
- elseif ()
261
- target_compile_definitions (${name} PRIVATE "METALL_DISABLE_CXX17_FILESYSTEM_LIB" )
262
- endif ()
261
+ endif ()
262
+ endif ()
263
263
# --------------------
264
264
265
265
# ----- Umap----- #
@@ -271,6 +271,37 @@ function(common_setup_for_metall_executable name)
271
271
endif ()
272
272
endif ()
273
273
# --------------------
274
+
275
+ # ----- Privateer----- #
276
+ if (PRIVATEER_ROOT )
277
+ target_include_directories (${name} PRIVATE ${PRIVATEER_ROOT} /include )
278
+ if (LIBPRIVATEER )
279
+ # 1) Privateer Dependencies
280
+ FIND_PACKAGE (OpenSSL )
281
+ if (OpenSSL_FOUND )
282
+ target_link_libraries (${name} PRIVATE OpenSSL::SSL )
283
+ target_link_libraries (${name} PRIVATE OpenSSL::Crypto )
284
+ endif ()
285
+ target_link_libraries (${name} PRIVATE rt )
286
+ FIND_PACKAGE (OpenMP REQUIRED )
287
+ if (OpenMP_CXX_FOUND )
288
+ target_link_libraries (${name} PRIVATE OpenMP::OpenMP_CXX )
289
+ else ()
290
+ message (FATAL_ERROR "OpenMP is required to build Metall with Privateer" )
291
+ endif ()
292
+ if (ZSTD_ROOT )
293
+ find_library (LIBZSTD NAMES zstd PATHS ${ZSTD_ROOT} /lib )
294
+ target_include_directories (${name} PRIVATE ${ZSTD_ROOT} /lib )
295
+ target_link_libraries (${name} PRIVATE ${LIBZSTD} )
296
+ target_compile_definitions (${name} PRIVATE USE_COMPRESSION )
297
+ endif ()
298
+
299
+ # 2) Link Privateer
300
+ target_link_libraries (${name} PRIVATE ${LIBPRIVATEER} )
301
+ target_compile_definitions (${name} PRIVATE METALL_USE_PRIVATEER )
302
+ endif ()
303
+ endif ()
304
+ # --------------------
274
305
endfunction ()
275
306
276
307
function (add_metall_executable name source )