From 97fd1829384fffc963ff733db2d27ed8ecc6701a Mon Sep 17 00:00:00 2001 From: deegan Date: Wed, 27 Nov 2024 11:52:02 +0100 Subject: [PATCH] release procedure --- RELEASE.md | 7 +++++++ res/cmake/def.cmake | 7 +++++++ res/cmake/dep.cmake | 1 + res/cmake/dep/cppdict.cmake | 8 +++++--- res/cmake/dep/highfive.cmake | 11 +++++------ res/cmake/dep/pybind.cmake | 8 +++++--- res/cmake/dep/samrai.cmake | 8 ++++++-- res/cmake/release.cmake | 16 ++++++++++++++++ src/diagnostic/CMakeLists.txt | 4 ++++ tests/amr/tagging/test_tagging.cpp | 20 ++++++++++---------- 10 files changed, 66 insertions(+), 24 deletions(-) create mode 100644 RELEASE.md create mode 100644 res/cmake/release.cmake diff --git a/RELEASE.md b/RELEASE.md new file mode 100644 index 000000000..08be10a4a --- /dev/null +++ b/RELEASE.md @@ -0,0 +1,7 @@ +## Releasing a new version of PHARE + +- [ ] Review file: res/cmake/release.cmake +- [ ] Update to use latest (if safe) versions +- [ ] PR updates to master +- [ ] Cut branch from master as $MAJ.$MIN.x if required +- [ ] Tag branch as $MAJ.$MIN.$PATCH diff --git a/res/cmake/def.cmake b/res/cmake/def.cmake index 684425235..bc9e1a7d2 100644 --- a/res/cmake/def.cmake +++ b/res/cmake/def.cmake @@ -87,6 +87,13 @@ if(devMode) # -DdevMode=ON set(PHARE_WITH_CCACHE TRUE) endif() endif() + +else() + + if (CMAKE_BUILD_TYPE STREQUAL "Release") + include("${PHARE_PROJECT_DIR}/res/cmake/release.cmake") + endif() + endif(devMode) function(phare_sanitize_ san cflags ) diff --git a/res/cmake/dep.cmake b/res/cmake/dep.cmake index 803634af3..0e51537df 100644 --- a/res/cmake/dep.cmake +++ b/res/cmake/dep.cmake @@ -2,6 +2,7 @@ function(phare_git_get_or_update name dir url branch) if (NOT EXISTS ${dir}) + message("cloning ${url} ${branch}" ) execute_process( COMMAND ${Git} clone ${url} ${dir} -b ${branch} --recursive --depth 1 --shallow-submodules ) diff --git a/res/cmake/dep/cppdict.cmake b/res/cmake/dep/cppdict.cmake index 44b5fdedc..ddfca248a 100644 --- a/res/cmake/dep/cppdict.cmake +++ b/res/cmake/dep/cppdict.cmake @@ -1,6 +1,8 @@ -set(CPPDICT_SRCDIR ${CMAKE_CURRENT_SOURCE_DIR}/subprojects/cppdict) -set(CPPDICT_VERSION master) -phare_github_get_or_update(cppdict ${CPPDICT_SRCDIR} LaboratoryOfPlasmaPhysics/cppdict ${CPPDICT_VERSION}) +if(NOT DEFINED PHARE_CPPDICT_VERSION) + SET(PHARE_CPPDICT_VERSION "master") +endif() +set(CPPDICT_SRCDIR ${CMAKE_CURRENT_SOURCE_DIR}/subprojects/cppdict) +phare_github_get_or_update(cppdict ${CPPDICT_SRCDIR} LaboratoryOfPlasmaPhysics/cppdict ${PHARE_CPPDICT_VERSION}) diff --git a/res/cmake/dep/highfive.cmake b/res/cmake/dep/highfive.cmake index b74081c68..0cd23378a 100644 --- a/res/cmake/dep/highfive.cmake +++ b/res/cmake/dep/highfive.cmake @@ -3,15 +3,14 @@ set (PHARE_HAS_HIGHFIVE "0") if(HighFive) + if(NOT DEFINED PHARE_HIGHFIVE_VERSION) + SET(PHARE_HIGHFIVE_VERSION "master") + endif() + set (HIGHFIVE_SRC ${CMAKE_CURRENT_SOURCE_DIR}/subprojects/highfive) - set (HIGHFIVE_VERSION master) - phare_github_get_or_update(HighFive ${HIGHFIVE_SRC} BlueBrain/HighFive ${HIGHFIVE_VERSION}) + phare_github_get_or_update(HighFive ${HIGHFIVE_SRC} BlueBrain/HighFive ${PHARE_HIGHFIVE_VERSION}) - include_directories( - ${HIGHFIVE_SRC}/include - ${CMAKE_BINARY_DIR}/subprojects/highfive/include # configured include for version info - ) set(HIGHFIVE_UNIT_TESTS OFF) # silence warning set(HIGHFIVE_USE_BOOST OFF) set(HIGHFIVE_BUILD_DOCS OFF) # conflicts with phare doc target diff --git a/res/cmake/dep/pybind.cmake b/res/cmake/dep/pybind.cmake index fb2e90135..b712eaf9a 100644 --- a/res/cmake/dep/pybind.cmake +++ b/res/cmake/dep/pybind.cmake @@ -9,11 +9,13 @@ function(get_pybind) set (PHARE_FLAGS ${PHARE_FLAGS} -fsized-deallocation) endif() - message("downloading subproject pybind11") + if(NOT DEFINED PHARE_PYBIND11_VERSION) + SET(PHARE_PYBIND11_VERSION "master") + endif() + set(PYBIND11_SRCDIR ${CMAKE_CURRENT_SOURCE_DIR}/subprojects/pybind11) - set(PYBIND11_VERSION master) - phare_github_get_or_update(pybind11 ${PYBIND11_SRCDIR} pybind/pybind11 ${PYBIND11_VERSION}) + phare_github_get_or_update(pybind11 ${PYBIND11_SRCDIR} pybind/pybind11 ${PHARE_PYBIND11_VERSION}) add_subdirectory(${PYBIND11_SRCDIR}) diff --git a/res/cmake/dep/samrai.cmake b/res/cmake/dep/samrai.cmake index d4cc3354f..d90f2a86b 100644 --- a/res/cmake/dep/samrai.cmake +++ b/res/cmake/dep/samrai.cmake @@ -10,11 +10,15 @@ if (NOT SAMRAI_FOUND) if(DEFINED SAMRAI_ROOT) find_package(SAMRAI PATHS ${SAMRAI_ROOT} REQUIRED) else() - set(SAMRAI_VERSION develop) + + if(NOT DEFINED PHARE_SAMRAI_VERSION) + SET(PHARE_SAMRAI_VERSION "develop") + endif() + set(SAMRAI_SRCDIR ${CMAKE_CURRENT_SOURCE_DIR}/subprojects/samrai) set(SAMRAI_BIN ${CMAKE_CURRENT_BINARY_DIR}/subprojects/samrai) - phare_github_get_or_update(SAMRAI ${SAMRAI_SRCDIR} LLNL/SAMRAI ${SAMRAI_VERSION}) + phare_github_get_or_update(SAMRAI ${SAMRAI_SRCDIR} LLNL/SAMRAI ${PHARE_SAMRAI_VERSION}) if (NOT CMAKE_BUILD_TYPE STREQUAL "Release") # enable samrai assertions if not in release mode diff --git a/res/cmake/release.cmake b/res/cmake/release.cmake new file mode 100644 index 000000000..081a05cc3 --- /dev/null +++ b/res/cmake/release.cmake @@ -0,0 +1,16 @@ +## +# Release info +# KEEP SIMPLE! +# + +# https://github.com/LLNL/SAMRAI/releases/tag/v-4-3-0 +SET(PHARE_SAMRAI_VERSION "v-4-3-0") + +# https://github.com/pybind/pybind11/releases/tag/v2.13.6 +SET(PHARE_PYBIND11_VERSION "v2.13.6") + +# https://github.com/BlueBrain/HighFive/releases/tag/v2.10.0 +SET(PHARE_HIGHFIVE_VERSION "master") # v2.10.0 is too old + +# https://github.com/LaboratoryOfPlasmaPhysics/cppdict/releases/tag/v1.0.0 +SET(PHARE_CPPDICT_VERSION "v1.0.0") diff --git a/src/diagnostic/CMakeLists.txt b/src/diagnostic/CMakeLists.txt index 8759c822c..5a97d1d60 100644 --- a/src/diagnostic/CMakeLists.txt +++ b/src/diagnostic/CMakeLists.txt @@ -22,3 +22,7 @@ endif() add_library(${PROJECT_NAME} INTERFACE) target_link_libraries(${PROJECT_NAME} INTERFACE phare_amr) + +if (HighFive) + target_link_libraries(${PROJECT_NAME} INTERFACE HighFive) +endif() diff --git a/tests/amr/tagging/test_tagging.cpp b/tests/amr/tagging/test_tagging.cpp index 238126749..7474303ec 100644 --- a/tests/amr/tagging/test_tagging.cpp +++ b/tests/amr/tagging/test_tagging.cpp @@ -2,7 +2,7 @@ #include #include -#include "phare/phare.hpp" +#include "phare_solver.hpp" #include "amr/tagging/tagger.hpp" #include "amr/tagging/tagger_factory.hpp" #include "amr/resources_manager/resources_manager.hpp" @@ -23,23 +23,23 @@ using namespace PHARE::amr; TEST(test_tagger, fromFactoryValid) { - using phare_types = PHARE::PHARE_Types<1, 1, 2>; + using phare_types = PHARE::solver::PHARE_Types<1, 1, 2>; PHARE::initializer::PHAREDict dict; - dict["model"] = std::string{"HybridModel"}; - dict["method"] = std::string{"default"}; - dict["threshold"] = 0.2; + dict["model"] = std::string{"HybridModel"}; + dict["method"] = std::string{"default"}; + dict["threshold"] = 0.2; auto hybridTagger = TaggerFactory::make(dict); EXPECT_TRUE(hybridTagger != nullptr); } TEST(test_tagger, fromFactoryInvalid) { - using phare_types = PHARE::PHARE_Types<1, 1, 2>; + using phare_types = PHARE::solver::PHARE_Types<1, 1, 2>; PHARE::initializer::PHAREDict dict; - dict["model"] = std::string{"invalidModel"}; - dict["method"] = std::string{"invalidStrat"}; + dict["model"] = std::string{"invalidModel"}; + dict["method"] = std::string{"invalidStrat"}; auto hybridTagger = TaggerFactory::make(dict); - auto badTagger = TaggerFactory::make(dict); + auto badTagger = TaggerFactory::make(dict); EXPECT_TRUE(badTagger == nullptr); } @@ -169,7 +169,7 @@ struct TestTagger : public ::testing::Test auto static constexpr interp_order = TaggingTestInfo_t::interp; auto static constexpr refinedPartNbr = TaggingTestInfo_t::refinedPartNbr; - using phare_types = PHARE::PHARE_Types; + using phare_types = PHARE::solver::PHARE_Types; using Electromag = typename phare_types::Electromag_t; using Ions = typename phare_types::Ions_t; using Electrons = typename phare_types::Electrons_t;