annotate m4/ax_blas.m4 @ 28240:2fb684dc2ec2

axis.m: Implement "fill" option for Matlab compatibility. * axis.m: Document that "fill" is a synonym for "normal". Place "vis3d" option in documentation table for modes which affect aspect ratio. Add strcmpi (opt, "fill") to decode opt and executed the same behavior as "normal".
author Rik <rik@octave.org>
date Fri, 24 Apr 2020 13:16:09 -0700
parents a3eb0d746042
children 9d2a4a270807
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
10951
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
1 # ===========================================================================
24893
a3eb0d746042 doc: use canonical https URLs for all external gnu.org references
Mike Miller <mtmiller@octave.org>
parents: 24534
diff changeset
2 # https://www.gnu.org/software/autoconf-archive/ax_blas.html
10951
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
3 # ===========================================================================
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
4 #
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
5 # SYNOPSIS
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
6 #
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
7 # AX_BLAS([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
8 #
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
9 # DESCRIPTION
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
10 #
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
11 # This macro looks for a library that implements the BLAS linear-algebra
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
12 # interface (see http://www.netlib.org/blas/). On success, it sets the
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
13 # BLAS_LIBS output variable to hold the requisite library linkages.
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
14 #
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
15 # To link with BLAS, you should link with:
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
16 #
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
17 # $BLAS_LIBS $LIBS $FLIBS
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
18 #
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
19 # in that order. FLIBS is the output variable of the
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
20 # AC_F77_LIBRARY_LDFLAGS macro (called if necessary by AX_BLAS), and is
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
21 # sometimes necessary in order to link with F77 libraries. Users will also
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
22 # need to use AC_F77_DUMMY_MAIN (see the autoconf manual), for the same
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
23 # reason.
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
24 #
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
25 # Many libraries are searched for, from ATLAS to CXML to ESSL. The user
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
26 # may also use --with-blas=<lib> in order to use some specific BLAS
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
27 # library <lib>. In order to link successfully, however, be aware that you
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
28 # will probably need to use the same Fortran compiler (which can be set
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
29 # via the F77 env. var.) as was used to compile the BLAS library.
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
30 #
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
31 # ACTION-IF-FOUND is a list of shell commands to run if a BLAS library is
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
32 # found, and ACTION-IF-NOT-FOUND is a list of commands to run it if it is
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
33 # not found. If ACTION-IF-FOUND is not specified, the default action will
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
34 # define HAVE_BLAS.
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
35 #
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
36 # LICENSE
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
37 #
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
38 # Copyright (c) 2008 Steven G. Johnson <stevenj@alum.mit.edu>
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
39 #
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
40 # This program is free software: you can redistribute it and/or modify it
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
41 # under the terms of the GNU General Public License as published by the
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
42 # Free Software Foundation, either version 3 of the License, or (at your
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
43 # option) any later version.
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
44 #
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
45 # This program is distributed in the hope that it will be useful, but
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
46 # WITHOUT ANY WARRANTY; without even the implied warranty of
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
47 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
48 # Public License for more details.
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
49 #
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
50 # You should have received a copy of the GNU General Public License along
24534
194eb4bd202b maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents: 19300
diff changeset
51 # with this program. If not, see <https://www.gnu.org/licenses/>.
10951
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
52 #
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
53 # As a special exception, the respective Autoconf Macro's copyright owner
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
54 # gives unlimited permission to copy, distribute and modify the configure
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
55 # scripts that are the output of Autoconf when processing the Macro. You
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
56 # need not follow the terms of the GNU General Public License when using
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
57 # or distributing such scripts, even though portions of the text of the
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
58 # Macro appear in them. The GNU General Public License (GPL) does govern
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
59 # all other use of the material that constitutes the Autoconf Macro.
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
60 #
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
61 # This special exception to the GPL applies to versions of the Autoconf
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
62 # Macro released by the Autoconf Archive. When you make and distribute a
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
63 # modified version of the Autoconf Macro, you may extend this special
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
64 # exception to the GPL to apply to your modified version as well.
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
65
19300
d6240c099a02 build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents: 15153
diff changeset
66 #serial 14
10951
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
67
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
68 AU_ALIAS([ACX_BLAS], [AX_BLAS])
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
69 AC_DEFUN([AX_BLAS], [
3887
7da18459c08b [project @ 2002-04-04 00:44:21 by jwe]
jwe
parents:
diff changeset
70 AC_PREREQ(2.50)
7da18459c08b [project @ 2002-04-04 00:44:21 by jwe]
jwe
parents:
diff changeset
71 AC_REQUIRE([AC_F77_LIBRARY_LDFLAGS])
19300
d6240c099a02 build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents: 15153
diff changeset
72 AC_REQUIRE([AC_CANONICAL_HOST])
10951
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
73 ax_blas_ok=no
3887
7da18459c08b [project @ 2002-04-04 00:44:21 by jwe]
jwe
parents:
diff changeset
74
7da18459c08b [project @ 2002-04-04 00:44:21 by jwe]
jwe
parents:
diff changeset
75 AC_ARG_WITH(blas,
5844
034cdbd34c0a [project @ 2006-06-07 15:38:58 by jwe]
jwe
parents: 4157
diff changeset
76 [AS_HELP_STRING([--with-blas=<lib>], [use BLAS library <lib>])])
3887
7da18459c08b [project @ 2002-04-04 00:44:21 by jwe]
jwe
parents:
diff changeset
77 case $with_blas in
7da18459c08b [project @ 2002-04-04 00:44:21 by jwe]
jwe
parents:
diff changeset
78 yes | "") ;;
10951
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
79 no) ax_blas_ok=disable ;;
3887
7da18459c08b [project @ 2002-04-04 00:44:21 by jwe]
jwe
parents:
diff changeset
80 -* | */* | *.a | *.so | *.so.* | *.o) BLAS_LIBS="$with_blas" ;;
7da18459c08b [project @ 2002-04-04 00:44:21 by jwe]
jwe
parents:
diff changeset
81 *) BLAS_LIBS="-l$with_blas" ;;
7da18459c08b [project @ 2002-04-04 00:44:21 by jwe]
jwe
parents:
diff changeset
82 esac
7da18459c08b [project @ 2002-04-04 00:44:21 by jwe]
jwe
parents:
diff changeset
83
7da18459c08b [project @ 2002-04-04 00:44:21 by jwe]
jwe
parents:
diff changeset
84 # Get fortran linker names of BLAS functions to check for.
10951
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
85 AC_F77_FUNC(sgemm)
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
86 AC_F77_FUNC(dgemm)
3887
7da18459c08b [project @ 2002-04-04 00:44:21 by jwe]
jwe
parents:
diff changeset
87
10951
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
88 ax_blas_save_LIBS="$LIBS"
3887
7da18459c08b [project @ 2002-04-04 00:44:21 by jwe]
jwe
parents:
diff changeset
89 LIBS="$LIBS $FLIBS"
7da18459c08b [project @ 2002-04-04 00:44:21 by jwe]
jwe
parents:
diff changeset
90
7da18459c08b [project @ 2002-04-04 00:44:21 by jwe]
jwe
parents:
diff changeset
91 # First, check BLAS_LIBS environment variable
10951
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
92 if test $ax_blas_ok = no; then
3887
7da18459c08b [project @ 2002-04-04 00:44:21 by jwe]
jwe
parents:
diff changeset
93 if test "x$BLAS_LIBS" != x; then
7da18459c08b [project @ 2002-04-04 00:44:21 by jwe]
jwe
parents:
diff changeset
94 save_LIBS="$LIBS"; LIBS="$BLAS_LIBS $LIBS"
7da18459c08b [project @ 2002-04-04 00:44:21 by jwe]
jwe
parents:
diff changeset
95 AC_MSG_CHECKING([for $sgemm in $BLAS_LIBS])
10951
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
96 AC_TRY_LINK_FUNC($sgemm, [ax_blas_ok=yes], [BLAS_LIBS=""])
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
97 AC_MSG_RESULT($ax_blas_ok)
3887
7da18459c08b [project @ 2002-04-04 00:44:21 by jwe]
jwe
parents:
diff changeset
98 LIBS="$save_LIBS"
7da18459c08b [project @ 2002-04-04 00:44:21 by jwe]
jwe
parents:
diff changeset
99 fi
7da18459c08b [project @ 2002-04-04 00:44:21 by jwe]
jwe
parents:
diff changeset
100 fi
7da18459c08b [project @ 2002-04-04 00:44:21 by jwe]
jwe
parents:
diff changeset
101
7da18459c08b [project @ 2002-04-04 00:44:21 by jwe]
jwe
parents:
diff changeset
102 # BLAS linked to by default? (happens on some supercomputers)
10951
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
103 if test $ax_blas_ok = no; then
3887
7da18459c08b [project @ 2002-04-04 00:44:21 by jwe]
jwe
parents:
diff changeset
104 save_LIBS="$LIBS"; LIBS="$LIBS"
11017
60141d49a38d update ax_blas
Jaroslav Hajek <highegg@gmail.com>
parents: 10951
diff changeset
105 AC_MSG_CHECKING([if $sgemm is being linked in already])
60141d49a38d update ax_blas
Jaroslav Hajek <highegg@gmail.com>
parents: 10951
diff changeset
106 AC_TRY_LINK_FUNC($sgemm, [ax_blas_ok=yes])
60141d49a38d update ax_blas
Jaroslav Hajek <highegg@gmail.com>
parents: 10951
diff changeset
107 AC_MSG_RESULT($ax_blas_ok)
3887
7da18459c08b [project @ 2002-04-04 00:44:21 by jwe]
jwe
parents:
diff changeset
108 LIBS="$save_LIBS"
7da18459c08b [project @ 2002-04-04 00:44:21 by jwe]
jwe
parents:
diff changeset
109 fi
7da18459c08b [project @ 2002-04-04 00:44:21 by jwe]
jwe
parents:
diff changeset
110
19300
d6240c099a02 build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents: 15153
diff changeset
111 # BLAS in OpenBLAS library? (http://xianyi.github.com/OpenBLAS/)
d6240c099a02 build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents: 15153
diff changeset
112 if test $ax_blas_ok = no; then
d6240c099a02 build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents: 15153
diff changeset
113 AC_CHECK_LIB(openblas, $sgemm, [ax_blas_ok=yes
d6240c099a02 build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents: 15153
diff changeset
114 BLAS_LIBS="-lopenblas"])
d6240c099a02 build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents: 15153
diff changeset
115 fi
d6240c099a02 build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents: 15153
diff changeset
116
3887
7da18459c08b [project @ 2002-04-04 00:44:21 by jwe]
jwe
parents:
diff changeset
117 # BLAS in ATLAS library? (http://math-atlas.sourceforge.net/)
10951
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
118 if test $ax_blas_ok = no; then
3887
7da18459c08b [project @ 2002-04-04 00:44:21 by jwe]
jwe
parents:
diff changeset
119 AC_CHECK_LIB(atlas, ATL_xerbla,
7da18459c08b [project @ 2002-04-04 00:44:21 by jwe]
jwe
parents:
diff changeset
120 [AC_CHECK_LIB(f77blas, $sgemm,
7da18459c08b [project @ 2002-04-04 00:44:21 by jwe]
jwe
parents:
diff changeset
121 [AC_CHECK_LIB(cblas, cblas_dgemm,
10951
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
122 [ax_blas_ok=yes
3887
7da18459c08b [project @ 2002-04-04 00:44:21 by jwe]
jwe
parents:
diff changeset
123 BLAS_LIBS="-lcblas -lf77blas -latlas"],
7da18459c08b [project @ 2002-04-04 00:44:21 by jwe]
jwe
parents:
diff changeset
124 [], [-lf77blas -latlas])],
7da18459c08b [project @ 2002-04-04 00:44:21 by jwe]
jwe
parents:
diff changeset
125 [], [-latlas])])
7da18459c08b [project @ 2002-04-04 00:44:21 by jwe]
jwe
parents:
diff changeset
126 fi
7da18459c08b [project @ 2002-04-04 00:44:21 by jwe]
jwe
parents:
diff changeset
127
7da18459c08b [project @ 2002-04-04 00:44:21 by jwe]
jwe
parents:
diff changeset
128 # BLAS in PhiPACK libraries? (requires generic BLAS lib, too)
10951
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
129 if test $ax_blas_ok = no; then
3887
7da18459c08b [project @ 2002-04-04 00:44:21 by jwe]
jwe
parents:
diff changeset
130 AC_CHECK_LIB(blas, $sgemm,
7da18459c08b [project @ 2002-04-04 00:44:21 by jwe]
jwe
parents:
diff changeset
131 [AC_CHECK_LIB(dgemm, $dgemm,
7da18459c08b [project @ 2002-04-04 00:44:21 by jwe]
jwe
parents:
diff changeset
132 [AC_CHECK_LIB(sgemm, $sgemm,
10951
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
133 [ax_blas_ok=yes; BLAS_LIBS="-lsgemm -ldgemm -lblas"],
3887
7da18459c08b [project @ 2002-04-04 00:44:21 by jwe]
jwe
parents:
diff changeset
134 [], [-lblas])],
7da18459c08b [project @ 2002-04-04 00:44:21 by jwe]
jwe
parents:
diff changeset
135 [], [-lblas])])
7da18459c08b [project @ 2002-04-04 00:44:21 by jwe]
jwe
parents:
diff changeset
136 fi
7da18459c08b [project @ 2002-04-04 00:44:21 by jwe]
jwe
parents:
diff changeset
137
10951
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
138 # BLAS in Intel MKL library?
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
139 if test $ax_blas_ok = no; then
19300
d6240c099a02 build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents: 15153
diff changeset
140 # MKL for gfortran
d6240c099a02 build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents: 15153
diff changeset
141 if test x"$ac_cv_fc_compiler_gnu" = xyes; then
d6240c099a02 build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents: 15153
diff changeset
142 # 64 bit
d6240c099a02 build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents: 15153
diff changeset
143 if test $host_cpu = x86_64; then
d6240c099a02 build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents: 15153
diff changeset
144 AC_CHECK_LIB(mkl_gf_lp64, $sgemm,
d6240c099a02 build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents: 15153
diff changeset
145 [ax_blas_ok=yes;BLAS_LIBS="-lmkl_gf_lp64 -lmkl_sequential -lmkl_core -lpthread"],,
d6240c099a02 build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents: 15153
diff changeset
146 [-lmkl_gf_lp64 -lmkl_sequential -lmkl_core -lpthread])
d6240c099a02 build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents: 15153
diff changeset
147 # 32 bit
d6240c099a02 build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents: 15153
diff changeset
148 elif test $host_cpu = i686; then
d6240c099a02 build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents: 15153
diff changeset
149 AC_CHECK_LIB(mkl_gf, $sgemm,
d6240c099a02 build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents: 15153
diff changeset
150 [ax_blas_ok=yes;BLAS_LIBS="-lmkl_gf -lmkl_sequential -lmkl_core -lpthread"],,
d6240c099a02 build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents: 15153
diff changeset
151 [-lmkl_gf -lmkl_sequential -lmkl_core -lpthread])
d6240c099a02 build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents: 15153
diff changeset
152 fi
d6240c099a02 build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents: 15153
diff changeset
153 # MKL for other compilers (Intel, PGI, ...?)
d6240c099a02 build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents: 15153
diff changeset
154 else
d6240c099a02 build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents: 15153
diff changeset
155 # 64-bit
d6240c099a02 build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents: 15153
diff changeset
156 if test $host_cpu = x86_64; then
d6240c099a02 build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents: 15153
diff changeset
157 AC_CHECK_LIB(mkl_intel_lp64, $sgemm,
d6240c099a02 build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents: 15153
diff changeset
158 [ax_blas_ok=yes;BLAS_LIBS="-lmkl_intel_lp64 -lmkl_sequential -lmkl_core -lpthread"],,
d6240c099a02 build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents: 15153
diff changeset
159 [-lmkl_intel_lp64 -lmkl_sequential -lmkl_core -lpthread])
d6240c099a02 build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents: 15153
diff changeset
160 # 32-bit
d6240c099a02 build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents: 15153
diff changeset
161 elif test $host_cpu = i686; then
d6240c099a02 build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents: 15153
diff changeset
162 AC_CHECK_LIB(mkl_intel, $sgemm,
d6240c099a02 build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents: 15153
diff changeset
163 [ax_blas_ok=yes;BLAS_LIBS="-lmkl_intel -lmkl_sequential -lmkl_core -lpthread"],,
d6240c099a02 build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents: 15153
diff changeset
164 [-lmkl_intel -lmkl_sequential -lmkl_core -lpthread])
d6240c099a02 build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents: 15153
diff changeset
165 fi
d6240c099a02 build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents: 15153
diff changeset
166 fi
d6240c099a02 build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents: 15153
diff changeset
167 fi
d6240c099a02 build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents: 15153
diff changeset
168 # Old versions of MKL
d6240c099a02 build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents: 15153
diff changeset
169 if test $ax_blas_ok = no; then
15153
ba431d1106e3 build: Update ax_XXX macros in m4 directory to newest versions.
Rik <rik@octave.org>
parents: 11017
diff changeset
170 AC_CHECK_LIB(mkl, $sgemm, [ax_blas_ok=yes;BLAS_LIBS="-lmkl -lguide -lpthread"],,[-lguide -lpthread])
10951
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
171 fi
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
172
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
173 # BLAS in Apple vecLib library?
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
174 if test $ax_blas_ok = no; then
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
175 save_LIBS="$LIBS"; LIBS="-framework vecLib $LIBS"
11017
60141d49a38d update ax_blas
Jaroslav Hajek <highegg@gmail.com>
parents: 10951
diff changeset
176 AC_MSG_CHECKING([for $sgemm in -framework vecLib])
60141d49a38d update ax_blas
Jaroslav Hajek <highegg@gmail.com>
parents: 10951
diff changeset
177 AC_TRY_LINK_FUNC($sgemm, [ax_blas_ok=yes;BLAS_LIBS="-framework vecLib"])
60141d49a38d update ax_blas
Jaroslav Hajek <highegg@gmail.com>
parents: 10951
diff changeset
178 AC_MSG_RESULT($ax_blas_ok)
10951
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
179 LIBS="$save_LIBS"
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
180 fi
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
181
3887
7da18459c08b [project @ 2002-04-04 00:44:21 by jwe]
jwe
parents:
diff changeset
182 # BLAS in Alpha CXML library?
10951
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
183 if test $ax_blas_ok = no; then
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
184 AC_CHECK_LIB(cxml, $sgemm, [ax_blas_ok=yes;BLAS_LIBS="-lcxml"])
3887
7da18459c08b [project @ 2002-04-04 00:44:21 by jwe]
jwe
parents:
diff changeset
185 fi
7da18459c08b [project @ 2002-04-04 00:44:21 by jwe]
jwe
parents:
diff changeset
186
7da18459c08b [project @ 2002-04-04 00:44:21 by jwe]
jwe
parents:
diff changeset
187 # BLAS in Alpha DXML library? (now called CXML, see above)
10951
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
188 if test $ax_blas_ok = no; then
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
189 AC_CHECK_LIB(dxml, $sgemm, [ax_blas_ok=yes;BLAS_LIBS="-ldxml"])
3887
7da18459c08b [project @ 2002-04-04 00:44:21 by jwe]
jwe
parents:
diff changeset
190 fi
7da18459c08b [project @ 2002-04-04 00:44:21 by jwe]
jwe
parents:
diff changeset
191
7da18459c08b [project @ 2002-04-04 00:44:21 by jwe]
jwe
parents:
diff changeset
192 # BLAS in Sun Performance library?
10951
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
193 if test $ax_blas_ok = no; then
3887
7da18459c08b [project @ 2002-04-04 00:44:21 by jwe]
jwe
parents:
diff changeset
194 if test "x$GCC" != xyes; then # only works with Sun CC
7da18459c08b [project @ 2002-04-04 00:44:21 by jwe]
jwe
parents:
diff changeset
195 AC_CHECK_LIB(sunmath, acosp,
7da18459c08b [project @ 2002-04-04 00:44:21 by jwe]
jwe
parents:
diff changeset
196 [AC_CHECK_LIB(sunperf, $sgemm,
11017
60141d49a38d update ax_blas
Jaroslav Hajek <highegg@gmail.com>
parents: 10951
diff changeset
197 [BLAS_LIBS="-xlic_lib=sunperf -lsunmath"
10951
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
198 ax_blas_ok=yes],[],[-lsunmath])])
3887
7da18459c08b [project @ 2002-04-04 00:44:21 by jwe]
jwe
parents:
diff changeset
199 fi
7da18459c08b [project @ 2002-04-04 00:44:21 by jwe]
jwe
parents:
diff changeset
200 fi
7da18459c08b [project @ 2002-04-04 00:44:21 by jwe]
jwe
parents:
diff changeset
201
7da18459c08b [project @ 2002-04-04 00:44:21 by jwe]
jwe
parents:
diff changeset
202 # BLAS in SCSL library? (SGI/Cray Scientific Library)
10951
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
203 if test $ax_blas_ok = no; then
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
204 AC_CHECK_LIB(scs, $sgemm, [ax_blas_ok=yes; BLAS_LIBS="-lscs"])
3887
7da18459c08b [project @ 2002-04-04 00:44:21 by jwe]
jwe
parents:
diff changeset
205 fi
7da18459c08b [project @ 2002-04-04 00:44:21 by jwe]
jwe
parents:
diff changeset
206
7da18459c08b [project @ 2002-04-04 00:44:21 by jwe]
jwe
parents:
diff changeset
207 # BLAS in SGIMATH library?
10951
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
208 if test $ax_blas_ok = no; then
3887
7da18459c08b [project @ 2002-04-04 00:44:21 by jwe]
jwe
parents:
diff changeset
209 AC_CHECK_LIB(complib.sgimath, $sgemm,
10951
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
210 [ax_blas_ok=yes; BLAS_LIBS="-lcomplib.sgimath"])
3887
7da18459c08b [project @ 2002-04-04 00:44:21 by jwe]
jwe
parents:
diff changeset
211 fi
7da18459c08b [project @ 2002-04-04 00:44:21 by jwe]
jwe
parents:
diff changeset
212
7da18459c08b [project @ 2002-04-04 00:44:21 by jwe]
jwe
parents:
diff changeset
213 # BLAS in IBM ESSL library? (requires generic BLAS lib, too)
10951
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
214 if test $ax_blas_ok = no; then
3887
7da18459c08b [project @ 2002-04-04 00:44:21 by jwe]
jwe
parents:
diff changeset
215 AC_CHECK_LIB(blas, $sgemm,
7da18459c08b [project @ 2002-04-04 00:44:21 by jwe]
jwe
parents:
diff changeset
216 [AC_CHECK_LIB(essl, $sgemm,
10951
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
217 [ax_blas_ok=yes; BLAS_LIBS="-lessl -lblas"],
3887
7da18459c08b [project @ 2002-04-04 00:44:21 by jwe]
jwe
parents:
diff changeset
218 [], [-lblas $FLIBS])])
7da18459c08b [project @ 2002-04-04 00:44:21 by jwe]
jwe
parents:
diff changeset
219 fi
7da18459c08b [project @ 2002-04-04 00:44:21 by jwe]
jwe
parents:
diff changeset
220
7da18459c08b [project @ 2002-04-04 00:44:21 by jwe]
jwe
parents:
diff changeset
221 # Generic BLAS library?
10951
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
222 if test $ax_blas_ok = no; then
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
223 AC_CHECK_LIB(blas, $sgemm, [ax_blas_ok=yes; BLAS_LIBS="-lblas"])
3887
7da18459c08b [project @ 2002-04-04 00:44:21 by jwe]
jwe
parents:
diff changeset
224 fi
7da18459c08b [project @ 2002-04-04 00:44:21 by jwe]
jwe
parents:
diff changeset
225
7da18459c08b [project @ 2002-04-04 00:44:21 by jwe]
jwe
parents:
diff changeset
226 AC_SUBST(BLAS_LIBS)
7da18459c08b [project @ 2002-04-04 00:44:21 by jwe]
jwe
parents:
diff changeset
227
10951
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
228 LIBS="$ax_blas_save_LIBS"
3887
7da18459c08b [project @ 2002-04-04 00:44:21 by jwe]
jwe
parents:
diff changeset
229
7da18459c08b [project @ 2002-04-04 00:44:21 by jwe]
jwe
parents:
diff changeset
230 # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
10951
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
231 if test x"$ax_blas_ok" = xyes; then
3887
7da18459c08b [project @ 2002-04-04 00:44:21 by jwe]
jwe
parents:
diff changeset
232 ifelse([$1],,AC_DEFINE(HAVE_BLAS,1,[Define if you have a BLAS library.]),[$1])
7da18459c08b [project @ 2002-04-04 00:44:21 by jwe]
jwe
parents:
diff changeset
233 :
7da18459c08b [project @ 2002-04-04 00:44:21 by jwe]
jwe
parents:
diff changeset
234 else
10951
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
235 ax_blas_ok=no
3887
7da18459c08b [project @ 2002-04-04 00:44:21 by jwe]
jwe
parents:
diff changeset
236 $2
7da18459c08b [project @ 2002-04-04 00:44:21 by jwe]
jwe
parents:
diff changeset
237 fi
10951
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
238 ])dnl AX_BLAS