Skip to content

Commit

Permalink
Merge pull request #310 from LLNL/feature/segment_storage
Browse files Browse the repository at this point in the history
Custom Storage
  • Loading branch information
KIwabuchi authored Jan 16, 2024
2 parents c57f0a6 + 08886d2 commit 3a0ae6f
Show file tree
Hide file tree
Showing 23 changed files with 2,044 additions and 1,199 deletions.
65 changes: 51 additions & 14 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ include(FetchContent)
# -------------------------------------------------------------------------------- #
# CMake policy
# -------------------------------------------------------------------------------- #
if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.13")
if (${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.13")
cmake_policy(SET CMP0077 NEW)
endif()
endif ()

if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.24")
if (${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.24")
cmake_policy(SET CMP0135 NEW)
endif()
endif ()

# -------------------------------------------------------------------------------- #
# Metall general configuration
Expand Down Expand Up @@ -92,6 +92,7 @@ set(COMPILER_DEFS "" CACHE STRING "A list of Metall compile definitions to be ad

# ---------- Experimental options ---------- #
set(UMAP_ROOT "" CACHE PATH "UMap installed root directory")
set(PRIVATEER_ROOT "" CACHE PATH "Privateer installed root directory")

option(ONLY_DOWNLOAD_GTEST "Only downloading Google Test" OFF)
option(SKIP_DOWNLOAD_GTEST "Skip downloading Google Test" OFF)
Expand All @@ -113,11 +114,11 @@ endif ()
# -------------------------------------------------------------------------------- #
if (INSTALL_HEADER_ONLY)
message(WARNING "INSTALL_HEADER_ONLY option has been replaced with JUST_INSTALL_METALL_HEADER.")
endif()
endif ()

if (JUST_INSTALL_METALL_HEADER)
return()
endif()
endif ()
# -------------------------------------------------------------------------------- #

# -------------------------------------------------------------------------------- #
Expand Down Expand Up @@ -151,9 +152,9 @@ if (NOT RUN_BUILD_AND_TEST_WITH_CI)
endif ()

# ---------- Metall Macros ---------- #
foreach(X ${COMPILER_DEFS})
foreach (X ${COMPILER_DEFS})
message(STATUS "Metall compile definition: ${X}")
endforeach()
endforeach ()


# ---------- CMAKE_BUILD_TYPE ---------- #
Expand Down Expand Up @@ -183,6 +184,11 @@ if (UMAP_ROOT)
endif ()
endif ()

# ---------- Privateer ---------- #
if (PRIVATEER_ROOT)
message(STATUS "Privateer Root is: ${PRIVATEER_ROOT}")
find_library(LIBPRIVATEER NAMES privateer PATHS ${PRIVATEER_ROOT}/lib)
endif ()

# ---------- Boost ---------- #
# Disable the boost-cmake feature (BoostConfig.cmake or boost-config.cmake) since
Expand Down Expand Up @@ -246,20 +252,20 @@ function(common_setup_for_metall_executable name)
# --------------------

# ----- Compile Definitions ----- #
foreach(X ${COMPILER_DEFS})
target_compile_definitions(${name} PRIVATE ${X})
endforeach()
foreach (X ${COMPILER_DEFS})
target_compile_definitions(${name} PRIVATE ${X})
endforeach ()
# --------------------

# ----- CXX17 Filesystem Lib----- #
# include_cxx_filesystem_library module must be executed first
if (FOUND_CXX17_FILESYSTEM_LIB)
if (REQUIRE_LIB_STDCXX_FS)
target_link_libraries(${name} PRIVATE stdc++fs)
endif()
elseif()
endif ()
elseif ()
target_compile_definitions(${name} PRIVATE "METALL_DISABLE_CXX17_FILESYSTEM_LIB")
endif()
endif ()
# --------------------

# ----- Umap----- #
Expand All @@ -271,6 +277,37 @@ function(common_setup_for_metall_executable name)
endif ()
endif ()
# --------------------

# ----- Privateer----- #
if (PRIVATEER_ROOT)
target_include_directories(${name} PRIVATE ${PRIVATEER_ROOT}/include)
if (LIBPRIVATEER)
# 1) Privateer Dependencies
FIND_PACKAGE(OpenSSL)
if (OpenSSL_FOUND)
target_link_libraries(${name} PRIVATE OpenSSL::SSL)
target_link_libraries(${name} PRIVATE OpenSSL::Crypto)
endif ()
target_link_libraries(${name} PRIVATE rt)
FIND_PACKAGE(OpenMP REQUIRED)
if (OpenMP_CXX_FOUND)
target_link_libraries(${name} PRIVATE OpenMP::OpenMP_CXX)
else ()
message(FATAL_ERROR "OpenMP is required to build Metall with Privateer")
endif ()
if (ZSTD_ROOT)
find_library(LIBZSTD NAMES zstd PATHS ${ZSTD_ROOT}/lib)
target_include_directories(${name} PRIVATE ${ZSTD_ROOT}/lib)
target_link_libraries(${name} PRIVATE ${LIBZSTD})
target_compile_definitions(${name} PRIVATE USE_COMPRESSION)
endif ()

# 2) Link Privateer
target_link_libraries(${name} PRIVATE ${LIBPRIVATEER})
target_compile_definitions(${name} PRIVATE METALL_USE_PRIVATEER)
endif ()
endif ()
# --------------------
endfunction()

function(add_metall_executable name source)
Expand Down
Loading

0 comments on commit 3a0ae6f

Please sign in to comment.