Skip to content

Commit

Permalink
EB: On by Default in Superbuild (#366)
Browse files Browse the repository at this point in the history
* EB: On by Default

Now that AMReX EBs are fully runtime controlled, we will
default use them in dependent projects like WarpX and can default
to them here as well.

* AMReX: Latest `development`

* Update `find_package`

* `Config`: Add `have_eb` Property
  • Loading branch information
ax3l committed Sep 6, 2024
1 parent da2d5a0 commit b2ef001
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cmake/dependencies/AMReX.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ macro(find_amrex)
set(AMReX_FPE OFF CACHE BOOL "")
endif()

set(AMReX_EB ON CACHE INTERNAL "")
set(AMReX_PIC ON CACHE INTERNAL "")
set(AMReX_ENABLE_TESTS OFF CACHE INTERNAL "")
set(AMReX_FORTRAN OFF CACHE INTERNAL "")
Expand Down Expand Up @@ -65,6 +66,7 @@ macro(find_amrex)
elseif(NOT pyAMReX_amrex_internal)
message(STATUS "Searching for pre-installed AMReX ...")
# https://amrex-codes.github.io/amrex/docs_html/BuildingAMReX.html#importing-amrex-into-your-cmake-project
# not strictly required yet to compile pyAMReX: EB
find_package(AMReX 24.09 CONFIG REQUIRED COMPONENTS PARTICLES PIC)
message(STATUS "AMReX: Found version '${AMReX_VERSION}'")

Expand All @@ -84,7 +86,7 @@ option(pyAMReX_amrex_internal "Download & build AMReX" ON)
set(pyAMReX_amrex_repo "https://github.com/AMReX-Codes/amrex.git"
CACHE STRING
"Repository URI to pull and build AMReX from if(pyAMReX_amrex_internal)")
set(pyAMReX_amrex_branch "24.09"
set(pyAMReX_amrex_branch "b454719b10b8d73307852788e54cc62db99a6814"
CACHE STRING
"Repository branch for pyAMReX_amrex_repo if(pyAMReX_amrex_internal)")

Expand Down
9 changes: 9 additions & 0 deletions src/Base/AMReX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,15 @@ void init_AMReX(py::module& m)
"verbose",
[](py::object) { return Verbose(); },
[](py::object, const int v) { SetVerbose(v); })
.def_property_readonly_static(
"have_eb",
[](py::object){
#ifdef AMREX_USE_EB
return true;
#else
return false;
#endif
})
.def_property_readonly_static(
"have_mpi",
[](py::object){
Expand Down

0 comments on commit b2ef001

Please sign in to comment.