diff options
author | 2021-10-15 10:29:40 -0700 | |
---|---|---|
committer | 2021-10-15 10:29:40 -0700 | |
commit | d4c9b87bbf4aa32ea3ba3991d74be8c9fad4e26f (patch) | |
tree | db1d983d756c799f96ab841c0aa8826156b42eae /Python | |
parent | 56c879d95c5b8752e62508396ffca61ba4b69aff (diff) | |
download | WarpX-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-x | Python/pywarpx/_libwarpx.py | 7 |
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': |