Skip to content

Commit 8b1407e

Browse files
authored
pybind11: 3.0.0 (#455)
Update to pybind11 v3.0.0 https://github.com/pybind/pybind11/releases/tag/v3.0.0
1 parent 69c5e26 commit 8b1407e

File tree

6 files changed

+14
-9
lines changed

6 files changed

+14
-9
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ pyAMReX depends on the following popular third party software.
5858
- 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
5959
- [CMake 3.24.0+](https://cmake.org)
6060
- [AMReX *development*](https://amrex-codes.github.io): we automatically download and compile a copy of AMReX
61-
- [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))
61+
- [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))
6262
- [Python](https://python.org) 3.9+
6363
- [Numpy](https://numpy.org) 1.15+
6464

@@ -205,7 +205,7 @@ Furthermore, pyAMReX adds a few selected CMake build options:
205205
| `pyAMReX_pybind11_src` | *None* | Absolute path to pybind11 source directory (preferred if set) |
206206
| `pyAMReX_pybind11_internal` | **ON**/OFF | Needs a pre-installed pybind11 library if set to `OFF` |
207207
| `pyAMReX_pybind11_repo` | `https://github.com/pybind/pybind11.git` | Repository URI to pull and build pybind11 from |
208-
| `pyAMReX_pybind11_branch` | `v2.13.6` | Repository branch for `pyAMReX_pybind11_repo` |
208+
| `pyAMReX_pybind11_branch` | `v3.0.0` | Repository branch for `pyAMReX_pybind11_repo` |
209209
| `Python_EXECUTABLE` | (newest found) | Path to Python executable |
210210

211211
As one example, one can also build against a local AMReX copy.

cmake/dependencies/pybind11.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ function(find_pybind11)
4141
mark_as_advanced(FETCHCONTENT_UPDATES_DISCONNECTED_FETCHEDpybind11)
4242
endif()
4343
elseif(NOT pyAMReX_pybind11_internal)
44-
find_package(pybind11 2.13.0 CONFIG REQUIRED)
44+
find_package(pybind11 3.0.0 CONFIG REQUIRED)
4545
message(STATUS "pybind11: Found version '${pybind11_VERSION}'")
4646
endif()
4747
endfunction()
@@ -56,7 +56,7 @@ option(pyAMReX_pybind11_internal "Download & build pybind11" ON)
5656
set(pyAMReX_pybind11_repo "https://github.com/pybind/pybind11.git"
5757
CACHE STRING
5858
"Repository URI to pull and build pybind11 from if(pyAMReX_pybind11_internal)")
59-
set(pyAMReX_pybind11_branch "v2.13.6"
59+
set(pyAMReX_pybind11_branch "v3.0.0"
6060
CACHE STRING
6161
"Repository branch for pyAMReX_pybind11_repo if(pyAMReX_pybind11_internal)")
6262

docs/source/install/dependencies.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Please see installation instructions below.
1010
- `CMake 3.24.0+ <https://cmake.org>`__
1111
- `Git 2.18+ <https://git-scm.com>`__
1212
- `AMReX <https://amrex-codes.github.io>`__: we automatically download and compile a copy
13-
- `pybind11 2.13.0+ <https://github.com/pybind/pybind11/>`__: we automatically download and compile a copy
13+
- `pybind11 3.0.0+ <https://github.com/pybind/pybind11/>`__: we automatically download and compile a copy
1414
- `Python 3.9+ <https://www.python.org>`__
1515

1616
- `numpy 1.15+ <https://numpy.org>`__

src/Base/CoordSys.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,14 @@ void init_CoordSys(py::module& m)
1414

1515
py::class_<CoordSys> coord_sys(m, "CoordSys");
1616

17-
py::enum_<CoordSys::CoordType>(coord_sys, "CoordType")
17+
py::native_enum<CoordSys::CoordType>(coord_sys, "CoordType", "enum.IntEnum")
1818
.value("undef", CoordSys::CoordType::undef)
1919
.value("cartesian", CoordSys::CoordType::cartesian)
2020
.value("RZ", CoordSys::CoordType::RZ)
2121
.value("SPHERICAL", CoordSys::CoordType::SPHERICAL)
22-
.export_values();
22+
.export_values()
23+
.finalize()
24+
;
2325

2426
coord_sys.def("__repr__",
2527
[](const CoordSys&) {

src/Base/IndexType.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,12 @@ void init_IndexType(py::module &m) {
2929

3030
py::class_< IndexType > index_type(m, "IndexType");
3131

32-
py::enum_<IndexType::CellIndex>(index_type, "CellIndex")
32+
py::native_enum<IndexType::CellIndex>(index_type, "CellIndex", "enum.IntEnum")
3333
.value("CELL", IndexType::CellIndex::CELL)
3434
.value("NODE", IndexType::CellIndex::NODE)
35-
.export_values();
35+
.export_values()
36+
.finalize()
37+
;
3638

3739
index_type.def("__repr__",
3840
[](py::object& obj) {

src/pyAMReX.H

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include <pybind11/pybind11.h>
1212
#include <pybind11/functional.h>
1313
#include <pybind11/iostream.h>
14+
#include <pybind11/native_enum.h>
1415
#include <pybind11/numpy.h>
1516
#include <pybind11/operators.h>
1617
#include <pybind11/stl.h>

0 commit comments

Comments
 (0)