Skip to content

Commit c5f06e8

Browse files
committed
Fixing flags
1 parent 8f35cc2 commit c5f06e8

File tree

1 file changed

+7
-24
lines changed

1 file changed

+7
-24
lines changed

_compile.py

+7-24
Original file line numberDiff line numberDiff line change
@@ -60,26 +60,6 @@ def find_env() -> dict[str, str]:
6060

6161
fc = os.environ.get("FC", DEFAULT_FC)
6262

63-
linker_mathlib_dirs = [
64-
"/usr/lib/", # Debian
65-
"/lib/", # Alpine
66-
"/usr/local/lib/", # FreeBSD
67-
"/usr/lib64/", # Redhat
68-
]
69-
70-
mathlib_path = None
71-
72-
for dir in linker_mathlib_dirs:
73-
74-
if not Path(dir).is_dir():
75-
continue
76-
77-
mathlib_path = dir
78-
break
79-
80-
if mathlib_path is None:
81-
print("Unable to find mathlib path")
82-
8363
# TODO Check if FC is there, not not raise Error
8464
# TODO Check if lapack / blas is there, if not raise Error
8565
# TODO Check if omp is installed
@@ -115,10 +95,8 @@ def find_env() -> dict[str, str]:
11595
"-llapack",
11696
]
11797

118-
if mathlib_path is not None:
119-
linker_math += [f"-L{mathlib_path}"]
120-
121-
if sys.platform == "darwin":
98+
# MacOS X specific flags
99+
if "darwin " in sys.platform:
122100

123101
expected_omp_dir = Path("/opt/homebrew/opt/libomp/lib")
124102

@@ -136,6 +114,11 @@ def find_env() -> dict[str, str]:
136114
compiler_openmp = []
137115
linker_openmp = []
138116

117+
# FreeBSD specific flags
118+
if "freebsd" in sys.platform:
119+
# Location of BLAS / Lapack for FreeBSD 14
120+
linker_math += ["/usr/local/lib/"]
121+
139122
fflags = [] + compiler_flags + compiler_openmp
140123
ldflags = [] + linker_flags + linker_math + linker_openmp
141124

0 commit comments

Comments
 (0)