Skip to content
This repository was archived by the owner on Dec 19, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,10 @@ CMakeDoxyfile.in
CMakeDoxygenDefaults.cmake
DartConfiguration.tcl
__pycache__
/.vscode
/.devcontainer
*.dSYM
testbracket
testmvmap
testdf
testgraph
106 changes: 106 additions & 0 deletions CM-broken.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
# Copyright 2020 Lawrence Livermore National Security, LLC and other CLIPPy
# Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: MIT

# Works with 3.11 and tested through 3.15 (not tested yet)
cmake_minimum_required(VERSION 3.14)
set(ALLOW_DUPLICATE_CUSTOM_TARGETS TRUE)

project(CLIPPy
VERSION 0.2
DESCRIPTION "Command Line Interface Plus Python"
LANGUAGES CXX)

include(FetchContent)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

# Only do these if this is the main project, and not if it is included through add_subdirectory
if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)

set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

# Let's ensure -std=c++xx instead of -std=g++xx
set(CMAKE_CXX_EXTENSIONS OFF)

# Let's nicely support folders in IDE's
set_property(GLOBAL PROPERTY USE_FOLDERS ON)

# Testing only available if this is the main app
# Note this needs to be done in the main CMakeLists
# since it calls enable_testing, which must be in the
# main CMakeLists.
include(CTest)

# Docs only available if this is the main app
find_package(Doxygen)
if(Doxygen_FOUND)
#add_subdirectory(docs)
else()
message(STATUS "Doxygen not found, not building docs")
endif()
endif()

#
# Metall
# find_package(Metall QUIET)
# if (NOT Metall_FOUND)
# #set(METALL_WORK_DIR ${CMAKE_CURRENT_BINARY_DIR}/metall-work)
# set(METALL_SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR}/metall-src)
# set(METALL_BUILD_DIR ${CMAKE_CURRENT_BINARY_DIR}/metall-build)
# set(METALL_INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}/metall-install)
# FetchContent_Declare(Metall
# GIT_REPOSITORY https://github.com/LLNL/metall.git
# GIT_TAG master
# )
# # SOURCE_DIR ${METALL_SOURCE_DIR}
# # BINARY_DIR ${METALL_BUILD_DIR}
# # CMAKE_ARGS -DINSTALL_HEADER_ONLY=ON -DCMAKE_INSTALL_PREFIX=${METALL_INSTALL_DIR}
# # )
# # set(METALL_INCLUDE_DIR ${METALL_INSTALL_DIR}/include)
# FetchContent_MakeAvailable(Metall)
# endif ()

# find_package(Threads REQUIRED)


#
# Boost
# find_package(Boost 1.83 REQUIRED COMPONENTS)

include(FetchContent)

# Fetch Boost
FetchContent_Declare(
boost
GIT_REPOSITORY https://github.com/boostorg/boost.git
GIT_TAG boost-1.83.0 # Replace with the desired Boost version
GIT_PROGRESS TRUE
)
FetchContent_MakeAvailable(boost)

# Ensure submodules for Boost.JSON are initialized
add_subdirectory(${boost_SOURCE_DIR}/libs/json ${boost_BINARY_DIR}/boost-json)


### Require out-of-source builds
file(TO_CMAKE_PATH "${PROJECT_BINARY_DIR}/CMakeLists.txt" LOC_PATH)
if(EXISTS "${LOC_PATH}")
message(FATAL_ERROR "You cannot build in a source directory (or any directory with a CMakeLists.txt file). Please make a build subdirectory. Feel free to remove CMakeCache.txt and CMakeFiles.")
endif()

include_directories("${PROJECT_SOURCE_DIR}/include")

option(TEST_WITH_SLURM "Run tests with Slurm" OFF)

# Header-only library, so likely not have src dir
# add_subdirectory(src)

# Testing & examples are only available if this is the main app
# Emergency override MODERN_CMAKE_BUILD_TESTING provided as well
if((CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME OR MODERN_CMAKE_BUILD_TESTING) AND BUILD_TESTING)
add_subdirectory(test)
# Example codes are here.
#add_subdirectory(examples)
endif()
109 changes: 109 additions & 0 deletions CM-working.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
# Copyright 2020 Lawrence Livermore National Security, LLC and other CLIPPy
# Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: MIT

# Works with 3.11 and tested through 3.15 (not tested yet)
cmake_minimum_required(VERSION 3.14)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
set(ALLOW_DUPLICATE_CUSTOM_TARGETS TRUE)

project(CLIPPy
VERSION 0.2
DESCRIPTION "Command Line Interface Plus Python"
LANGUAGES CXX)

include(FetchContent)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

# Only do these if this is the main project, and not if it is included through add_subdirectory
if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)

set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

# Let's ensure -std=c++xx instead of -std=g++xx
set(CMAKE_CXX_EXTENSIONS OFF)

# Let's nicely support folders in IDE's
set_property(GLOBAL PROPERTY USE_FOLDERS ON)

# Testing only available if this is the main app
# Note this needs to be done in the main CMakeLists
# since it calls enable_testing, which must be in the
# main CMakeLists.
include(CTest)

# Docs only available if this is the main app
find_package(Doxygen)
if(Doxygen_FOUND)
#add_subdirectory(docs)
else()
message(STATUS "Doxygen not found, not building docs")
endif()
endif()

#
# Metall
# find_package(Metall QUIET)
# if (NOT Metall_FOUND)
# #set(METALL_WORK_DIR ${CMAKE_CURRENT_BINARY_DIR}/metall-work)
# set(METALL_SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR}/metall-src)
# set(METALL_BUILD_DIR ${CMAKE_CURRENT_BINARY_DIR}/metall-build)
# set(METALL_INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}/metall-install)
# FetchContent_Declare(Metall
# GIT_REPOSITORY https://github.com/LLNL/metall.git
# GIT_TAG master
# )
# # SOURCE_DIR ${METALL_SOURCE_DIR}
# # BINARY_DIR ${METALL_BUILD_DIR}
# # CMAKE_ARGS -DINSTALL_HEADER_ONLY=ON -DCMAKE_INSTALL_PREFIX=${METALL_INSTALL_DIR}
# # )
# # set(METALL_INCLUDE_DIR ${METALL_INSTALL_DIR}/include)
# FetchContent_MakeAvailable(Metall)
# endif ()

# find_package(Threads REQUIRED)


#
# Boost
# find_package(Boost 1.83 REQUIRED COMPONENTS)

#
# Boost
include(setup_boost)
prepare_fetchcontent_boost()
set(FETCHCONTENT_QUIET FALSE)
FetchContent_Declare(
Boost
GIT_REPOSITORY https://github.com/boostorg/boost.git
GIT_TAG boost-1.83.0
GIT_SUBMODULES ${BOOST_REQD_SUBMODULES}
GIT_PROGRESS TRUE
CONFIGURE_COMMAND "" # tell CMake it's not a cmake project
)
FetchContent_MakeAvailable(Boost)
get_boost_include_dirs()


### Require out-of-source builds
file(TO_CMAKE_PATH "${PROJECT_BINARY_DIR}/CMakeLists.txt" LOC_PATH)
if(EXISTS "${LOC_PATH}")
message(FATAL_ERROR "You cannot build in a source directory (or any directory with a CMakeLists.txt file). Please make a build subdirectory. Feel free to remove CMakeCache.txt and CMakeFiles.")
endif()

include_directories("${PROJECT_SOURCE_DIR}/include")

option(TEST_WITH_SLURM "Run tests with Slurm" OFF)

# Header-only library, so likely not have src dir
# add_subdirectory(src)

# Testing & examples are only available if this is the main app
# Emergency override MODERN_CMAKE_BUILD_TESTING provided as well
if((CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME OR MODERN_CMAKE_BUILD_TESTING) AND BUILD_TESTING)
add_subdirectory(test)
# Example codes are here.
#add_subdirectory(examples)
endif()
22 changes: 20 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

# Works with 3.11 and tested through 3.15 (not tested yet)
cmake_minimum_required(VERSION 3.14)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
set(ALLOW_DUPLICATE_CUSTOM_TARGETS TRUE)

project(CLIPPy
Expand All @@ -18,7 +19,7 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
# Only do these if this is the main project, and not if it is included through add_subdirectory
if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

# Let's ensure -std=c++xx instead of -std=g++xx
Expand Down Expand Up @@ -67,7 +68,24 @@ endif()

#
# Boost
find_package(Boost 1.75 REQUIRED COMPONENTS)
# find_package(Boost 1.83 REQUIRED COMPONENTS)

#
# Boost
include(setup_boost)
prepare_fetchcontent_boost()
set(FETCHCONTENT_QUIET FALSE)
FetchContent_Declare(
Boost
GIT_REPOSITORY https://github.com/boostorg/boost.git
GIT_TAG boost-1.83.0
GIT_SUBMODULES ${BOOST_REQD_SUBMODULES}
GIT_PROGRESS TRUE
CONFIGURE_COMMAND "" # tell CMake it's not a cmake project
)
FetchContent_MakeAvailable(Boost)
get_boost_include_dirs()


### Require out-of-source builds
file(TO_CMAKE_PATH "${PROJECT_BINARY_DIR}/CMakeLists.txt" LOC_PATH)
Expand Down
83 changes: 83 additions & 0 deletions cmake/setup_boost.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
function(prepare_fetchcontent_boost)
set(BOOST_INCLUDE_LIBRARIES json PARENT_SCOPE)
set(BOOST_ENABLE_CMAKE ON PARENT_SCOPE)

set(BOOST_REQD_SUBMODULES
"tools/cmake;"
"libs/assert;"
"libs/exception;"
"libs/throw_exception;"
"libs/static_assert;"
"libs/config;"
"libs/container;"
"libs/container_hash;"
"libs/utility;"
"libs/type_traits;"
"libs/move;"
"libs/tuple;"
"libs/variant2;"
"libs/detail;"
"libs/smart_ptr;"
"libs/integer;"
"libs/intrusive;"
"libs/io;"
# "libs/iostreams;"
"libs/describe;"
"libs/core;"
"libs/align;"
"libs/predef;"
"libs/preprocessor;"
"libs/system;"
"libs/winapi;"
"libs/mp11;"
"libs/json;"
# "libs/property_tree;"
# "libs/interprocess;"
# "libs/optional;"
# "libs/any;"
# "libs/type_index;"
# "libs/mpl;"
# "libs/multi_index;"
# "libs/serialization;"
# "libs/bind;"
# "libs/foreach;"
# "libs/iterator;"
# "libs/headers;"
# "libs/format;"
# "libs/range;"
# "libs/concept_check;"
# "libs/uuid;"
# "libs/random;"
# "libs/tti;"
# "libs/function_types;"
PARENT_SCOPE)
endfunction()

function(get_boost_include_dirs)
list(APPEND BOOST_INCLUDE_DIRS
# ${Boost_SOURCE_DIR}/libs/interprocess/include
# ${Boost_SOURCE_DIR}/libs/property_tree/include
# ${Boost_SOURCE_DIR}/libs/optional/include
# ${Boost_SOURCE_DIR}/libs/any/include
# ${Boost_SOURCE_DIR}/libs/type_index/include
# ${Boost_SOURCE_DIR}/libs/mpl/include
# ${Boost_SOURCE_DIR}/libs/bind/include
# ${Boost_SOURCE_DIR}/libs/multi_index/include
# ${Boost_SOURCE_DIR}/libs/serialization/include
# ${Boost_SOURCE_DIR}/libs/foreach/include
# ${Boost_SOURCE_DIR}/libs/iterator/include
${Boost_SOURCE_DIR}/libs/container/include
# ${Boost_SOURCE_DIR}/libs/unordered/include
# ${Boost_SOURCE_DIR}/libs/iostreams/include
${Boost_SOURCE_DIR}/libs/system/include
${Boost_SOURCE_DIR}/libs/describe/include
# ${Boost_SOURCE_DIR}/libs/format/include
# ${Boost_SOURCE_DIR}/libs/range/include
# ${Boost_SOURCE_DIR}/libs/concept_check/include
# ${Boost_SOURCE_DIR}/libs/uuid/include
# ${Boost_SOURCE_DIR}/libs/random/include
# ${Boost_SOURCE_DIR}/libs/tti/include
# ${Boost_SOURCE_DIR}/libs/function_types/include
)
set(BOOST_INCLUDE_DIRS ${BOOST_INCLUDE_DIRS} PARENT_SCOPE)
endfunction()
Loading
Loading