Skip to content
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
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ find_package(Python 3.8 COMPONENTS Interpreter Development REQUIRED)
set(PHARE_PROJECT_DIR ${CMAKE_CURRENT_SOURCE_DIR})
set(CMAKE_EXPORT_COMPILE_COMMANDS 1)

if(EXISTS "${PHARE_PROJECT_DIR}/release.ver.txt") # delete file to use newer deps
include("${PHARE_PROJECT_DIR}/res/cmake/release.cmake")
endif()

include_directories(${PHARE_PROJECT_DIR}/src)

include("${PHARE_PROJECT_DIR}/res/cmake/options.cmake")
Expand Down
11 changes: 11 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
## 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
- [ ] Write/commit/push release.ver.txt
echo $MAJ.$MIN.$PATCH > release.ver.txt
git commit -m "releasing $MAJ.$MIN.$PATCH"
git push origin $MAJ.$MIN.x
- [ ] Release on github as $MAJ.$MIN.$PATCH
1 change: 1 addition & 0 deletions res/cmake/def.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ if(devMode) # -DdevMode=ON
set(PHARE_WITH_CCACHE TRUE)
endif()
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 "main")
endif()

set (HIGHFIVE_SRC ${CMAKE_CURRENT_SOURCE_DIR}/subprojects/highfive)
set (HIGHFIVE_VERSION main)

phare_github_get_or_update(HighFive ${HIGHFIVE_SRC} highfive-devs/highfive ${HIGHFIVE_VERSION})
phare_github_get_or_update(HighFive ${HIGHFIVE_SRC} highfive-devs/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
9 changes: 6 additions & 3 deletions res/cmake/dep/pybind.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,14 @@ function(get_pybind)
set (PHARE_FLAGS ${PHARE_FLAGS} -fsized-deallocation)
endif()

message("downloading subproject pybind11")
set(PYBIND11_SRCDIR ${CMAKE_CURRENT_SOURCE_DIR}/subprojects/pybind11)
set(PYBIND11_VERSION "master")
if(NOT DEFINED PHARE_PYBIND11_VERSION)
SET(PHARE_PYBIND11_VERSION "v2.13.6") # github.com/pybind/pybind11/pull/5553 broke master
endif()

set(PYBIND11_SRCDIR ${CMAKE_CURRENT_SOURCE_DIR}/subprojects/pybind11)

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
2 changes: 2 additions & 0 deletions res/cmake/options.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -133,3 +133,5 @@ function(print_phare_options)
endif()

endfunction(print_phare_options)


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/highfive-devs/highfive/releases/tag/v3.0.0-beta2
SET(PHARE_HIGHFIVE_VERSION "v3.0.0-beta2")

# 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()
2 changes: 1 addition & 1 deletion src/python3/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ endif (CMAKE_BUILD_TYPE STREQUAL "Debug")

pybind11_add_module(cpp_etc cpp_etc.cpp)
target_compile_options(cpp_etc PRIVATE ${PHARE_WERROR_FLAGS} -DPHARE_HAS_HIGHFIVE=${PHARE_HAS_HIGHFIVE})
target_link_libraries(cpp_etc PUBLIC phare_amr) # gives us samrai header includes
target_link_libraries(cpp_etc PUBLIC phare_amr phare_diagnostic)
set_target_properties(cpp_etc
PROPERTIES
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/pybindlibs"
Expand Down
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