File tree Expand file tree Collapse file tree 4 files changed +21
-15
lines changed Expand file tree Collapse file tree 4 files changed +21
-15
lines changed Original file line number Diff line number Diff line change @@ -59,8 +59,6 @@ option(pyAMReX_IPO
5959 ON
6060)
6161
62- set (pyAMReX_VERSION_INFO "" CACHE STRING
63- "PEP-440 conformant version (set by distutils)" )
6462# change the default build type to Release (or RelWithDebInfo) instead of Debug
6563set_default_build_type("Release" )
6664
@@ -185,11 +183,7 @@ endforeach()
185183
186184# Defines #####################################################################
187185#
188- # for module __version__
189- foreach (D IN LISTS AMReX_SPACEDIM)
190- target_compile_definitions (pyAMReX_${D} d PRIVATE
191- PYAMReX_VERSION_INFO=${pyAMReX_VERSION_INFO} )
192- endforeach ()
186+ # none needed - please use AMReX_Config.H
193187
194188
195189# Warnings ####################################################################
Original file line number Diff line number Diff line change @@ -24,5 +24,6 @@ foreach(D IN LISTS AMReX_SPACEDIM)
2424 PODVector.cpp
2525 Utility.cpp
2626 Vector.cpp
27+ Version .cpp
2728 )
2829endforeach ()
Original file line number Diff line number Diff line change 1+ /* Copyright 2021-2023 The AMReX Community
2+ *
3+ * License: BSD-3-Clause-LBNL
4+ * Authors: Axel Huebl
5+ */
6+ #include " pyAMReX.H"
7+
8+ #include < AMReX.H>
9+ #include < AMReX_Version.H>
10+
11+
12+ void init_Version (py::module & m)
13+ {
14+ // API runtime version
15+ // note PEP-440 syntax: x.y.zaN but x.y.z.devN
16+ m.attr (" __version__" ) = amrex::Version ();
17+ }
Original file line number Diff line number Diff line change @@ -41,6 +41,7 @@ void init_PlotFileUtil(py::module &);
4141void init_PODVector (py::module &);
4242void init_Utility (py::module &);
4343void init_Vector (py::module &);
44+ void init_Version (py::module &);
4445
4546
4647#if AMREX_SPACEDIM == 1
@@ -117,14 +118,7 @@ PYBIND11_MODULE(amrex_3d_pybind, m) {
117118 // Wrappers around standalone functions
118119 init_PlotFileUtil (m);
119120 init_Utility (m);
120-
121- // API runtime version
122- // note PEP-440 syntax: x.y.zaN but x.y.z.devN
123- #ifdef PYAMReX_VERSION_INFO
124- m.attr (" __version__" ) = MACRO_STRINGIFY (PYAMReX_VERSION_INFO);
125- #else
126- m.attr (" __version__" ) = " dev" ;
127- #endif
121+ init_Version (m);
128122
129123 // authors
130124 m.attr (" __author__" ) =
You can’t perform that action at this time.
0 commit comments