Skip to content

Commit c18a5d9

Browse files
committed
Fix extension search
1 parent ce3b4cd commit c18a5d9

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

test/test_raffle.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from ase import Atoms
77
import subprocess
88

9+
import platform
910

1011

1112
fc = os.getenv("FORTRAN_COMPILER")
@@ -15,6 +16,12 @@
1516
etc_dir = os.path.join(dirname, "etc")
1617
lib_dir = os.path.join(dirname, "lib")
1718

19+
lib_ext = {
20+
"Darwin": "dylib",
21+
"Linux": "so"
22+
}[platform.system()]
23+
libraffle_path = os.path.join(lib_dir, f"libraffle.{lib_ext}")
24+
1825
with open("test/CMakeLists.txt", "r") as file:
1926
lines = file.readlines()
2027

@@ -44,7 +51,7 @@ def build_fortran_test(test_name):
4451
# make using a fortran compiler
4552
# point to raffle's pip install include and lib to include during compilation
4653

47-
if uses_openmp(os.path.join(lib_dir, "libraffle.dylib")):
54+
if uses_openmp(libraffle_path):
4855
compile_args = ["-fopenmp", "-lgomp"]
4956
else:
5057
compile_args = []

0 commit comments

Comments
 (0)