Skip to content

Commit 366a4c5

Browse files
committed
Make helics v2.6 and v3.0 compatible release
1 parent 379ee33 commit 366a4c5

File tree

10 files changed

+609
-124
lines changed

10 files changed

+609
-124
lines changed

helics/_build.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949

5050
if platform.system() == "Windows":
5151
for file in os.listdir(os.path.join(PYHELICS_INSTALL, "bin")):
52-
if "helicsShared" in file:
52+
if "helics" in file and file.endswith(".dll"):
5353
try:
5454
lib = ffi.dlopen(os.path.join(PYHELICS_INSTALL, "bin", file))
5555
break
@@ -69,19 +69,25 @@
6969
raise Exception("Unable to load helics shared library")
7070
elif platform.system() == "Darwin":
7171
for file in os.listdir(os.path.join(PYHELICS_INSTALL, "lib")):
72-
if "helicsSharedLib" in file:
72+
if "helicsSharedLib" in file or "libhelics" in file and file.endswith(".dylib"):
7373
lib = ffi.dlopen(os.path.join(PYHELICS_INSTALL, "lib", file))
7474
break
7575
else:
76-
lib = ffi.dlopen("helicsSharedLib.dylib")
76+
try:
77+
lib = ffi.dlopen("libhelics.dylib")
78+
except:
79+
lib = ffi.dlopen("helicsSharedLib.dylib")
7780
if lib is None:
7881
raise Exception("Unable to load helics shared library")
7982
elif platform.system() == "Linux":
8083
for file in os.listdir(os.path.join(PYHELICS_INSTALL, "lib")):
81-
if "helicsSharedLib" in file:
84+
if "helicsSharedLib" in file or "libhelics" in file and file.endswith(".so"):
8285
lib = ffi.dlopen(os.path.join(PYHELICS_INSTALL, "lib", file))
8386
break
8487
else:
85-
lib = ffi.dlopen("helicsSharedLib.so")
88+
try:
89+
lib = ffi.dlopen("libhelics.so")
90+
except:
91+
lib = ffi.dlopen("helicsSharedLib.so")
8692
if lib is None:
8793
raise Exception("Unable to load helics shared library")

0 commit comments

Comments
 (0)