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