aboutsummaryrefslogtreecommitdiff
path: root/Source/Python/WarpXWrappers.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/WarpXWrappers.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 'Source/Python/WarpXWrappers.cpp')
-rw-r--r--Source/Python/WarpXWrappers.cpp9
1 files changed, 2 insertions, 7 deletions
diff --git a/Source/Python/WarpXWrappers.cpp b/Source/Python/WarpXWrappers.cpp
index 6e9b6e941..ba78d2233 100644
--- a/Source/Python/WarpXWrappers.cpp
+++ b/Source/Python/WarpXWrappers.cpp
@@ -101,9 +101,6 @@ namespace
}
}
-extern "C"
-{
-
int warpx_Real_size()
{
return (int)sizeof(amrex::Real);
@@ -461,14 +458,14 @@ extern "C"
WARPX_GET_LOVECTS_PML_SCALAR(warpx_getGfieldCPLoVects_PML, GetG_cp)
WARPX_GET_LOVECTS_PML_SCALAR(warpx_getGfieldFPLoVects_PML, GetG_fp)
- int* warpx_getF_pml_nodal_flag()
+ int* warpx_getF_pml_nodal_flag ()
{
auto * pml = WarpX::GetInstance().GetPML(0);
if (!pml) return nullptr;
return getFieldNodalFlagData(pml->GetF_fp());
}
- int* warpx_getG_pml_nodal_flag()
+ int* warpx_getG_pml_nodal_flag ()
{
auto * pml = WarpX::GetInstance().GetPML(0);
if (!pml) return nullptr;
@@ -728,5 +725,3 @@ extern "C"
auto & mypc = WarpX::GetInstance().GetPartContainer();
mypc.Redistribute();
}
-
-}