@@ -54,22 +54,44 @@ mkl64_dep = dependency('mkl',
5454 required : false ,
5555)
5656
57+ # Netlib LP64 (CBLAS and LAPACK are separate libraries)
58+ blas_dep = dependency (' blas' ,
59+ modules : [
60+ ' interface: lp64' ,
61+ ' cblas' ,
62+ ],
63+ required : false ,
64+ )
65+ lapack_dep = dependency (' lapack' ,
66+ modules : [
67+ ' interface: lp64' ,
68+ ' lapack' ,
69+ ],
70+ required : false ,
71+ )
5772
58- if not openblas_dep.found() and not openblas64_dep.found() and not accelerate_dep.found() and not mkl_dep.found()
73+ if not openblas_dep.found() and not openblas64_dep.found() and not accelerate_dep.found() and not mkl_dep.found() and not (blas_dep.found() and lapack_dep.found())
5974 error (' MESON_SKIP_TEST: no BLAS/LAPACK libraries available' )
6075endif
6176
6277deps = {
63- ' openblas' : openblas_dep,
64- ' openblas64' : openblas64_dep,
65- ' accelerate' : accelerate_dep,
66- ' accelerate64' : accelerate64_dep,
67- ' mkl' : mkl_dep,
68- ' mkl64' : mkl64_dep,
78+ ' openblas' : [openblas_dep],
79+ ' openblas64' : [openblas64_dep],
80+ ' accelerate' : [accelerate_dep],
81+ ' accelerate64' : [accelerate64_dep],
82+ ' mkl' : [mkl_dep],
83+ ' mkl64' : [mkl64_dep],
84+ ' netlib' : [blas_dep, lapack_dep],
6985}
7086
71- foreach name, dep : deps
72- if dep.found()
87+ foreach name, dep_list : deps
88+ found = true
89+ foreach dep : dep_list
90+ found = found and dep.found()
91+ endforeach
92+
93+ if found
94+ dep = dep_list[0 ]
7395 blas_interface = dep.get_variable (' interface' )
7496 symbol_suffix = dep.get_variable (' symbol_suffix' )
7597 blas_c_args = [' -DBLAS_SYMBOL_SUFFIX=' + symbol_suffix]
@@ -79,20 +101,20 @@ foreach name, dep : deps
79101 blas_c_args += [' -DOPENBLAS_ILP64_NAMING_SCHEME' ]
80102 endif
81103 elif blas_interface != ' lp64'
82- error (f' no interface var for % name% dependency!' )
104+ error (f' no interface var for @ name@ dependency!' )
83105 endif
84106
85- c_exe = executable (' cblas_lapack_c_' + blas_interface ,
107+ c_exe = executable (' cblas_lapack_c_' + name ,
86108 ' cblas_lapack.c' ,
87109 c_args : blas_c_args,
88- dependencies : [dep]
110+ dependencies : dep_list
89111 )
90112 test (' cblas_lapack_dep_c' , c_exe, timeout : 30 )
91113
92114 if add_languages (' fortran' , required : false )
93- f_exe = executable (' cblas_lapack_fortran_' + blas_interface ,
115+ f_exe = executable (' cblas_lapack_fortran_' + name ,
94116 ' main.f90' ,
95- dependencies : [dep]
117+ dependencies : dep_list
96118 )
97119 test (' cblas_lapack_dep_fortran' , f_exe, timeout : 30 )
98120 endif
0 commit comments