@@ -60,26 +60,6 @@ def find_env() -> dict[str, str]:
60
60
61
61
fc = os .environ .get ("FC" , DEFAULT_FC )
62
62
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
-
83
63
# TODO Check if FC is there, not not raise Error
84
64
# TODO Check if lapack / blas is there, if not raise Error
85
65
# TODO Check if omp is installed
@@ -115,10 +95,8 @@ def find_env() -> dict[str, str]:
115
95
"-llapack" ,
116
96
]
117
97
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 :
122
100
123
101
expected_omp_dir = Path ("/opt/homebrew/opt/libomp/lib" )
124
102
@@ -136,6 +114,11 @@ def find_env() -> dict[str, str]:
136
114
compiler_openmp = []
137
115
linker_openmp = []
138
116
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
+
139
122
fflags = [] + compiler_flags + compiler_openmp
140
123
ldflags = [] + linker_flags + linker_math + linker_openmp
141
124
0 commit comments