1
dnl @synopsis TAC_BLAS([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
3
dnl This macro looks for a library that implements the BLAS
4
dnl linear-algebra interface (see http://www.netlib.org/blas/).
5
dnl On success, it sets the BLAS_LIBS output variable to
6
dnl hold the requisite library linkages.
8
dnl To link with BLAS, you should link with:
10
dnl $BLAS_LIBS $LIBS $FLIBS
12
dnl in that order. FLIBS is the output variable of the
13
dnl AC_F77_LIBRARY_LDFLAGS macro (called if necessary by TAC_BLAS),
14
dnl and is sometimes necessary in order to link with F77 libraries.
15
dnl Users will also need to use AC_F77_DUMMY_MAIN (see the autoconf
16
dnl manual), for the same reason.
18
dnl Many libraries are searched for, from ATLAS to CXML to ESSL.
19
dnl The user may also use --with-blas=<lib> in order to use some
20
dnl specific BLAS library <lib>.
22
dnl ACTION-IF-FOUND is a list of shell commands to run if a BLAS
23
dnl library is found, and ACTION-IF-NOT-FOUND is a list of commands
24
dnl to run it if it is not found. If ACTION-IF-FOUND is not specified,
25
dnl the default action will define HAVE_BLAS.
27
dnl This macro requires autoconf 2.50 or later.
29
dnl @version $Id: tac_blas.m4,v 1.1 2008/01/01 03:40:04 jmwille Exp $
30
dnl @author Steven G. Johnson <stevenj@alum.mit.edu>
32
dnl Edited by Jim Willenbring on 5-14-2004 to check for dgemm instead of
34
dnl Edited by Jim Willenbring on 4-17-2006 to stop looking for BLAS if
35
dnl a specific BLAS library specified by a user cannot be used.
36
dnl Edited by Jim Willenbring on 12-5-2007 and renamed from ACX_BLAS
37
dnl to TAC_BLAS. Modified the macro to stop using the Fortran
38
dnl name-mangling provided by AC_F77_FUNC. Instead, we now try
39
dnl lowercase, lowercase_, UPPERCASE, and UPPERCASE_ and then
40
dnl define a macro F77_BLAS_MANGLE that provides the name-mangling
41
dnl scheme used by the BLAS library. This change was made because
42
dnl the BLAS library on a system does not need to use the same
43
dnl name-mangling as the compiler and we have an option to build
44
dnl Trilinos without a Fortran compiler.
47
AC_DEFUN([TAC_BLAS], [
49
AC_REQUIRE([AC_F77_LIBRARY_LDFLAGS])
53
[AC_HELP_STRING([--with-blas=<lib>], [use BLAS library <lib>])])
56
no) tac_blas_ok=disable ;;
57
-* | */* | *.a | *.so | *.so.* | *.o) BLAS_LIBS="$with_blas" ;;
58
*) BLAS_LIBS="-l$with_blas" ;;
61
tac_blas_save_LIBS="$LIBS"
64
# First, check BLAS_LIBS environment variable
65
if test $tac_blas_ok = no; then
66
if test "x$BLAS_LIBS" != x; then
67
save_LIBS="$LIBS"; LIBS="$BLAS_LIBS $LIBS"
69
AC_MSG_CHECKING([for dgemm_ in $BLAS_LIBS])
70
AC_TRY_LINK_FUNC(dgemm_, [tac_blas_ok=yes])
71
AC_MSG_RESULT($tac_blas_ok)
73
if test $tac_blas_ok = yes; then
74
AC_LANG_PUSH(Fortran 77)
75
AC_DEFINE([F77_BLAS_MANGLE(name,NAME)], [name ## _], [Define the Fortran name mangling to be used for the BLAS])
76
AC_LANG_POP(Fortran 77)
77
ac_cv_use_blas_mangling=lowercaseUnderscore
79
AC_MSG_CHECKING([for dgemm in $BLAS_LIBS])
80
AC_TRY_LINK_FUNC(dgemm, [tac_blas_ok=yes])
81
AC_MSG_RESULT($tac_blas_ok)
83
if test $tac_blas_ok = yes; then
84
AC_LANG_PUSH(Fortran 77)
85
AC_DEFINE([F77_BLAS_MANGLE(name,NAME)], [name], [Define the Fortran name mangling to be used for the BLAS])
86
AC_LANG_POP(Fortran 77)
87
ac_cv_use_blas_mangling=lowercaseNoUnderscore
89
AC_MSG_CHECKING([for DGEMM in $BLAS_LIBS])
90
AC_TRY_LINK_FUNC(DGEMM, [tac_blas_ok=yes])
91
AC_MSG_RESULT($tac_blas_ok)
92
if test $tac_blas_ok = yes; then
93
AC_LANG_PUSH(Fortran 77)
94
AC_DEFINE([F77_BLAS_MANGLE(name,NAME)], [NAME], [Define the Fortran name mangling to be used for the BLAS])
95
AC_LANG_POP(Fortran 77)
96
ac_cv_use_blas_mangling=uppercaseNoUnderscore
99
AC_MSG_CHECKING([for DGEMM_ in $BLAS_LIBS])
100
AC_TRY_LINK_FUNC(DGEMM_, [tac_blas_ok=yes], [user_spec_blas_failed=yes])
101
AC_MSG_RESULT($tac_blas_ok)
102
if test $tac_blas_ok = yes; then
103
AC_LANG_PUSH(Fortran 77)
104
AC_DEFINE([F77_BLAS_MANGLE(name,NAME)], [NAME ## _], [Define the Fortran name mangling to be used for the BLAS])
105
AC_LANG_POP(Fortran 77)
106
ac_cv_use_blas_mangling=uppercaseUnderscore
117
# If the user specified a blas library that could not be used we will
118
# halt the search process rather than risk finding a blas library that
119
# the user did not specify.
121
if test "x$user_spec_blas_failed" != xyes; then
123
# BLAS linked to by default? (happens on some supercomputers)
124
if test $tac_blas_ok = no; then
125
save_LIBS="$LIBS"; LIBS="$LIBS"
126
AC_CHECK_FUNC(dgemm_, [tac_blas_ok=yes])
127
if test $tac_blas_ok = yes; then
128
AC_LANG_PUSH(Fortran 77)
129
AC_DEFINE([F77_BLAS_MANGLE(name,NAME)], [name ## _], [Define the Fortran name mangling to be used for the BLAS])
130
AC_LANG_POP(Fortran 77)
131
ac_cv_use_blas_mangling=lowercaseUnderscore
133
AC_CHECK_FUNC(dgemm, [tac_blas_ok=yes])
134
if test $tac_blas_ok = yes; then
135
AC_LANG_PUSH(Fortran 77)
136
AC_DEFINE([F77_BLAS_MANGLE(name,NAME)], [name], [Define the Fortran name mangling to be used for the BLAS])
137
AC_LANG_POP(Fortran 77)
138
ac_cv_use_blas_mangling=lowercaseNoUnderscore
140
AC_CHECK_FUNC(DGEMM, [tac_blas_ok=yes])
141
if test $tac_blas_ok = yes; then
142
AC_LANG_PUSH(Fortran 77)
143
AC_DEFINE([F77_BLAS_MANGLE(name,NAME)], [NAME], [Define the Fortran name mangling to be used for the BLAS])
144
AC_LANG_POP(Fortran 77)
145
ac_cv_use_blas_mangling=uppercaseNoUnderscore
147
AC_CHECK_FUNC(DGEMM_, [tac_blas_ok=yes])
148
if test $tac_blas_ok = yes; then
149
AC_LANG_PUSH(Fortran 77)
150
AC_DEFINE([F77_BLAS_MANGLE(name,NAME)], [NAME ## _], [Define the Fortran name mangling to be used for the BLAS])
151
AC_LANG_POP(Fortran 77)
152
ac_cv_use_blas_mangling=uppercaseUnderscore
161
# BLAS in ATLAS library? (http://math-atlas.sourceforge.net/)
162
if test $tac_blas_ok = no; then
163
AC_CHECK_LIB(atlas, ATL_xerbla,
164
[AC_CHECK_LIB(f77blas, dgemm_,
165
[AC_CHECK_LIB(cblas, cblas_dgemm,
167
BLAS_LIBS="-lcblas -lf77blas -latlas"],
168
[], [-lf77blas -latlas])],
170
if test $tac_blas_ok = yes; then
171
AC_LANG_PUSH(Fortran 77)
172
AC_DEFINE([F77_BLAS_MANGLE(name,NAME)], [name ## _], [Define the Fortran name mangling to be used for the BLAS])
173
AC_LANG_POP(Fortran 77)
174
ac_cv_use_blas_mangling=lowercaseUnderscore
176
AC_CHECK_LIB(atlas, ATL_xerbla,
177
[AC_CHECK_LIB(f77blas, dgemm,
178
[AC_CHECK_LIB(cblas, cblas_dgemm,
180
BLAS_LIBS="-lcblas -lf77blas -latlas"],
181
[], [-lf77blas -latlas])],
183
if test $tac_blas_ok = yes; then
184
AC_LANG_PUSH(Fortran 77)
185
AC_DEFINE([F77_BLAS_MANGLE(name,NAME)], [name], [Define the Fortran name mangling to be used for the BLAS])
186
AC_LANG_POP(Fortran 77)
187
ac_cv_use_blas_mangling=lowercaseNoUnderscore
189
AC_CHECK_LIB(atlas, ATL_xerbla,
190
[AC_CHECK_LIB(f77blas, DGEMM,
191
[AC_CHECK_LIB(cblas, cblas_dgemm,
193
BLAS_LIBS="-lcblas -lf77blas -latlas"],
194
[], [-lf77blas -latlas])],
196
if test $tac_blas_ok = yes; then
197
AC_LANG_PUSH(Fortran 77)
198
AC_DEFINE([F77_BLAS_MANGLE(name,NAME)], [NAME], [Define the Fortran name mangling to be used for the BLAS])
199
AC_LANG_POP(Fortran 77)
200
ac_cv_use_blas_mangling=uppercaseNoUnderscore
202
AC_CHECK_LIB(atlas, ATL_xerbla,
203
[AC_CHECK_LIB(f77blas, DGEMM_,
204
[AC_CHECK_LIB(cblas, cblas_dgemm,
206
BLAS_LIBS="-lcblas -lf77blas -latlas"],
207
[], [-lf77blas -latlas])],
209
if test $tac_blas_ok = yes; then
210
AC_LANG_PUSH(Fortran 77)
211
AC_DEFINE([F77_BLAS_MANGLE(name,NAME)], [NAME ## _], [Define the Fortran name mangling to be used for the BLAS])
212
AC_LANG_POP(Fortran 77)
213
ac_cv_use_blas_mangling=uppercaseUnderscore
221
# BLAS in PhiPACK libraries? (requires generic BLAS lib, too)
222
if test $tac_blas_ok = no; then
223
AC_CHECK_LIB(blas, dgemm_,
224
[AC_CHECK_LIB(dgemm, dgemm_,
225
[AC_CHECK_LIB(sgemm, sgemm_,
226
[tac_blas_ok=yes; BLAS_LIBS="-lsgemm -ldgemm -lblas"],
229
if test $tac_blas_ok = yes; then
230
AC_LANG_PUSH(Fortran 77)
231
AC_DEFINE([F77_BLAS_MANGLE(name,NAME)], [name ## _], [Define the Fortran name mangling to be used for the BLAS])
232
AC_LANG_POP(Fortran 77)
233
ac_cv_use_blas_mangling=lowercaseUnderscore
235
AC_CHECK_LIB(blas, dgemm,
236
[AC_CHECK_LIB(dgemm, dgemm,
237
[AC_CHECK_LIB(sgemm, sgemm,
238
[tac_blas_ok=yes; BLAS_LIBS="-lsgemm -ldgemm -lblas"],
241
if test $tac_blas_ok = yes; then
242
AC_LANG_PUSH(Fortran 77)
243
AC_DEFINE([F77_BLAS_MANGLE(name,NAME)], [name], [Define the Fortran name mangling to be used for the BLAS])
244
AC_LANG_POP(Fortran 77)
245
ac_cv_use_blas_mangling=lowercaseNoUnderscore
247
AC_CHECK_LIB(blas, DGEMM,
248
[AC_CHECK_LIB(dgemm, DGEMM,
249
[AC_CHECK_LIB(sgemm, SGEMM,
250
[tac_blas_ok=yes; BLAS_LIBS="-lsgemm -ldgemm -lblas"],
253
if test $tac_blas_ok = yes; then
254
AC_LANG_PUSH(Fortran 77)
255
AC_DEFINE([F77_BLAS_MANGLE(name,NAME)], [NAME], [Define the Fortran name mangling to be used for the BLAS])
256
AC_LANG_POP(Fortran 77)
257
ac_cv_use_blas_mangling=uppercaseNoUnderscore
259
AC_CHECK_LIB(blas, DGEMM_,
260
[AC_CHECK_LIB(dgemm, DGEMM_,
261
[AC_CHECK_LIB(sgemm, SGEMM_,
262
[tac_blas_ok=yes; BLAS_LIBS="-lsgemm -ldgemm -lblas"],
265
if test $tac_blas_ok = yes; then
266
AC_LANG_PUSH(Fortran 77)
267
AC_DEFINE([F77_BLAS_MANGLE(name,NAME)], [NAME ## _], [Define the Fortran name mangling to be used for the BLAS])
268
AC_LANG_POP(Fortran 77)
269
ac_cv_use_blas_mangling=uppercaseUnderscore
277
# BLAS in Alpha CXML library?
278
if test $tac_blas_ok = no; then
279
AC_CHECK_LIB(cxml, dgemm_, [tac_blas_ok=yes;BLAS_LIBS="-lcxml"])
280
if test $tac_blas_ok = yes; then
281
AC_LANG_PUSH(Fortran 77)
282
AC_DEFINE([F77_BLAS_MANGLE(name,NAME)], [name ## _], [Define the Fortran name mangling to be used for the BLAS])
283
AC_LANG_POP(Fortran 77)
284
ac_cv_use_blas_mangling=lowercaseUnderscore
286
AC_CHECK_LIB(cxml, dgemm, [tac_blas_ok=yes;BLAS_LIBS="-lcxml"])
287
if test $tac_blas_ok = yes; then
288
AC_LANG_PUSH(Fortran 77)
289
AC_DEFINE([F77_BLAS_MANGLE(name,NAME)], [name], [Define the Fortran name mangling to be used for the BLAS])
290
AC_LANG_POP(Fortran 77)
291
ac_cv_use_blas_mangling=lowercaseNoUnderscore
293
AC_CHECK_LIB(cxml, DGEMM, [tac_blas_ok=yes;BLAS_LIBS="-lcxml"])
294
if test $tac_blas_ok = yes; then
295
AC_LANG_PUSH(Fortran 77)
296
AC_DEFINE([F77_BLAS_MANGLE(name,NAME)], [NAME], [Define the Fortran name mangling to be used for the BLAS])
297
AC_LANG_POP(Fortran 77)
298
ac_cv_use_blas_mangling=uppercaseNoUnderscore
300
AC_CHECK_LIB(cxml, DGEMM_, [tac_blas_ok=yes;BLAS_LIBS="-lcxml"])
301
if test $tac_blas_ok = yes; then
302
AC_LANG_PUSH(Fortran 77)
303
AC_DEFINE([F77_BLAS_MANGLE(name,NAME)], [NAME ## _], [Define the Fortran name mangling to be used for the BLAS])
304
AC_LANG_POP(Fortran 77)
305
ac_cv_use_blas_mangling=uppercaseUnderscore
313
# BLAS in Alpha DXML library? (now called CXML, see above)
314
if test $tac_blas_ok = no; then
315
AC_CHECK_LIB(dxml, dgemm_, [tac_blas_ok=yes;BLAS_LIBS="-ldxml"])
316
if test $tac_blas_ok = yes; then
317
AC_LANG_PUSH(Fortran 77)
318
AC_DEFINE([F77_BLAS_MANGLE(name,NAME)], [name ## _], [Define the Fortran name mangling to be used for the BLAS])
319
AC_LANG_POP(Fortran 77)
320
ac_cv_use_blas_mangling=lowercaseUnderscore
322
AC_CHECK_LIB(dxml, dgemm, [tac_blas_ok=yes;BLAS_LIBS="-ldxml"])
323
if test $tac_blas_ok = yes; then
324
AC_LANG_PUSH(Fortran 77)
325
AC_DEFINE([F77_BLAS_MANGLE(name,NAME)], [name], [Define the Fortran name mangling to be used for the BLAS])
326
AC_LANG_POP(Fortran 77)
327
ac_cv_use_blas_mangling=lowercaseNoUnderscore
329
AC_CHECK_LIB(dxml, DGEMM, [tac_blas_ok=yes;BLAS_LIBS="-ldxml"])
330
if test $tac_blas_ok = yes; then
331
AC_LANG_PUSH(Fortran 77)
332
AC_DEFINE([F77_BLAS_MANGLE(name,NAME)], [NAME], [Define the Fortran name mangling to be used for the BLAS])
333
AC_LANG_POP(Fortran 77)
334
ac_cv_use_blas_mangling=uppercaseNoUnderscore
336
AC_CHECK_LIB(dxml, DGEMM_, [tac_blas_ok=yes;BLAS_LIBS="-ldxml"])
337
if test $tac_blas_ok = yes; then
338
AC_LANG_PUSH(Fortran 77)
339
AC_DEFINE([F77_BLAS_MANGLE(name,NAME)], [NAME ## _], [Define the Fortran name mangling to be used for the BLAS])
340
AC_LANG_POP(Fortran 77)
341
ac_cv_use_blas_mangling=uppercaseUnderscore
349
# BLAS in Sun Performance library?
350
if test $tac_blas_ok = no; then
351
if test "x$GCC" != xyes; then # only works with Sun CC
352
AC_CHECK_LIB(sunmath, acosp,
353
[AC_CHECK_LIB(sunperf, dgemm_,
354
[BLAS_LIBS="-xlic_lib=sunperf -lsunmath"
355
tac_blas_ok=yes],[],[-lsunmath])])
356
if test $tac_blas_ok = yes; then
357
AC_LANG_PUSH(Fortran 77)
358
AC_DEFINE([F77_BLAS_MANGLE(name,NAME)], [name ## _], [Define the Fortran name mangling to be used for the BLAS])
359
AC_LANG_POP(Fortran 77)
360
ac_cv_use_blas_mangling=lowercaseUnderscore
362
AC_CHECK_LIB(sunmath, acosp,
363
[AC_CHECK_LIB(sunperf, dgemm,
364
[BLAS_LIBS="-xlic_lib=sunperf -lsunmath"
365
tac_blas_ok=yes],[],[-lsunmath])])
366
if test $tac_blas_ok = yes; then
367
AC_LANG_PUSH(Fortran 77)
368
AC_DEFINE([F77_BLAS_MANGLE(name,NAME)], [name], [Define the Fortran name mangling to be used for the BLAS])
369
AC_LANG_POP(Fortran 77)
370
ac_cv_use_blas_mangling=lowercaseNoUnderscore
372
AC_CHECK_LIB(sunmath, acosp,
373
[AC_CHECK_LIB(sunperf, DGEMM,
374
[BLAS_LIBS="-xlic_lib=sunperf -lsunmath"
375
tac_blas_ok=yes],[],[-lsunmath])])
376
if test $tac_blas_ok = yes; then
377
AC_LANG_PUSH(Fortran 77)
378
AC_DEFINE([F77_BLAS_MANGLE(name,NAME)], [NAME], [Define the Fortran name mangling to be used for the BLAS])
379
AC_LANG_POP(Fortran 77)
380
ac_cv_use_blas_mangling=uppercaseNoUnderscore
382
AC_CHECK_LIB(sunmath, acosp,
383
[AC_CHECK_LIB(sunperf, DGEMM_,
384
[BLAS_LIBS="-xlic_lib=sunperf -lsunmath"
385
tac_blas_ok=yes],[],[-lsunmath])])
386
if test $tac_blas_ok = yes; then
387
AC_LANG_PUSH(Fortran 77)
388
AC_DEFINE([F77_BLAS_MANGLE(name,NAME)], [NAME ## _], [Define the Fortran name mangling to be used for the BLAS])
389
AC_LANG_POP(Fortran 77)
390
ac_cv_use_blas_mangling=uppercaseUnderscore
398
# BLAS in SCSL library? (SGI/Cray Scientific Library)
399
if test $tac_blas_ok = no; then
400
AC_CHECK_LIB(scs, dgemm_, [tac_blas_ok=yes; BLAS_LIBS="-lscs"])
401
if test $tac_blas_ok = yes; then
402
AC_LANG_PUSH(Fortran 77)
403
AC_DEFINE([F77_BLAS_MANGLE(name,NAME)], [name ## _], [Define the Fortran name mangling to be used for the BLAS])
404
AC_LANG_POP(Fortran 77)
405
ac_cv_use_blas_mangling=lowercaseUnderscore
407
AC_CHECK_LIB(scs, dgemm, [tac_blas_ok=yes; BLAS_LIBS="-lscs"])
408
if test $tac_blas_ok = yes; then
409
AC_LANG_PUSH(Fortran 77)
410
AC_DEFINE([F77_BLAS_MANGLE(name,NAME)], [name], [Define the Fortran name mangling to be used for the BLAS])i
411
AC_LANG_POP(Fortran 77)
412
ac_cv_use_blas_mangling=lowercaseNoUnderscore
414
AC_CHECK_LIB(scs, DGEMM, [tac_blas_ok=yes; BLAS_LIBS="-lscs"])
415
if test $tac_blas_ok = yes; then
416
AC_LANG_PUSH(Fortran 77)
417
AC_DEFINE([F77_BLAS_MANGLE(name,NAME)], [NAME], [Define the Fortran name mangling to be used for the BLAS])
418
AC_LANG_POP(Fortran 77)
419
ac_cv_use_blas_mangling=uppercaseNoUnderscore
421
AC_CHECK_LIB(scs, DGEMM_, [tac_blas_ok=yes; BLAS_LIBS="-lscs"])
422
if test $tac_blas_ok = yes; then
423
AC_LANG_PUSH(Fortran 77)
424
AC_DEFINE([F77_BLAS_MANGLE(name,NAME)], [NAME ## _], [Define the Fortran name mangling to be used for the BLAS])
425
AC_LANG_POP(Fortran 77)
426
ac_cv_use_blas_mangling=uppercaseUnderscore
433
# BLAS in SGIMATH library?
434
if test $tac_blas_ok = no; then
435
AC_CHECK_LIB(complib.sgimath, dgemm_,
436
[tac_blas_ok=yes; BLAS_LIBS="-lcomplib.sgimath"])
437
if test $tac_blas_ok = yes; then
438
AC_LANG_PUSH(Fortran 77)
439
AC_DEFINE([F77_BLAS_MANGLE(name,NAME)], [name ## _], [Define the Fortran name mangling to be used for the BLAS])
440
AC_LANG_POP(Fortran 77)
441
ac_cv_use_blas_mangling=lowercaseUnderscore
443
AC_CHECK_LIB(complib.sgimath, dgemm,
444
[tac_blas_ok=yes; BLAS_LIBS="-lcomplib.sgimath"])
445
if test $tac_blas_ok = yes; then
446
AC_LANG_PUSH(Fortran 77)
447
AC_DEFINE([F77_BLAS_MANGLE(name,NAME)], [name], [Define the Fortran name mangling to be used for the BLAS])
448
AC_LANG_POP(Fortran 77)
449
ac_cv_use_blas_mangling=lowercaseNoUnderscore
451
AC_CHECK_LIB(complib.sgimath, DGEMM,
452
[tac_blas_ok=yes; BLAS_LIBS="-lcomplib.sgimath"])
453
if test $tac_blas_ok = yes; then
454
AC_LANG_PUSH(Fortran 77)
455
AC_DEFINE([F77_BLAS_MANGLE(name,NAME)], [NAME], [Define the Fortran name mangling to be used for the BLAS])
456
AC_LANG_POP(Fortran 77)
457
ac_cv_use_blas_mangling=uppercaseNoUnderscore
459
AC_CHECK_LIB(complib.sgimath, DGEMM_,
460
[tac_blas_ok=yes; BLAS_LIBS="-lcomplib.sgimath"])
461
if test $tac_blas_ok = yes; then
462
AC_LANG_PUSH(Fortran 77)
463
AC_DEFINE([F77_BLAS_MANGLE(name,NAME)], [NAME ## _], [Define the Fortran name mangling to be used for the BLAS])
464
AC_LANG_POP(Fortran 77)
465
ac_cv_use_blas_mangling=uppercaseUnderscore
472
# BLAS in IBM ESSL library? (requires generic BLAS lib, too)
473
if test $tac_blas_ok = no; then
474
AC_CHECK_LIB(blas, dgemm_,
475
[AC_CHECK_LIB(essl, dgemm_,
476
[tac_blas_ok=yes; BLAS_LIBS="-lessl -lblas"],
477
[], [-lblas $FLIBS])])
478
if test $tac_blas_ok = yes; then
479
AC_LANG_PUSH(Fortran 77)
480
AC_DEFINE([F77_BLAS_MANGLE(name,NAME)], [name ## _], [Define the Fortran name mangling to be used for the BLAS])
481
AC_LANG_POP(Fortran 77)
482
ac_cv_use_blas_mangling=lowercaseUnderscore
484
AC_CHECK_LIB(blas, dgemm,
485
[AC_CHECK_LIB(essl, dgemm,
486
[tac_blas_ok=yes; BLAS_LIBS="-lessl -lblas"],
487
[], [-lblas $FLIBS])])
488
if test $tac_blas_ok = yes; then
489
AC_LANG_PUSH(Fortran 77)
490
AC_DEFINE([F77_BLAS_MANGLE(name,NAME)], [name], [Define the Fortran name mangling to be used for the BLAS])
491
AC_LANG_POP(Fortran 77)
492
ac_cv_use_blas_mangling=lowercaseNoUnderscore
494
AC_CHECK_LIB(blas, DGEMM,
495
[AC_CHECK_LIB(essl, DGEMM,
496
[tac_blas_ok=yes; BLAS_LIBS="-lessl -lblas"],
497
[], [-lblas $FLIBS])])
498
if test $tac_blas_ok = yes; then
499
AC_LANG_PUSH(Fortran 77)
500
AC_DEFINE([F77_BLAS_MANGLE(name,NAME)], [NAME], [Define the Fortran name mangling to be used for the BLAS])
501
AC_LANG_POP(Fortran 77)
502
ac_cv_use_blas_mangling=uppercaseNoUnderscore
504
AC_CHECK_LIB(blas, DGEMM_,
505
[AC_CHECK_LIB(essl, DGEMM_,
506
[tac_blas_ok=yes; BLAS_LIBS="-lessl -lblas"],
507
[], [-lblas $FLIBS])])
508
if test $tac_blas_ok = yes; then
509
AC_LANG_PUSH(Fortran 77)
510
AC_DEFINE([F77_BLAS_MANGLE(name,NAME)], [NAME ## _], [Define the Fortran name mangling to be used for the BLAS])
511
AC_LANG_POP(Fortran 77)
512
ac_cv_use_blas_mangling=uppercaseUnderscore
519
# Generic BLAS library?
520
if test $tac_blas_ok = no; then
521
AC_CHECK_LIB(blas, dgemm_, [tac_blas_ok=yes; BLAS_LIBS="-lblas"])
522
if test $tac_blas_ok = yes; then
523
AC_LANG_PUSH(Fortran 77)
524
AC_DEFINE([F77_BLAS_MANGLE(name,NAME)], [name ## _], [Define the Fortran name mangling to be used for the BLAS])
525
AC_LANG_POP(Fortran 77)
526
ac_cv_use_blas_mangling=lowercaseUnderscore
528
AC_CHECK_LIB(blas, dgemm, [tac_blas_ok=yes; BLAS_LIBS="-lblas"])
529
if test $tac_blas_ok = yes; then
530
AC_LANG_PUSH(Fortran 77)
531
AC_DEFINE([F77_BLAS_MANGLE(name,NAME)], [name], [Define the Fortran name mangling to be used for the BLAS])
532
AC_LANG_POP(Fortran 77)
533
ac_cv_use_blas_mangling=lowercaseNoUnderscore
535
AC_CHECK_LIB(blas, DGEMM, [tac_blas_ok=yes; BLAS_LIBS="-lblas"])
536
if test $tac_blas_ok = yes; then
537
AC_LANG_PUSH(Fortran 77)
538
AC_DEFINE([F77_BLAS_MANGLE(name,NAME)], [NAME], [Define the Fortran name mangling to be used for the BLAS])
539
AC_LANG_POP(Fortran 77)
540
ac_cv_use_blas_mangling=uppercaseNoUnderscore
542
AC_CHECK_LIB(blas, DGEMM_, [tac_blas_ok=yes; BLAS_LIBS="-lblas"])
543
if test $tac_blas_ok = yes; then
544
AC_LANG_PUSH(Fortran 77)
545
AC_DEFINE([F77_BLAS_MANGLE(name,NAME)], [NAME ## _], [Define the Fortran name mangling to be used for the BLAS])
546
AC_LANG_POP(Fortran 77)
547
ac_cv_use_blas_mangling=uppercaseUnderscore
556
fi # If the user specified library wasn't found, we skipped the remaining
559
LIBS="$tac_blas_save_LIBS"
561
# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
562
if test x"$tac_blas_ok" = xyes; then
563
ifelse([$1],,AC_DEFINE(HAVE_BLAS,1,[Define if you have a BLAS library.]),[$1])