diff --git a/README.md b/README.md index ddc6308d..e3167fff 100644 --- a/README.md +++ b/README.md @@ -58,7 +58,7 @@ pyAMReX depends on the following popular third party software. - a mature [C++17](https://en.wikipedia.org/wiki/C%2B%2B17) compiler, e.g., GCC 8, Clang 7, NVCC 11.0, MSVC 19.15 or newer - [CMake 3.24.0+](https://cmake.org) - [AMReX *development*](https://amrex-codes.github.io): we automatically download and compile a copy of AMReX -- [pybind11](https://github.com/pybind/pybind11/) 2.13.0+: we automatically download and compile a copy of pybind11 ([new BSD](https://github.com/pybind/pybind11/blob/master/LICENSE)) +- [pybind11](https://github.com/pybind/pybind11/) 3.0.0+: we automatically download and compile a copy of pybind11 ([new BSD](https://github.com/pybind/pybind11/blob/master/LICENSE)) - [Python](https://python.org) 3.9+ - [Numpy](https://numpy.org) 1.15+ @@ -205,7 +205,7 @@ Furthermore, pyAMReX adds a few selected CMake build options: | `pyAMReX_pybind11_src` | *None* | Absolute path to pybind11 source directory (preferred if set) | | `pyAMReX_pybind11_internal` | **ON**/OFF | Needs a pre-installed pybind11 library if set to `OFF` | | `pyAMReX_pybind11_repo` | `https://github.com/pybind/pybind11.git` | Repository URI to pull and build pybind11 from | -| `pyAMReX_pybind11_branch` | `v2.13.6` | Repository branch for `pyAMReX_pybind11_repo` | +| `pyAMReX_pybind11_branch` | `v3.0.0` | Repository branch for `pyAMReX_pybind11_repo` | | `Python_EXECUTABLE` | (newest found) | Path to Python executable | As one example, one can also build against a local AMReX copy. diff --git a/cmake/dependencies/pybind11.cmake b/cmake/dependencies/pybind11.cmake index 68246eeb..45ba7898 100644 --- a/cmake/dependencies/pybind11.cmake +++ b/cmake/dependencies/pybind11.cmake @@ -41,7 +41,7 @@ function(find_pybind11) mark_as_advanced(FETCHCONTENT_UPDATES_DISCONNECTED_FETCHEDpybind11) endif() elseif(NOT pyAMReX_pybind11_internal) - find_package(pybind11 2.13.0 CONFIG REQUIRED) + find_package(pybind11 3.0.0 CONFIG REQUIRED) message(STATUS "pybind11: Found version '${pybind11_VERSION}'") endif() endfunction() @@ -56,7 +56,7 @@ option(pyAMReX_pybind11_internal "Download & build pybind11" ON) set(pyAMReX_pybind11_repo "https://github.com/pybind/pybind11.git" CACHE STRING "Repository URI to pull and build pybind11 from if(pyAMReX_pybind11_internal)") -set(pyAMReX_pybind11_branch "v2.13.6" +set(pyAMReX_pybind11_branch "v3.0.0" CACHE STRING "Repository branch for pyAMReX_pybind11_repo if(pyAMReX_pybind11_internal)") diff --git a/docs/source/install/dependencies.rst b/docs/source/install/dependencies.rst index 552deb27..4016df04 100644 --- a/docs/source/install/dependencies.rst +++ b/docs/source/install/dependencies.rst @@ -10,7 +10,7 @@ Please see installation instructions below. - `CMake 3.24.0+ `__ - `Git 2.18+ `__ - `AMReX `__: we automatically download and compile a copy -- `pybind11 2.13.0+ `__: we automatically download and compile a copy +- `pybind11 3.0.0+ `__: we automatically download and compile a copy - `Python 3.9+ `__ - `numpy 1.15+ `__ diff --git a/src/Base/CoordSys.cpp b/src/Base/CoordSys.cpp index 4c626669..9c747eb5 100644 --- a/src/Base/CoordSys.cpp +++ b/src/Base/CoordSys.cpp @@ -14,12 +14,14 @@ void init_CoordSys(py::module& m) py::class_ coord_sys(m, "CoordSys"); - py::enum_(coord_sys, "CoordType") + py::native_enum(coord_sys, "CoordType", "enum.IntEnum") .value("undef", CoordSys::CoordType::undef) .value("cartesian", CoordSys::CoordType::cartesian) .value("RZ", CoordSys::CoordType::RZ) .value("SPHERICAL", CoordSys::CoordType::SPHERICAL) - .export_values(); + .export_values() + .finalize() + ; coord_sys.def("__repr__", [](const CoordSys&) { diff --git a/src/Base/IndexType.cpp b/src/Base/IndexType.cpp index 93241e59..60c00d5a 100644 --- a/src/Base/IndexType.cpp +++ b/src/Base/IndexType.cpp @@ -29,10 +29,12 @@ void init_IndexType(py::module &m) { py::class_< IndexType > index_type(m, "IndexType"); - py::enum_(index_type, "CellIndex") + py::native_enum(index_type, "CellIndex", "enum.IntEnum") .value("CELL", IndexType::CellIndex::CELL) .value("NODE", IndexType::CellIndex::NODE) - .export_values(); + .export_values() + .finalize() + ; index_type.def("__repr__", [](py::object& obj) { diff --git a/src/pyAMReX.H b/src/pyAMReX.H index 126761d5..749e0d95 100644 --- a/src/pyAMReX.H +++ b/src/pyAMReX.H @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include