Skip to content

Commit

Permalink
release procedure
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilipDeegan committed Nov 27, 2024
1 parent c3f0fc3 commit 97fd182
Show file tree
Hide file tree
Showing 10 changed files with 66 additions and 24 deletions.
7 changes: 7 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -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
7 changes: 7 additions & 0 deletions res/cmake/def.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
Expand Down
1 change: 1 addition & 0 deletions res/cmake/dep.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down
8 changes: 5 additions & 3 deletions res/cmake/dep/cppdict.cmake
Original file line number Diff line number Diff line change
@@ -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})
11 changes: 5 additions & 6 deletions res/cmake/dep/highfive.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 5 additions & 3 deletions res/cmake/dep/pybind.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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})

Expand Down
8 changes: 6 additions & 2 deletions res/cmake/dep/samrai.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 16 additions & 0 deletions res/cmake/release.cmake
Original file line number Diff line number Diff line change
@@ -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")
4 changes: 4 additions & 0 deletions src/diagnostic/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
20 changes: 10 additions & 10 deletions tests/amr/tagging/test_tagging.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#include <cmath>
#include <algorithm>

#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"
Expand All @@ -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<phare_types>::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<phare_types>::make(dict);
auto badTagger = TaggerFactory<phare_types>::make(dict);
auto badTagger = TaggerFactory<phare_types>::make(dict);
EXPECT_TRUE(badTagger == nullptr);
}

Expand Down Expand Up @@ -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<dim, interp_order, refinedPartNbr>;
using phare_types = PHARE::solver::PHARE_Types<dim, interp_order, refinedPartNbr>;
using Electromag = typename phare_types::Electromag_t;
using Ions = typename phare_types::Ions_t;
using Electrons = typename phare_types::Electrons_t;
Expand Down

0 comments on commit 97fd182

Please sign in to comment.