@@ -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
@@ -113,12 +93,11 @@ def find_env() -> dict[str, str]:
11393 linker_math = [
11494 "-lblas" ,
11595 "-llapack" ,
96+ "-L/usr/lib/" ,
11697 ]
11798
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 :
122101
123102 expected_omp_dir = Path ("/opt/homebrew/opt/libomp/lib" )
124103
@@ -136,6 +115,11 @@ def find_env() -> dict[str, str]:
136115 compiler_openmp = []
137116 linker_openmp = []
138117
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+
139123 fflags = [] + compiler_flags + compiler_openmp
140124 ldflags = [] + linker_flags + linker_math + linker_openmp
141125
0 commit comments