Mercurial > octave
annotate m4/ax_lapack.m4 @ 31214:19bd1953fc1d stable
GitHub-CI: Remove ubuntu-18.04 runners from build matrix.
* .github/workflow/make.yaml (ubuntu): GitHub-hosted runners for ubuntu-18.04
are being deprecated. Remove them from build matrix. See also:
https://github.com/actions/runner-images/issues/6002
author | Markus Mützel <markus.muetzel@gmx.de> |
---|---|
date | Tue, 30 Aug 2022 11:16:27 +0200 |
parents | 9d2a4a270807 |
children |
rev | line source |
---|---|
8027
fd13f9f7dbac
update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents:
6208
diff
changeset
|
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_lapack.html |
8027
fd13f9f7dbac
update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents:
6208
diff
changeset
|
3 # =========================================================================== |
fd13f9f7dbac
update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents:
6208
diff
changeset
|
4 # |
fd13f9f7dbac
update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents:
6208
diff
changeset
|
5 # SYNOPSIS |
fd13f9f7dbac
update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents:
6208
diff
changeset
|
6 # |
10951 | 7 # AX_LAPACK([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) |
8027
fd13f9f7dbac
update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents:
6208
diff
changeset
|
8 # |
fd13f9f7dbac
update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents:
6208
diff
changeset
|
9 # DESCRIPTION |
fd13f9f7dbac
update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents:
6208
diff
changeset
|
10 # |
fd13f9f7dbac
update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents:
6208
diff
changeset
|
11 # This macro looks for a library that implements the LAPACK linear-algebra |
fd13f9f7dbac
update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents:
6208
diff
changeset
|
12 # interface (see http://www.netlib.org/lapack/). On success, it sets the |
fd13f9f7dbac
update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents:
6208
diff
changeset
|
13 # LAPACK_LIBS output variable to hold the requisite library linkages. |
fd13f9f7dbac
update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents:
6208
diff
changeset
|
14 # |
fd13f9f7dbac
update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents:
6208
diff
changeset
|
15 # To link with LAPACK, you should link with: |
fd13f9f7dbac
update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents:
6208
diff
changeset
|
16 # |
10951 | 17 # $LAPACK_LIBS $BLAS_LIBS $LIBS $FLIBS |
8027
fd13f9f7dbac
update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents:
6208
diff
changeset
|
18 # |
10951 | 19 # in that order. BLAS_LIBS is the output variable of the AX_BLAS macro, |
8027
fd13f9f7dbac
update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents:
6208
diff
changeset
|
20 # called automatically. FLIBS is the output variable of the |
10951 | 21 # AC_F77_LIBRARY_LDFLAGS macro (called if necessary by AX_BLAS), and is |
8027
fd13f9f7dbac
update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents:
6208
diff
changeset
|
22 # sometimes necessary in order to link with F77 libraries. Users will also |
fd13f9f7dbac
update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents:
6208
diff
changeset
|
23 # need to use AC_F77_DUMMY_MAIN (see the autoconf manual), for the same |
fd13f9f7dbac
update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents:
6208
diff
changeset
|
24 # reason. |
fd13f9f7dbac
update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents:
6208
diff
changeset
|
25 # |
fd13f9f7dbac
update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents:
6208
diff
changeset
|
26 # The user may also use --with-lapack=<lib> in order to use some specific |
fd13f9f7dbac
update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents:
6208
diff
changeset
|
27 # LAPACK library <lib>. In order to link successfully, however, be aware |
fd13f9f7dbac
update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents:
6208
diff
changeset
|
28 # that you will probably need to use the same Fortran compiler (which can |
fd13f9f7dbac
update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents:
6208
diff
changeset
|
29 # be set via the F77 env. var.) as was used to compile the LAPACK and BLAS |
fd13f9f7dbac
update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents:
6208
diff
changeset
|
30 # libraries. |
fd13f9f7dbac
update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents:
6208
diff
changeset
|
31 # |
fd13f9f7dbac
update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents:
6208
diff
changeset
|
32 # ACTION-IF-FOUND is a list of shell commands to run if a LAPACK library |
fd13f9f7dbac
update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents:
6208
diff
changeset
|
33 # is found, and ACTION-IF-NOT-FOUND is a list of commands to run it if it |
fd13f9f7dbac
update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents:
6208
diff
changeset
|
34 # is not found. If ACTION-IF-FOUND is not specified, the default action |
fd13f9f7dbac
update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents:
6208
diff
changeset
|
35 # will define HAVE_LAPACK. |
fd13f9f7dbac
update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents:
6208
diff
changeset
|
36 # |
10951 | 37 # LICENSE |
8027
fd13f9f7dbac
update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents:
6208
diff
changeset
|
38 # |
10951 | 39 # Copyright (c) 2009 Steven G. Johnson <stevenj@alum.mit.edu> |
30288
9d2a4a270807
build: Update autoconf macros.
Markus Mützel <markus.muetzel@gmx.de>
parents:
24893
diff
changeset
|
40 # Copyright (c) 2019 Geoffrey M. Oxberry <goxberry@gmail.com> |
8027
fd13f9f7dbac
update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents:
6208
diff
changeset
|
41 # |
fd13f9f7dbac
update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents:
6208
diff
changeset
|
42 # This program is free software: you can redistribute it and/or modify it |
fd13f9f7dbac
update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents:
6208
diff
changeset
|
43 # under the terms of the GNU General Public License as published by the |
fd13f9f7dbac
update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents:
6208
diff
changeset
|
44 # Free Software Foundation, either version 3 of the License, or (at your |
fd13f9f7dbac
update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents:
6208
diff
changeset
|
45 # option) any later version. |
fd13f9f7dbac
update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents:
6208
diff
changeset
|
46 # |
fd13f9f7dbac
update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents:
6208
diff
changeset
|
47 # This program is distributed in the hope that it will be useful, but |
fd13f9f7dbac
update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents:
6208
diff
changeset
|
48 # WITHOUT ANY WARRANTY; without even the implied warranty of |
fd13f9f7dbac
update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents:
6208
diff
changeset
|
49 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
fd13f9f7dbac
update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents:
6208
diff
changeset
|
50 # Public License for more details. |
fd13f9f7dbac
update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents:
6208
diff
changeset
|
51 # |
fd13f9f7dbac
update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents:
6208
diff
changeset
|
52 # 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:
10951
diff
changeset
|
53 # with this program. If not, see <https://www.gnu.org/licenses/>. |
8027
fd13f9f7dbac
update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents:
6208
diff
changeset
|
54 # |
fd13f9f7dbac
update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents:
6208
diff
changeset
|
55 # As a special exception, the respective Autoconf Macro's copyright owner |
fd13f9f7dbac
update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents:
6208
diff
changeset
|
56 # gives unlimited permission to copy, distribute and modify the configure |
fd13f9f7dbac
update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents:
6208
diff
changeset
|
57 # scripts that are the output of Autoconf when processing the Macro. You |
fd13f9f7dbac
update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents:
6208
diff
changeset
|
58 # need not follow the terms of the GNU General Public License when using |
fd13f9f7dbac
update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents:
6208
diff
changeset
|
59 # or distributing such scripts, even though portions of the text of the |
fd13f9f7dbac
update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents:
6208
diff
changeset
|
60 # Macro appear in them. The GNU General Public License (GPL) does govern |
fd13f9f7dbac
update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents:
6208
diff
changeset
|
61 # all other use of the material that constitutes the Autoconf Macro. |
fd13f9f7dbac
update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents:
6208
diff
changeset
|
62 # |
fd13f9f7dbac
update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents:
6208
diff
changeset
|
63 # This special exception to the GPL applies to versions of the Autoconf |
10951 | 64 # Macro released by the Autoconf Archive. When you make and distribute a |
65 # modified version of the Autoconf Macro, you may extend this special | |
66 # exception to the GPL to apply to your modified version as well. | |
3887 | 67 |
30288
9d2a4a270807
build: Update autoconf macros.
Markus Mützel <markus.muetzel@gmx.de>
parents:
24893
diff
changeset
|
68 #serial 10 |
10951 | 69 |
70 AU_ALIAS([ACX_LAPACK], [AX_LAPACK]) | |
71 AC_DEFUN([AX_LAPACK], [ | |
72 AC_REQUIRE([AX_BLAS]) | |
73 ax_lapack_ok=no | |
3887 | 74 |
75 AC_ARG_WITH(lapack, | |
10951 | 76 [AS_HELP_STRING([--with-lapack=<lib>], [use LAPACK library <lib>])]) |
3887 | 77 case $with_lapack in |
78 yes | "") ;; | |
10951 | 79 no) ax_lapack_ok=disable ;; |
30288
9d2a4a270807
build: Update autoconf macros.
Markus Mützel <markus.muetzel@gmx.de>
parents:
24893
diff
changeset
|
80 -* | */* | *.a | *.so | *.so.* | *.dylib | *.dylib.* | *.o) |
9d2a4a270807
build: Update autoconf macros.
Markus Mützel <markus.muetzel@gmx.de>
parents:
24893
diff
changeset
|
81 LAPACK_LIBS="$with_lapack" |
9d2a4a270807
build: Update autoconf macros.
Markus Mützel <markus.muetzel@gmx.de>
parents:
24893
diff
changeset
|
82 ;; |
3887 | 83 *) LAPACK_LIBS="-l$with_lapack" ;; |
84 esac | |
85 | |
86 # Get fortran linker name of LAPACK function to check for. | |
8027
fd13f9f7dbac
update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents:
6208
diff
changeset
|
87 AC_F77_FUNC(cheev) |
3887 | 88 |
89 # We cannot use LAPACK if BLAS is not found | |
10951 | 90 if test "x$ax_blas_ok" != xyes; then |
91 ax_lapack_ok=noblas | |
8027
fd13f9f7dbac
update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents:
6208
diff
changeset
|
92 LAPACK_LIBS="" |
3887 | 93 fi |
94 | |
95 # First, check LAPACK_LIBS environment variable | |
96 if test "x$LAPACK_LIBS" != x; then | |
97 save_LIBS="$LIBS"; LIBS="$LAPACK_LIBS $BLAS_LIBS $LIBS $FLIBS" | |
98 AC_MSG_CHECKING([for $cheev in $LAPACK_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([], [$cheev])], [ax_lapack_ok=yes], [LAPACK_LIBS=""]) |
10951 | 100 AC_MSG_RESULT($ax_lapack_ok) |
3887 | 101 LIBS="$save_LIBS" |
10951 | 102 if test $ax_lapack_ok = no; then |
3887 | 103 LAPACK_LIBS="" |
104 fi | |
105 fi | |
106 | |
107 # LAPACK linked to by default? (is sometimes included in BLAS lib) | |
10951 | 108 if test $ax_lapack_ok = no; then |
3887 | 109 save_LIBS="$LIBS"; LIBS="$LIBS $BLAS_LIBS $FLIBS" |
10951 | 110 AC_CHECK_FUNC($cheev, [ax_lapack_ok=yes]) |
3887 | 111 LIBS="$save_LIBS" |
112 fi | |
113 | |
114 # Generic LAPACK library? | |
115 for lapack in lapack lapack_rs6k; do | |
10951 | 116 if test $ax_lapack_ok = no; then |
3887 | 117 save_LIBS="$LIBS"; LIBS="$BLAS_LIBS $LIBS" |
118 AC_CHECK_LIB($lapack, $cheev, | |
10951 | 119 [ax_lapack_ok=yes; LAPACK_LIBS="-l$lapack"], [], [$FLIBS]) |
3887 | 120 LIBS="$save_LIBS" |
121 fi | |
122 done | |
123 | |
124 AC_SUBST(LAPACK_LIBS) | |
125 | |
126 # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: | |
10951 | 127 if test x"$ax_lapack_ok" = xyes; then |
3887 | 128 ifelse([$1],,AC_DEFINE(HAVE_LAPACK,1,[Define if you have LAPACK library.]),[$1]) |
129 : | |
130 else | |
10951 | 131 ax_lapack_ok=no |
3887 | 132 $2 |
133 fi | |
10951 | 134 ])dnl AX_LAPACK |