Skip to content

Commit

Permalink
Merge pull request #339 from LLNL/release/v0.29
Browse files Browse the repository at this point in the history
Release/v0.29
  • Loading branch information
KIwabuchi authored Nov 22, 2024
2 parents 1f6c027 + d52cd7f commit df60411
Show file tree
Hide file tree
Showing 30 changed files with 506 additions and 448 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/ci-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: CI Test
on: [push, pull_request]

jobs:
bst1-82-0:
bst1-86-0:
runs-on: ubuntu-latest
env:
METALL_LIMIT_MAKE_PARALLELS: 8
Expand All @@ -12,9 +12,9 @@ jobs:
- name: Test
run: |
pushd /dev/shm
wget -q https://boostorg.jfrog.io/artifactory/main/release/1.82.0/source/boost_1_82_0.tar.gz
wget -q https://boostorg.jfrog.io/artifactory/main/release/1.86.0/source/boost_1_86_0.tar.gz
mkdir boost
tar xf boost_1_82_0.tar.gz -C boost --strip-components 1
tar xf boost_1_86_0.tar.gz -C boost --strip-components 1
export BOOST_ROOT=${PWD}/boost
popd
export METALL_TEST_DIR=${GITHUB_JOB}
Expand All @@ -23,7 +23,7 @@ jobs:
cd $GITHUB_WORKSPACE
bash ./scripts/CI/build_and_test.sh
bst1-64-0:
bst1-80-0:
runs-on: ubuntu-latest
env:
METALL_LIMIT_MAKE_PARALLELS: 8
Expand All @@ -32,9 +32,9 @@ jobs:
- name: Test
run: |
pushd /dev/shm
wget -q https://boostorg.jfrog.io/artifactory/main/release/1.64.0/source/boost_1_64_0.tar.gz
wget -q https://boostorg.jfrog.io/artifactory/main/release/1.80.0/source/boost_1_80_0.tar.gz
mkdir boost
tar xf boost_1_64_0.tar.gz -C boost --strip-components 1
tar xf boost_1_80_0.tar.gz -C boost --strip-components 1
export BOOST_ROOT=${PWD}/boost
popd
export METALL_TEST_DIR=${GITHUB_JOB}
Expand Down
120 changes: 21 additions & 99 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,29 @@
# Spack must be available
# It would be better to install all Boost versions manually,
# as it causes errors often and could exceed the timelimit of the system.
#
# One might want to change the location of builds directory on LC clusters to avoid consuming the home directory space.
# Type the following command on an LC cluster:
# $ ln -s /usr/workspace/lc-username ~/.gitlab-runner

include: [component: $CI_SERVER_FQDN/lc-components/id_tokens/id_tokens-component@main]

stages:
- install
- build


variables:
CUSTOM_CI_BUILDS_DIR: "/usr/workspace/$$USER/metall-ci-runner-builds-dir"
GTEST_COLOR: "1"
GIT_DEPTH: 0
# CI_DEBUG_TRACE: "true" # Enable this when debugging this CI


install_boost:
stage: install
tags:
- quartz
- ruby
- shell
script:
- hostname
- srun -N1 -ppdebug spack install boost@1.82.0 boost@1.81.0 boost@1.80.0 boost@1.79.0 boost@1.78.0 boost@1.77.0 boost@1.76.0 [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected].0
- srun -N1 -ppci spack install boost@1.86.0 boost@1.85.0 boost@1.84.0 boost@1.83.0 boost@1.82.0 boost@1.81.0 boost@1.80.0
- spack clean


Expand All @@ -39,124 +39,46 @@ install_boost:
- module load gcc/${GCC_VERSION}
- spack load --first boost@${BOOST_VERSION} arch=$(spack arch)
- export METALL_TEST_DIR="/dev/shm/metall_test-${CI_CONCURRENT_ID}-${CI_PIPELINE_IID}"
- srun -N1 -ppdebug bash ./scripts/CI/build_and_test.sh

build_gcc12.1.1_bst1.82.0:
extends: .build
variables:
GCC_VERSION: "12.1.1"
BOOST_VERSION: "1.82.0"

build_gcc12.1.1_bst1.81.0:
extends: .build
variables:
GCC_VERSION: "12.1.1"
BOOST_VERSION: "1.81.0"

build_gcc12.1.1_bst1.80.0:
extends: .build
variables:
GCC_VERSION: "12.1.1"
BOOST_VERSION: "1.80.0"
- srun -N1 -ppci bash ./scripts/CI/build_and_test.sh

build_gcc12.1.1_bst1.79.0:
build_gcc12.1.1_bst1.86.0:
extends: .build
variables:
GCC_VERSION: "12.1.1"
BOOST_VERSION: "1.79.0"
BOOST_VERSION: "1.86.0"

build_gcc12.1.1_bst1.78.0:
build_gcc12.1.1_bst1.85.0:
extends: .build
variables:
GCC_VERSION: "12.1.1"
BOOST_VERSION: "1.78.0"
BOOST_VERSION: "1.85.0"

build_gcc12.1.1_bst1.77.0:
build_gcc12.1.1_bst1.84.0:
extends: .build
variables:
GCC_VERSION: "12.1.1"
BOOST_VERSION: "1.77.0"
BOOST_VERSION: "1.84.0"

build_gcc12.1.1_bst1.76.0:
build_gcc12.1.1_bst1.83.0:
extends: .build
variables:
GCC_VERSION: "12.1.1"
BOOST_VERSION: "1.76.0"
BOOST_VERSION: "1.83.0"

build_gcc12.1.1_bst1.75.0:
extends: .build
variables:
GCC_VERSION: "12.1.1"
BOOST_VERSION: "1.75.0"

build_gcc12.1.1_bst1.74.0:
extends: .build
variables:
GCC_VERSION: "12.1.1"
BOOST_VERSION: "1.74.0"

build_gcc12.1.1_bst1.73.0:
extends: .build
variables:
GCC_VERSION: "12.1.1"
BOOST_VERSION: "1.73.0"

build_gcc12.1.1_bst1.72.0:
extends: .build
variables:
GCC_VERSION: "12.1.1"
BOOST_VERSION: "1.72.0"

build_gcc12.1.1_bst1.71.0:
extends: .build
variables:
GCC_VERSION: "12.1.1"
BOOST_VERSION: "1.71.0"

build_gcc12.1.1_bst1.70.0:
extends: .build
variables:
GCC_VERSION: "12.1.1"
BOOST_VERSION: "1.70.0"

build_gcc12.1.1_bst1.69.0:
extends: .build
variables:
GCC_VERSION: "12.1.1"
BOOST_VERSION: "1.69.0"

build_gcc12.1.1_bst1.68.0:
extends: .build
variables:
GCC_VERSION: "12.1.1"
BOOST_VERSION: "1.68.0"

build_gcc12.1.1_bst1.67.0:
extends: .build
variables:
GCC_VERSION: "12.1.1"
BOOST_VERSION: "1.67.0"

build_gcc12.1.1_bst1.66.0:
extends: .build
variables:
GCC_VERSION: "12.1.1"
BOOST_VERSION: "1.66.0"

build_gcc12.1.1_bst1.65.1:
build_gcc12.1.1_bst1.82.0:
extends: .build
variables:
GCC_VERSION: "12.1.1"
BOOST_VERSION: "1.65.1"
BOOST_VERSION: "1.82.0"

build_gcc12.1.1_bst1.65.0:
build_gcc12.1.1_bst1.81.0:
extends: .build
variables:
GCC_VERSION: "12.1.1"
BOOST_VERSION: "1.65.0"
BOOST_VERSION: "1.81.0"

build_gcc12.1.1_bst1.64.0:
build_gcc12.1.1_bst1.80.0:
extends: .build
variables:
GCC_VERSION: "12.1.1"
BOOST_VERSION: "1.64.0"
BOOST_VERSION: "1.80.0"
32 changes: 21 additions & 11 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,29 @@ if (${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.13")
cmake_policy(SET CMP0077 NEW)
endif ()

# When using the URL download method with the ExternalProject_Add() or
# FetchContent_Declare() commands, sets the timestamps of extracted contents
# to the time of extraction.
if (${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.24")
cmake_policy(SET CMP0135 NEW)
endif ()

# Accept <PACKAGENAME>_ROOT variables for find_package() command.
if (${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.27")
cmake_policy(SET CMP0144 NEW)
endif ()

# find_package(Boost) to search for the upstream BoostConfig.cmake.
# Disable CMake's FindBoost module.
if (${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.30")
cmake_policy(SET CMP0167 NEW)
endif ()

# -------------------------------------------------------------------------------- #
# Metall general configuration
# -------------------------------------------------------------------------------- #
project(Metall
VERSION 0.28
VERSION 0.29
DESCRIPTION "A persistent memory allocator for data-centric analytics"
HOMEPAGE_URL "https://github.com/LLNL/metall")

Expand Down Expand Up @@ -82,6 +96,7 @@ option(JUST_INSTALL_METALL_HEADER "Just install Metall header files (do not buil
option(BUILD_UTILITY "Build utility programs" OFF)
option(BUILD_DOC "Build API documentation" OFF)
option(BUILD_C "Build C examples and libraries" OFF)
option(BUILD_SHARED_LIBS "Generate shared libraries" OFF)
option(BUILD_EXAMPLE "Build the examples" OFF)
option(BUILD_TEST "Build the test" OFF)
option(RUN_LARGE_SCALE_TEST "Run large scale tests" OFF)
Expand Down Expand Up @@ -187,20 +202,15 @@ if (PRIVATEER_ROOT)
endif ()

# ---------- Boost ---------- #
# Disable the boost-cmake feature (BoostConfig.cmake or boost-config.cmake) since
# there is a tricky behavior/issue especially in Boost 1.70.0.
set(Boost_NO_BOOST_CMAKE ON)

find_package(Boost 1.64 QUIET)
include(find_boost_headers)
find_boost_headers(1.80 FALSE)
if (NOT Boost_FOUND)
message(STATUS "Fetching Boost")
FetchContent_Declare(Boost
URL https://boostorg.jfrog.io/artifactory/main/release/1.83.0/source/boost_1_83_0.tar.bz2)
FetchContent_GetProperties(Boost)
if (NOT Boost_POPULATED)
FetchContent_Populate(Boost)
endif ()
FetchContent_MakeAvailable(Boost)
set(BOOST_ROOT ${boost_SOURCE_DIR})
find_package(Boost 1.64)
find_package(Boost 1.80 REQUIRED)
endif ()

# -------------------------------------------------------------------------------- #
Expand Down
13 changes: 5 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,8 @@ All core files exist under

## Required

- Boost C++ Libraries 1.64 or more.
- Boost C++ Libraries 1.80 or more.
- Build is not required; needs only their header files.
- To use JSON containers in Metall, Boost C++ Libraries 1.75 or more is required.
- C++17 compiler
- Tested with GCC 8.1 or more; however, 8.3 or more is recommended due to early implementation of the C++ Filesystem library.

Expand All @@ -45,11 +44,11 @@ To build your program with Metall, all you have to do is just setting include pa
For example,

```bash
# Download Boost (Boost C++ Libraries 1.64 or more is required)
# Download Boost (Boost C++ Libraries 1.80 or more is required)
# One can skip this step if Boost is already available.
wget https://boostorg.jfrog.io/artifactory/main/release/1.78.0/source/boost_1_78_0.tar.gz
tar xvf boost_1_78_0.tar.gz
export BOOST_ROOT=$PWD/boost_1_78_0
wget https://boostorg.jfrog.io/artifactory/main/release/1.80.0/source/boost_1_80_0.tar.gz
tar xvf boost_1_80_0.tar.gz
export BOOST_ROOT=$PWD/boost_1_80_0

git clone https://github.com/LLNL/metall
export METALL_INCLUDE=$PWD/metall/include
Expand All @@ -60,8 +59,6 @@ g++ -std=c++17 your_program.cpp -lstdc++fs -I${BOOST_ROOT} -I${METALL_INCLUDE}
### Unofficial Support For Clang
Clang can be used instead of GCC to build Metall.
However, we haven't tested it intensively.
Also, Boost C++ Libraries 1.69 or more may be required
if one wants to build Metall with Clang + CUDA.

## Package Manager Support

Expand Down
8 changes: 0 additions & 8 deletions cmake/check_cxx_filesystem_library.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,6 @@ function(check_cxx_filesystem_library)
set(FOUND_CXX17_FILESYSTEM_LIB FALSE PARENT_SCOPE)
set(REQUIRE_LIB_STDCXX_FS FALSE PARENT_SCOPE)

# Check if C++17 <filesystem> header files are available
# If not, uses our own implementation.
include(CheckIncludeFileCXX)
CHECK_INCLUDE_FILE_CXX(filesystem FOUND_FILESYSTEM_HEADER)
if (NOT FOUND_FILESYSTEM_HEADER)
message(FATAL_ERROR "Cannot find the C++17 <filesystem> library.")
endif ()

if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") # Clang or AppleClang
if (${CMAKE_HOST_SYSTEM_NAME} MATCHES "Darwin") # macOS
include(get_macos_version)
Expand Down
60 changes: 60 additions & 0 deletions cmake/find_boost_headers.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Find Boost header files
# Input:
# min_version - minimum required Boost version
# required - if TRUE, the function will stop the build if Boost headers are not found
#
# This function first tries to find Boost headers using the find_package() command.
# If Boost headers are not found, the function tries to find Boost headers manually.
# In the case, the following variables as hints to find Boost headers, in the following order:
# BOOST_ROOT CMake variable, Boost_ROOT CMake variable, BOOST_ROOT environment variable, Boost_ROOT environment variable
#
# Output:
# Boost_FOUND - TRUE if Boost headers are found
# Boost_INCLUDE_DIRS - Boost header files directory
# Boost_VERSION - Boost version
function(find_boost_headers min_version required)
find_package(Boost ${min_version})
if (Boost_FOUND)
set(Boost_INCLUDE_DIRS ${Boost_INCLUDE_DIRS} PARENT_SCOPE)
set(Boost_FOUND ${Boost_FOUND} PARENT_SCOPE)
return()
endif ()

message(STATUS "Could not find Boost headers using the find_package() command. Trying to find Boost headers manually.")

# Try to find Boost headers manually using the BOOST_ROOT as a hint
find_path(Boost_INCLUDE_DIRS boost/version.hpp PATHS ${BOOST_ROOT} ${Boost_ROOT} $ENV{BOOST_ROOT} $ENV{Boost_ROOT} NO_DEFAULT_PATH)
if (Boost_INCLUDE_DIRS)

# Extract Boost version value from the boost/version.hpp file
file(STRINGS ${Boost_INCLUDE_DIRS}/boost/version.hpp _boost_version REGEX "#define BOOST_VERSION[ \t]+[0-9]+")
string(REGEX REPLACE "#define BOOST_VERSION[ \t]+([0-9]+)" "\\1" Boost_VERSION ${_boost_version})

# Convert Boost version to the format 'MAJOR.MINOR.PATCH'
# Major version
math(EXPR Boost_VERSION_MAJOR "${Boost_VERSION} / 100000")
# Minor version
math(EXPR Boost_VERSION_MINOR "(${Boost_VERSION} / 100) % 1000")
# Patch version
math(EXPR Boost_VERSION_PATCH "${Boost_VERSION} % 100")
set(Boost_VERSION "${Boost_VERSION_MAJOR}.${Boost_VERSION_MINOR}.${Boost_VERSION_PATCH}")

if (${Boost_VERSION} VERSION_GREATER_EQUAL ${min_version})
message(STATUS "Found Boost headers at ${Boost_INCLUDE_DIRS}")
message(STATUS "Boost version: ${Boost_VERSION}")
set(Boost_FOUND TRUE PARENT_SCOPE)
set(Boost_INCLUDE_DIRS ${Boost_INCLUDE_DIRS} PARENT_SCOPE)
set(Boost_VERSION ${Boost_VERSION} PARENT_SCOPE)
return()
else ()
message(WARNING "Found an old Boost version '${Boost_VERSION}'. Required version is '${min_version}'.")
endif ()
endif ()

# Not found
set(Boost_FOUND FALSE PARENT_SCOPE)
if (required)
message(FATAL_ERROR "Could not find Boost headers")
endif ()

endfunction()
Loading

0 comments on commit df60411

Please sign in to comment.