@@ -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
@@ -113,12 +93,11 @@ def find_env() -> dict[str, str]:
113
93
linker_math = [
114
94
"-lblas" ,
115
95
"-llapack" ,
96
+ "-L/usr/lib/" ,
116
97
]
117
98
118
- if mathlib_path is not None :
119
- linker_math += [f"-L{ mathlib_path } " ]
120
-
121
- if sys .platform == "darwin" :
99
+ # MacOS X specific flags
100
+ if "darwin" in sys .platform :
122
101
123
102
expected_omp_dir = Path ("/opt/homebrew/opt/libomp/lib" )
124
103
@@ -136,6 +115,11 @@ def find_env() -> dict[str, str]:
136
115
compiler_openmp = []
137
116
linker_openmp = []
138
117
118
+ # FreeBSD specific flags
119
+ if "freebsd" in sys .platform :
120
+ # Location of BLAS / Lapack for FreeBSD 14
121
+ linker_math += ["-L/usr/local/lib/" ]
122
+
139
123
fflags = [] + compiler_flags + compiler_openmp
140
124
ldflags = [] + linker_flags + linker_math + linker_openmp
141
125
0 commit comments