~chaffra/+junk/trilinos

« back to all changes in this revision

Viewing changes to packages/amesos/config/tac_blas.m4

  • Committer: Bazaar Package Importer
  • Author(s): Christophe Prud'homme, Christophe Prud'homme, Johannes Ring
  • Date: 2009-12-13 12:53:22 UTC
  • mfrom: (5.1.2 sid)
  • Revision ID: james.westby@ubuntu.com-20091213125322-in0nrdjc55deqsw9
Tags: 10.0.3.dfsg-1
[Christophe Prud'homme]
* New upstream release

[Johannes Ring]
* debian/patches/libname.patch: Add prefix 'libtrilinos_' to all
  libraries. 
* debian/patches/soname.patch: Add soversion to libraries.
* debian/watch: Update download URL.
* debian/control:
  - Remove python-numeric from Build-Depends (virtual package).
  - Remove automake and autotools from Build-Depends and add cmake to
    reflect switch to CMake.
  - Add python-support to Build-Depends.
* debian/rules: 
  - Cleanup and updates for switch to CMake.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
dnl @synopsis TAC_BLAS([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
2
 
dnl
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.
7
 
dnl
8
 
dnl To link with BLAS, you should link with:
9
 
dnl
10
 
dnl     $BLAS_LIBS $LIBS $FLIBS
11
 
dnl
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.
17
 
dnl
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>. 
21
 
dnl
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.
26
 
dnl
27
 
dnl This macro requires autoconf 2.50 or later.
28
 
dnl
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>
31
 
dnl
32
 
dnl Edited by Jim Willenbring on 5-14-2004 to check for dgemm instead of
33
 
dnl sgemm.
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.
45
 
 
46
 
 
47
 
AC_DEFUN([TAC_BLAS], [
48
 
AC_PREREQ(2.50)
49
 
AC_REQUIRE([AC_F77_LIBRARY_LDFLAGS])
50
 
tac_blas_ok=no
51
 
 
52
 
AC_ARG_WITH(blas,
53
 
        [AC_HELP_STRING([--with-blas=<lib>], [use BLAS library <lib>])])
54
 
case $with_blas in
55
 
        yes | "") ;;
56
 
        no) tac_blas_ok=disable ;;
57
 
        -* | */* | *.a | *.so | *.so.* | *.o) BLAS_LIBS="$with_blas" ;;
58
 
        *) BLAS_LIBS="-l$with_blas" ;;
59
 
esac
60
 
 
61
 
tac_blas_save_LIBS="$LIBS"
62
 
LIBS="$LIBS $FLIBS"
63
 
 
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"
68
 
 
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)
72
 
 
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
78
 
        else
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)
82
 
        
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
88
 
                else
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
97
 
                        else
98
 
 
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
107
 
                                fi
108
 
                        fi
109
 
                fi
110
 
        fi
111
 
 
112
 
        LIBS="$save_LIBS"
113
 
 
114
 
fi
115
 
fi
116
 
 
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.
120
 
 
121
 
if test "x$user_spec_blas_failed" != xyes; then
122
 
 
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
132
 
        else
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
139
 
                else
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
146
 
                        else
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
153
 
                                fi
154
 
                        fi
155
 
                fi
156
 
        fi
157
 
 
158
 
        LIBS="$save_LIBS"
159
 
fi
160
 
 
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,
166
 
                        [tac_blas_ok=yes
167
 
                        BLAS_LIBS="-lcblas -lf77blas -latlas"],
168
 
                        [], [-lf77blas -latlas])],
169
 
                        [], [-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
175
 
        else
176
 
                AC_CHECK_LIB(atlas, ATL_xerbla,
177
 
                        [AC_CHECK_LIB(f77blas, dgemm,
178
 
                        [AC_CHECK_LIB(cblas, cblas_dgemm,
179
 
                                [tac_blas_ok=yes
180
 
                                BLAS_LIBS="-lcblas -lf77blas -latlas"],
181
 
                                [], [-lf77blas -latlas])],
182
 
                                [], [-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
188
 
                else
189
 
                        AC_CHECK_LIB(atlas, ATL_xerbla,
190
 
                                [AC_CHECK_LIB(f77blas, DGEMM,
191
 
                                [AC_CHECK_LIB(cblas, cblas_dgemm,
192
 
                                        [tac_blas_ok=yes
193
 
                                        BLAS_LIBS="-lcblas -lf77blas -latlas"],
194
 
                                        [], [-lf77blas -latlas])],
195
 
                                        [], [-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
201
 
                        else
202
 
                                AC_CHECK_LIB(atlas, ATL_xerbla,
203
 
                                        [AC_CHECK_LIB(f77blas, DGEMM_,
204
 
                                        [AC_CHECK_LIB(cblas, cblas_dgemm,
205
 
                                                [tac_blas_ok=yes
206
 
                                                BLAS_LIBS="-lcblas -lf77blas -latlas"],
207
 
                                                [], [-lf77blas -latlas])],
208
 
                                                [], [-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
214
 
                                fi
215
 
                        fi
216
 
                fi
217
 
        fi
218
 
 
219
 
fi
220
 
 
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"],
227
 
                        [], [-lblas])],
228
 
                        [], [-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
234
 
        else
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"],
239
 
                                [], [-lblas])],
240
 
                                [], [-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
246
 
                else
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"],
251
 
                                        [], [-lblas])],
252
 
                                        [], [-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
258
 
                        else
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"],
263
 
                                                [], [-lblas])],
264
 
                                                [], [-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
270
 
                                fi
271
 
                        fi
272
 
                fi
273
 
        fi
274
 
 
275
 
fi
276
 
 
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
285
 
        else
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
292
 
                else
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
299
 
                        else
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
306
 
                                fi
307
 
                        fi
308
 
                fi
309
 
        fi
310
 
 
311
 
fi
312
 
 
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
321
 
        else
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
328
 
                else
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
335
 
                        else
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
342
 
                                fi
343
 
                        fi
344
 
                fi
345
 
        fi
346
 
 
347
 
fi
348
 
 
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
361
 
                else
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
371
 
                        else
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
381
 
                                else
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
391
 
                                        fi
392
 
                                fi
393
 
                        fi
394
 
                fi
395
 
        fi
396
 
fi
397
 
 
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
406
 
        else
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
413
 
                else
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
420
 
                        else
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
427
 
                                fi
428
 
                        fi
429
 
                 fi
430
 
        fi
431
 
fi
432
 
 
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
442
 
        else
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
450
 
                else
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
458
 
                        else
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
466
 
                                fi
467
 
                        fi
468
 
                 fi
469
 
        fi
470
 
fi
471
 
 
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
483
 
        else
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
493
 
                else
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
503
 
                        else
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
513
 
                                fi
514
 
                        fi
515
 
                 fi
516
 
        fi
517
 
fi
518
 
 
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
527
 
        else
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
534
 
                else
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
541
 
                        else
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
548
 
                                fi
549
 
                        fi
550
 
                 fi
551
 
        fi
552
 
fi
553
 
 
554
 
AC_SUBST(BLAS_LIBS)
555
 
 
556
 
fi # If the user specified library wasn't found, we skipped the remaining
557
 
   # checks.
558
 
 
559
 
LIBS="$tac_blas_save_LIBS"
560
 
 
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])
564
 
        :
565
 
else
566
 
        tac_blas_ok=no
567
 
        $2
568
 
fi
569
 
])dnl TAC_BLAS