From 7175daa4f2742022b52d8f61c952aaa629070faa Mon Sep 17 00:00:00 2001 From: Jacob Domagala Date: Fri, 28 Jun 2024 00:33:30 +0200 Subject: [PATCH] #2309: Use magistrate in cmake files instead of checkpoing --- ci/build_cpp.sh | 10 +++++----- ci/ctest_build_all.sh | 8 ++++---- ci/ctest_job_script.cmake | 2 +- cmake/link_vt.cmake | 2 +- cmake/load_local_packages.cmake | 4 ++-- cmake/local_package.cmake | 4 ++-- cmake/vtConfig.cmake.in | 10 ++++++---- 7 files changed, 21 insertions(+), 19 deletions(-) diff --git a/ci/build_cpp.sh b/ci/build_cpp.sh index 92c8a28e75..76e405ddb5 100755 --- a/ci/build_cpp.sh +++ b/ci/build_cpp.sh @@ -83,13 +83,13 @@ else else git clone -b "${checkpoint_rev}" --depth 1 https://github.com/DARMA-tasking/checkpoint.git export CHECKPOINT=$PWD/checkpoint - export CHECKPOINT_BUILD=${build_dir}/checkpoint - mkdir -p "$CHECKPOINT_BUILD" - cd "$CHECKPOINT_BUILD" + export MAGISTRATE_BUILD=${build_dir}/checkpoint + mkdir -p "$MAGISTRATE_BUILD" + cd "$MAGISTRATE_BUILD" mkdir build cd build cmake -G "${CMAKE_GENERATOR:-Ninja}" \ - -DCMAKE_INSTALL_PREFIX="$CHECKPOINT_BUILD/install" \ + -DCMAKE_INSTALL_PREFIX="$MAGISTRATE_BUILD/install" \ -Dkokkos_DIR="$KOKKOS_INSTALL" \ "$CHECKPOINT" cmake --build . ${dashj} --target install @@ -143,7 +143,7 @@ cmake -G "${CMAKE_GENERATOR:-Ninja}" \ -DCMAKE_CXX_COMPILER="${CXX:-c++}" \ -DCMAKE_C_COMPILER="${CC:-cc}" \ -DCMAKE_EXE_LINKER_FLAGS="${CMAKE_EXE_LINKER_FLAGS:-}" \ - -Dcheckpoint_ROOT="$CHECKPOINT_BUILD/install" \ + -Dmagistrate_ROOT="$MAGISTRATE_BUILD/install" \ -DCMAKE_PREFIX_PATH="${CMAKE_PREFIX_PATH:-}" \ -DCMAKE_INSTALL_PREFIX="$VT_BUILD/install" \ -Dvt_ci_build="${VT_CI_BUILD:-0}" \ diff --git a/ci/ctest_build_all.sh b/ci/ctest_build_all.sh index 82611f26a7..9605c7a94a 100755 --- a/ci/ctest_build_all.sh +++ b/ci/ctest_build_all.sh @@ -49,13 +49,13 @@ else else git clone -b "${checkpoint_rev}" --depth 1 https://github.com/DARMA-tasking/checkpoint.git export CHECKPOINT=$PWD/checkpoint - export CHECKPOINT_BUILD=${build_dir}/checkpoint - mkdir -p "$CHECKPOINT_BUILD" - cd "$CHECKPOINT_BUILD" + export MAGISTRATE_BUILD=${build_dir}/checkpoint + mkdir -p "$MAGISTRATE_BUILD" + cd "$MAGISTRATE_BUILD" mkdir build cd build cmake -G "${CMAKE_GENERATOR:-Ninja}" \ - -DCMAKE_INSTALL_PREFIX="$CHECKPOINT_BUILD/install" \ + -DCMAKE_INSTALL_PREFIX="$MAGISTRATE_BUILD/install" \ "$CHECKPOINT" cmake --build . ${dashj} --target install fi diff --git a/ci/ctest_job_script.cmake b/ci/ctest_job_script.cmake index b092033a34..34097105b6 100644 --- a/ci/ctest_job_script.cmake +++ b/ci/ctest_job_script.cmake @@ -148,7 +148,7 @@ set(configureOpts "-DCMAKE_CXX_COMPILER=$ENV{CXX}" "-DCMAKE_C_COMPILER=$ENV{CC}" "-DCMAKE_EXE_LINKER_FLAGS=$ENV{CMAKE_EXE_LINKER_FLAGS}" - "-Dcheckpoint_ROOT=$ENV{CHECKPOINT_BUILD}/install" + "-Dmagistrate_ROOT=$ENV{MAGISTRATE_BUILD}/install" "-DCMAKE_PREFIX_PATH=$ENV{CMAKE_PREFIX_PATH}" "-DCMAKE_INSTALL_PREFIX=$ENV{VT_BUILD}/install" "-Dvt_ci_build=$ENV{VT_CI_BUILD}" diff --git a/cmake/link_vt.cmake b/cmake/link_vt.cmake index 1114cf7fbd..1f7464d855 100644 --- a/cmake/link_vt.cmake +++ b/cmake/link_vt.cmake @@ -197,7 +197,7 @@ function(link_target_with_vt) message(STATUS "link_target_with_vt: checkpoint=${ARG_LINK_CHECKPOINT}") endif() target_link_libraries( - ${ARG_TARGET} PUBLIC ${ARG_BUILD_TYPE} ${CHECKPOINT_LIBRARY} + ${ARG_TARGET} PUBLIC ${ARG_BUILD_TYPE} ${MAGISTRATE_LIBRARY} ) endif() diff --git a/cmake/load_local_packages.cmake b/cmake/load_local_packages.cmake index 8fad9402ca..2227da012b 100644 --- a/cmake/load_local_packages.cmake +++ b/cmake/load_local_packages.cmake @@ -9,7 +9,7 @@ if (EXISTS "${PROJECT_LIB_DIR}/checkpoint") add_subdirectory(${PROJECT_LIB_DIR}/checkpoint) else() # find these required packages locally - find_package_local(checkpoint checkpoint) + find_package_local(magistrate) endif() -set(CHECKPOINT_LIBRARY vt::lib::checkpoint) +set(MAGISTRATE_LIBRARY vt::lib::magistrate) diff --git a/cmake/local_package.cmake b/cmake/local_package.cmake index 05704e02ba..90f90e6e38 100644 --- a/cmake/local_package.cmake +++ b/cmake/local_package.cmake @@ -1,4 +1,4 @@ -macro(find_package_local pkg_name pkg_other_name) +macro(find_package_local pkg_name) set(${pkg_name}_PACKAGE_LOADED 0) if(hasParent) # Skip this logic when this macro was not invoked from the @@ -13,7 +13,7 @@ macro(find_package_local pkg_name pkg_other_name) find_package( ${pkg_name} - NAMES ${pkg_name} ${pkg_other_name} + NAMES ${pkg_name} NO_CMAKE_PACKAGE_REGISTRY NO_CMAKE_BUILDS_PATH NO_CMAKE_SYSTEM_PATH diff --git a/cmake/vtConfig.cmake.in b/cmake/vtConfig.cmake.in index 599eafdb8b..bb68c85a20 100644 --- a/cmake/vtConfig.cmake.in +++ b/cmake/vtConfig.cmake.in @@ -18,9 +18,10 @@ include(CMakeFindDependencyMacro) find_dependency(MPI REQUIRED) -if (@checkpoint_PACKAGE_LOADED@) - set (checkpoint_DIR @checkpoint_DIR@) - find_dependency(checkpoint REQUIRED HINTS @checkpoint_DIR@) +if (@magistrate_PACKAGE_LOADED@) + set (magistrate_DIR @magistrate_DIR@) + set (magistrate_ROOT @magistrate_ROOT@) + find_dependency(magistrate REQUIRED HINTS @magistrate_DIR@ @magistrate_ROOT@) endif() set (VT_INCLUDE_DIRS "@CMAKE_INSTALL_PREFIX@/include") @@ -28,7 +29,8 @@ set (VT_CXX_COMPILER "@CMAKE_CXX_COMPILER@") if (@vt_external_fmt@) set (fmt_DIR @fmt_DIR@) - find_dependency(fmt REQUIRED HINTS @fmt_DIR@) + set (fmt_ROOT @fmt_ROOT@) + find_dependency(fmt REQUIRED HINTS @fmt_DIR@ @fmt_ROOT@) endif() set(VT_HAS_FMT "TRUE")