aboutsummaryrefslogtreecommitdiff
path: root/Source/Python/WarpX_py.cpp
diff options
context:
space:
mode:
authorGravatar Axel Huebl <axel.huebl@plasma.ninja> 2021-12-03 16:37:15 -0800
committerGravatar GitHub <noreply@github.com> 2021-12-03 16:37:15 -0800
commit0f0823af3f1fb373708318fd1a4360ea22eef614 (patch)
tree425d6be49c55fe3707bbd554610a4745cdc05a13 /Source/Python/WarpX_py.cpp
parent5a2d3e7db9def4c9a290db207d80fd30493d4a24 (diff)
downloadWarpX-0f0823af3f1fb373708318fd1a4360ea22eef614.tar.gz
WarpX-0f0823af3f1fb373708318fd1a4360ea22eef614.tar.zst
WarpX-0f0823af3f1fb373708318fd1a4360ea22eef614.zip
extern 'C': Only in Headers (#2624)
* extern 'C': Only in Headers This does not belong in source files. Seen as missing symbols on CI for macOS and Intel, both clang compiles. ``` File "/usr/local/lib/python3.9/site-packages/pywarpx/_libwarpx.py", line 94, in <module> from ._libwarpx import * File "/usr/local/lib/python3.9/site-packages/pywarpx/_libwarpx.py", line 94, in <module> libwarpx.warpx_Real_size.restype = ctypes.c_int File "/usr/local/Cellar/python@3.9/3.9.9/Frameworks/Python.framework/Versions/3.9/lib/python3.9/ctypes/__init__.py", line 387, in __getattr__ libwarpx.warpx_Real_size.restype = ctypes.c_int File "/usr/local/Cellar/python@3.9/3.9.9/Frameworks/Python.framework/Versions/3.9/lib/python3.9/ctypes/__init__.py", line 387, in __getattr__ func = self.__getitem__(name) File "/usr/local/Cellar/python@3.9/3.9.9/Frameworks/Python.framework/Versions/3.9/lib/python3.9/ctypes/__init__.py", line 392, in __getitem__ func = self._FuncPtr((name_or_ordinal, self)) AttributeError: dlsym(0x7f89a3edb820, warpx_Real_size): symbol not found func = self.__getitem__(name) File "/usr/local/Cellar/python@3.9/3.9.9/Frameworks/Python.framework/Versions/3.9/lib/python3.9/ctypes/__init__.py", line 392, in __getitem__ func = self._FuncPtr((name_or_ordinal, self)) AttributeError: dlsym(0x7fe5d36c5190, warpx_Real_size): symbol not found AttributeError: /home/runner/.local/lib/python3.8/site-packages/pywarpx/libwarpx.3d.so: undefined symbol: warpx_Real_size ``` Refs.: - https://stackoverflow.com/questions/2168241/is-it-required-to-add-extern-c-in-source-file-also - https://isocpp.org/wiki/faq/mixing-c-and-cpp#call-cpp * Fix: Declare amrex_init_with_inited_mpi AMReX mocks out MPI anyway in serial builds. * Wrapper: Add Missing Declarations - fields - PML fields * Wrapper: More Missing Declarations - `warpx_getCellSize`
Diffstat (limited to '')
-rw-r--r--Source/Python/WarpX_py.cpp31
1 files changed, 13 insertions, 18 deletions
diff --git a/Source/Python/WarpX_py.cpp b/Source/Python/WarpX_py.cpp
index e2705c554..1d69ea8f3 100644
--- a/Source/Python/WarpX_py.cpp
+++ b/Source/Python/WarpX_py.cpp
@@ -7,21 +7,16 @@
*/
#include "WarpX_py.H"
-
-extern "C" {
-
- WARPX_CALLBACK_PY_FUNC_0 warpx_py_afterinit = nullptr;
- WARPX_CALLBACK_PY_FUNC_0 warpx_py_beforeEsolve = nullptr;
- WARPX_CALLBACK_PY_FUNC_0 warpx_py_poissonsolver = nullptr;
- WARPX_CALLBACK_PY_FUNC_0 warpx_py_afterEsolve = nullptr;
- WARPX_CALLBACK_PY_FUNC_0 warpx_py_beforedeposition = nullptr;
- WARPX_CALLBACK_PY_FUNC_0 warpx_py_afterdeposition = nullptr;
- WARPX_CALLBACK_PY_FUNC_0 warpx_py_particlescraper = nullptr;
- WARPX_CALLBACK_PY_FUNC_0 warpx_py_particleloader = nullptr;
- WARPX_CALLBACK_PY_FUNC_0 warpx_py_beforestep = nullptr;
- WARPX_CALLBACK_PY_FUNC_0 warpx_py_afterstep = nullptr;
- WARPX_CALLBACK_PY_FUNC_0 warpx_py_afterrestart = nullptr;
- WARPX_CALLBACK_PY_FUNC_0 warpx_py_particleinjection = nullptr;
- WARPX_CALLBACK_PY_FUNC_0 warpx_py_appliedfields = nullptr;
-
-}
+WARPX_CALLBACK_PY_FUNC_0 warpx_py_afterinit = nullptr;
+WARPX_CALLBACK_PY_FUNC_0 warpx_py_beforeEsolve = nullptr;
+WARPX_CALLBACK_PY_FUNC_0 warpx_py_poissonsolver = nullptr;
+WARPX_CALLBACK_PY_FUNC_0 warpx_py_afterEsolve = nullptr;
+WARPX_CALLBACK_PY_FUNC_0 warpx_py_beforedeposition = nullptr;
+WARPX_CALLBACK_PY_FUNC_0 warpx_py_afterdeposition = nullptr;
+WARPX_CALLBACK_PY_FUNC_0 warpx_py_particlescraper = nullptr;
+WARPX_CALLBACK_PY_FUNC_0 warpx_py_particleloader = nullptr;
+WARPX_CALLBACK_PY_FUNC_0 warpx_py_beforestep = nullptr;
+WARPX_CALLBACK_PY_FUNC_0 warpx_py_afterstep = nullptr;
+WARPX_CALLBACK_PY_FUNC_0 warpx_py_afterrestart = nullptr;
+WARPX_CALLBACK_PY_FUNC_0 warpx_py_particleinjection = nullptr;
+WARPX_CALLBACK_PY_FUNC_0 warpx_py_appliedfields = nullptr;