aboutsummaryrefslogtreecommitdiff
path: root/Python
diff options
context:
space:
mode:
authorGravatar Axel Huebl <axel.huebl@plasma.ninja> 2021-10-15 10:29:40 -0700
committerGravatar GitHub <noreply@github.com> 2021-10-15 10:29:40 -0700
commitd4c9b87bbf4aa32ea3ba3991d74be8c9fad4e26f (patch)
treedb1d983d756c799f96ab841c0aa8826156b42eae /Python
parent56c879d95c5b8752e62508396ffca61ba4b69aff (diff)
downloadWarpX-d4c9b87bbf4aa32ea3ba3991d74be8c9fad4e26f.tar.gz
WarpX-d4c9b87bbf4aa32ea3ba3991d74be8c9fad4e26f.tar.zst
WarpX-d4c9b87bbf4aa32ea3ba3991d74be8c9fad4e26f.zip
CI: Windows with Python (#2412)
* Python: generalize library search (Win) * CMake: Honor Multi-Config Lib Alias For multi-config build generators (MSVC, Ninja opt-in), we have a deeper build structure based on the build type. Honor this structure for the (Python) library alias/symlink. * CI: Windows with Python Co-authored-by: Dave Grote <dpgrote@lbl.gov>
Diffstat (limited to 'Python')
-rwxr-xr-xPython/pywarpx/_libwarpx.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/Python/pywarpx/_libwarpx.py b/Python/pywarpx/_libwarpx.py
index eb296478d..1dffbfec4 100755
--- a/Python/pywarpx/_libwarpx.py
+++ b/Python/pywarpx/_libwarpx.py
@@ -8,6 +8,7 @@
# --- This defines the wrapper functions that directly call the underlying compiled routines
import os
import sys
+import platform
import atexit
import ctypes
from ctypes.util import find_library as _find_library
@@ -63,7 +64,11 @@ else:
raise Exception('Undefined coordinate system %d'%_coord_sys)
del _prob_lo, _coord_sys
-_libc = ctypes.CDLL(_find_library('c'))
+if platform.system() == 'Windows':
+ path_libc = _find_library('msvcrt')
+else:
+ path_libc = _find_library('c')
+_libc = ctypes.CDLL(path_libc)
# this is a plain C/C++ shared library, not a Python module
if os.name == 'nt':