Mercurial > octave-nkf
annotate m4/ax_blas_f77_func.m4 @ 20651:e54ecb33727e
lo-array-gripes.cc: Remove FIXME's related to buffer size.
* lo-array-gripes.cc: Remove FIXME's related to buffer size. Shorten sprintf
buffers from 100 to 64 characters (still well more than 19 required).
Use 'const' decorator on constant value for clarity. Remove extra space
between variable and array bracket.
author | Rik <rik@octave.org> |
---|---|
date | Mon, 12 Oct 2015 21:13:47 -0700 |
parents | d6240c099a02 |
children |
rev | line source |
---|---|
8027
fd13f9f7dbac
update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents:
7683
diff
changeset
|
1 # =========================================================================== |
10951 | 2 # http://www.gnu.org/software/autoconf-archive/ax_blas_f77_func.html |
8027
fd13f9f7dbac
update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents:
7683
diff
changeset
|
3 # =========================================================================== |
7683
8136cb19fb7a
implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
4 # |
8136cb19fb7a
implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
5 # SYNOPSIS |
8136cb19fb7a
implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
6 # |
10951 | 7 # AX_BLAS_F77_FUNC([ACTION-IF-PASS[, ACTION-IF-FAIL[, ACTION-IF-CROSS-COMPILING]]) |
8 # AX_BLAS_WITH_F77_FUNC([ACTION-IF-FOUND-AND-PASS[, ACTION-IF-NOT-FOUND-OR-FAIL]]) | |
7683
8136cb19fb7a
implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
9 # |
8136cb19fb7a
implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
10 # DESCRIPTION |
8136cb19fb7a
implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
11 # |
10951 | 12 # These macros are intended as a supplement to the AX_BLAS macro, to |
8027
fd13f9f7dbac
update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents:
7683
diff
changeset
|
13 # verify that BLAS functions are properly callable from Fortran. This is |
fd13f9f7dbac
update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents:
7683
diff
changeset
|
14 # necessary, for example, if you want to build the LAPACK library on top |
fd13f9f7dbac
update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents:
7683
diff
changeset
|
15 # of the BLAS. |
7683
8136cb19fb7a
implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
16 # |
10951 | 17 # AX_BLAS_F77_FUNC uses the defined BLAS_LIBS and Fortran environment to |
8027
fd13f9f7dbac
update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents:
7683
diff
changeset
|
18 # check for compatibility, and takes a specific action in case of success, |
fd13f9f7dbac
update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents:
7683
diff
changeset
|
19 # resp. failure, resp. cross-compilation. |
7683
8136cb19fb7a
implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
20 # |
10951 | 21 # AX_BLAS_WITH_F77_FUNC is a drop-in replacement wrapper for AX_BLAS that |
22 # calls AX_BLAS_F77_FUNC after detecting a BLAS library and rejects it on | |
23 # failure (i.e. pretends that no library was found). | |
7683
8136cb19fb7a
implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
24 # |
10951 | 25 # LICENSE |
7683
8136cb19fb7a
implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
26 # |
8136cb19fb7a
implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
27 # Copyright (c) 2008 Jaroslav Hajek <highegg@gmail.com> |
8136cb19fb7a
implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
28 # |
8027
fd13f9f7dbac
update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents:
7683
diff
changeset
|
29 # 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:
7683
diff
changeset
|
30 # 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:
7683
diff
changeset
|
31 # 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:
7683
diff
changeset
|
32 # option) any later version. |
7683
8136cb19fb7a
implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
33 # |
8136cb19fb7a
implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
34 # This program is distributed in the hope that it will be useful, but |
8136cb19fb7a
implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
35 # WITHOUT ANY WARRANTY; without even the implied warranty of |
8027
fd13f9f7dbac
update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents:
7683
diff
changeset
|
36 # 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:
7683
diff
changeset
|
37 # Public License for more details. |
7683
8136cb19fb7a
implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
38 # |
8027
fd13f9f7dbac
update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents:
7683
diff
changeset
|
39 # You should have received a copy of the GNU General Public License along |
fd13f9f7dbac
update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents:
7683
diff
changeset
|
40 # with this program. If not, see <http://www.gnu.org/licenses/>. |
7683
8136cb19fb7a
implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
41 # |
8027
fd13f9f7dbac
update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents:
7683
diff
changeset
|
42 # 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:
7683
diff
changeset
|
43 # gives unlimited permission to copy, distribute and modify the configure |
fd13f9f7dbac
update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents:
7683
diff
changeset
|
44 # 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:
7683
diff
changeset
|
45 # 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:
7683
diff
changeset
|
46 # 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:
7683
diff
changeset
|
47 # 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:
7683
diff
changeset
|
48 # all other use of the material that constitutes the Autoconf Macro. |
7683
8136cb19fb7a
implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
49 # |
8027
fd13f9f7dbac
update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents:
7683
diff
changeset
|
50 # This special exception to the GPL applies to versions of the Autoconf |
10951 | 51 # Macro released by the Autoconf Archive. When you make and distribute a |
52 # modified version of the Autoconf Macro, you may extend this special | |
53 # exception to the GPL to apply to your modified version as well. | |
7683
8136cb19fb7a
implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
54 |
15153
ba431d1106e3
build: Update ax_XXX macros in m4 directory to newest versions.
Rik <rik@octave.org>
parents:
10956
diff
changeset
|
55 #serial 8 |
10951 | 56 |
57 AU_ALIAS([ACX_BLAS_F77_FUNC], [AX_BLAS_F77_FUNC]) | |
58 AC_DEFUN([AX_BLAS_F77_FUNC], [ | |
19334
d6240c099a02
build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents:
17977
diff
changeset
|
59 AC_PREREQ(2.50) |
d6240c099a02
build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents:
17977
diff
changeset
|
60 AC_REQUIRE([AX_BLAS]) |
7683
8136cb19fb7a
implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
61 |
19334
d6240c099a02
build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents:
17977
diff
changeset
|
62 # F77 call-compatibility checks |
d6240c099a02
build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents:
17977
diff
changeset
|
63 if test "$cross_compiling" = yes ; then |
d6240c099a02
build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents:
17977
diff
changeset
|
64 ifelse($3, ,$1,$3) |
d6240c099a02
build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents:
17977
diff
changeset
|
65 elif test x"$ax_blas_ok" = xyes; then |
d6240c099a02
build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents:
17977
diff
changeset
|
66 save_ax_blas_f77_func_LIBS="$LIBS" |
d6240c099a02
build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents:
17977
diff
changeset
|
67 LIBS="$BLAS_LIBS $LIBS" |
d6240c099a02
build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents:
17977
diff
changeset
|
68 AC_LANG_PUSH(Fortran 77) |
d6240c099a02
build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents:
17977
diff
changeset
|
69 # LSAME check (LOGICAL return values) |
d6240c099a02
build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents:
17977
diff
changeset
|
70 AC_MSG_CHECKING([whether LSAME is called correctly from Fortran]) |
d6240c099a02
build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents:
17977
diff
changeset
|
71 AC_RUN_IFELSE(AC_LANG_PROGRAM(,[[ |
7683
8136cb19fb7a
implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
72 logical lsame,w |
8136cb19fb7a
implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
73 external lsame |
8136cb19fb7a
implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
74 character c1,c2 |
8136cb19fb7a
implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
75 c1 = 'A' |
8136cb19fb7a
implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
76 c2 = 'B' |
8136cb19fb7a
implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
77 w = lsame(c1,c2) |
8136cb19fb7a
implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
78 if (w) stop 1 |
8136cb19fb7a
implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
79 w = lsame(c1,c1) |
8136cb19fb7a
implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
80 if (.not. w) stop 1 |
19334
d6240c099a02
build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents:
17977
diff
changeset
|
81 ]]),[ax_blas_lsame_fcall_ok=yes], |
d6240c099a02
build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents:
17977
diff
changeset
|
82 [ax_blas_lsame_fcall_ok=no]) |
d6240c099a02
build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents:
17977
diff
changeset
|
83 AC_MSG_RESULT([$ax_blas_lsame_fcall_ok]) |
d6240c099a02
build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents:
17977
diff
changeset
|
84 # ISAMAX check (INTEGER return values) |
d6240c099a02
build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents:
17977
diff
changeset
|
85 AC_MSG_CHECKING([whether ISAMAX is called correctly from Fortran]) |
d6240c099a02
build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents:
17977
diff
changeset
|
86 AC_RUN_IFELSE(AC_LANG_PROGRAM(,[[ |
8027
fd13f9f7dbac
update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents:
7683
diff
changeset
|
87 integer isamax,i |
fd13f9f7dbac
update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents:
7683
diff
changeset
|
88 external isamax |
fd13f9f7dbac
update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents:
7683
diff
changeset
|
89 real a(2) |
fd13f9f7dbac
update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents:
7683
diff
changeset
|
90 a(1) = 1e0 |
fd13f9f7dbac
update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents:
7683
diff
changeset
|
91 a(2) = -2e0 |
fd13f9f7dbac
update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents:
7683
diff
changeset
|
92 i = isamax(2,a,1) |
fd13f9f7dbac
update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents:
7683
diff
changeset
|
93 if (i.ne.2) stop 1 |
19334
d6240c099a02
build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents:
17977
diff
changeset
|
94 ]]),[ax_blas_isamax_fcall_ok=yes], |
d6240c099a02
build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents:
17977
diff
changeset
|
95 [ax_blas_isamax_fcall_ok=no]) |
d6240c099a02
build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents:
17977
diff
changeset
|
96 AC_MSG_RESULT([$ax_blas_isamax_fcall_ok]) |
d6240c099a02
build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents:
17977
diff
changeset
|
97 # SDOT check (REAL return values) |
d6240c099a02
build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents:
17977
diff
changeset
|
98 AC_MSG_CHECKING([whether SDOT is called correctly from Fortran]) |
d6240c099a02
build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents:
17977
diff
changeset
|
99 AC_RUN_IFELSE(AC_LANG_PROGRAM(,[[ |
8027
fd13f9f7dbac
update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents:
7683
diff
changeset
|
100 real sdot,a(1),b(1),w |
fd13f9f7dbac
update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents:
7683
diff
changeset
|
101 external sdot |
fd13f9f7dbac
update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents:
7683
diff
changeset
|
102 a(1) = 1e0 |
fd13f9f7dbac
update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents:
7683
diff
changeset
|
103 b(1) = 2e0 |
fd13f9f7dbac
update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents:
7683
diff
changeset
|
104 w = sdot(1,a,1,b,1) |
fd13f9f7dbac
update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents:
7683
diff
changeset
|
105 if (w .ne. a(1)*b(1)) stop 1 |
19334
d6240c099a02
build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents:
17977
diff
changeset
|
106 ]]),[ax_blas_sdot_fcall_ok=yes], |
d6240c099a02
build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents:
17977
diff
changeset
|
107 [ax_blas_sdot_fcall_ok=no]) |
d6240c099a02
build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents:
17977
diff
changeset
|
108 AC_MSG_RESULT([$ax_blas_sdot_fcall_ok]) |
d6240c099a02
build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents:
17977
diff
changeset
|
109 # DDOT check (DOUBLE return values) |
d6240c099a02
build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents:
17977
diff
changeset
|
110 AC_MSG_CHECKING([whether DDOT is called correctly from Fortran]) |
d6240c099a02
build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents:
17977
diff
changeset
|
111 AC_RUN_IFELSE(AC_LANG_PROGRAM(,[[ |
7683
8136cb19fb7a
implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
112 double precision ddot,a(1),b(1),w |
8136cb19fb7a
implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
113 external ddot |
8027
fd13f9f7dbac
update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents:
7683
diff
changeset
|
114 a(1) = 1d0 |
fd13f9f7dbac
update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents:
7683
diff
changeset
|
115 b(1) = 2d0 |
7683
8136cb19fb7a
implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
116 w = ddot(1,a,1,b,1) |
8136cb19fb7a
implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
117 if (w .ne. a(1)*b(1)) stop 1 |
19334
d6240c099a02
build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents:
17977
diff
changeset
|
118 ]]),[ax_blas_ddot_fcall_ok=yes], |
d6240c099a02
build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents:
17977
diff
changeset
|
119 [ax_blas_ddot_fcall_ok=no]) |
d6240c099a02
build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents:
17977
diff
changeset
|
120 AC_MSG_RESULT([$ax_blas_ddot_fcall_ok]) |
d6240c099a02
build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents:
17977
diff
changeset
|
121 # CDOTU check (COMPLEX return values) |
d6240c099a02
build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents:
17977
diff
changeset
|
122 AC_MSG_CHECKING([whether CDOTU is called correctly from Fortran]) |
d6240c099a02
build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents:
17977
diff
changeset
|
123 AC_RUN_IFELSE(AC_LANG_PROGRAM(,[[ |
7683
8136cb19fb7a
implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
124 complex cdotu,a(1),b(1),w |
8136cb19fb7a
implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
125 external cdotu |
8136cb19fb7a
implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
126 a(1) = cmplx(1e0,1e0) |
8136cb19fb7a
implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
127 b(1) = cmplx(1e0,2e0) |
8136cb19fb7a
implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
128 w = cdotu(1,a,1,b,1) |
8136cb19fb7a
implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
129 if (w .ne. a(1)*b(1)) stop 1 |
19334
d6240c099a02
build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents:
17977
diff
changeset
|
130 ]]),[ax_blas_cdotu_fcall_ok=yes], |
d6240c099a02
build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents:
17977
diff
changeset
|
131 [ax_blas_cdotu_fcall_ok=no]) |
d6240c099a02
build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents:
17977
diff
changeset
|
132 AC_MSG_RESULT([$ax_blas_cdotu_fcall_ok]) |
d6240c099a02
build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents:
17977
diff
changeset
|
133 # ZDOTU check (DOUBLE COMPLEX return values) |
d6240c099a02
build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents:
17977
diff
changeset
|
134 AC_MSG_CHECKING([whether ZDOTU is called correctly from Fortran]) |
d6240c099a02
build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents:
17977
diff
changeset
|
135 AC_RUN_IFELSE(AC_LANG_PROGRAM(,[[ |
7683
8136cb19fb7a
implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
136 double complex zdotu,a(1),b(1),w |
8136cb19fb7a
implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
137 external zdotu |
8136cb19fb7a
implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
138 a(1) = dcmplx(1d0,1d0) |
8136cb19fb7a
implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
139 b(1) = dcmplx(1d0,2d0) |
8136cb19fb7a
implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
140 w = zdotu(1,a,1,b,1) |
8136cb19fb7a
implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
141 if (w .ne. a(1)*b(1)) stop 1 |
19334
d6240c099a02
build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents:
17977
diff
changeset
|
142 ]]),[ax_blas_zdotu_fcall_ok=yes], |
d6240c099a02
build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents:
17977
diff
changeset
|
143 [ax_blas_zdotu_fcall_ok=no]) |
d6240c099a02
build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents:
17977
diff
changeset
|
144 AC_MSG_RESULT([$ax_blas_zdotu_fcall_ok]) |
d6240c099a02
build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents:
17977
diff
changeset
|
145 # Check for correct integer size |
d6240c099a02
build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents:
17977
diff
changeset
|
146 # FIXME: this may fail with things like -ftrapping-math. |
d6240c099a02
build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents:
17977
diff
changeset
|
147 AC_MSG_CHECKING([whether the integer size is correct]) |
d6240c099a02
build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents:
17977
diff
changeset
|
148 AC_RUN_IFELSE(AC_LANG_PROGRAM(,[[ |
10956
cab8365e476d
update ax_blas_f77_func.m4
Jaroslav Hajek <highegg@gmail.com>
parents:
10951
diff
changeset
|
149 integer n,nn(3) |
cab8365e476d
update ax_blas_f77_func.m4
Jaroslav Hajek <highegg@gmail.com>
parents:
10951
diff
changeset
|
150 real s,a(1),b(1),sdot |
cab8365e476d
update ax_blas_f77_func.m4
Jaroslav Hajek <highegg@gmail.com>
parents:
10951
diff
changeset
|
151 a(1) = 1.0 |
cab8365e476d
update ax_blas_f77_func.m4
Jaroslav Hajek <highegg@gmail.com>
parents:
10951
diff
changeset
|
152 b(1) = 1.0 |
19334
d6240c099a02
build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents:
17977
diff
changeset
|
153 c Generate -2**33 + 1, if possible |
10956
cab8365e476d
update ax_blas_f77_func.m4
Jaroslav Hajek <highegg@gmail.com>
parents:
10951
diff
changeset
|
154 n = 2 |
19334
d6240c099a02
build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents:
17977
diff
changeset
|
155 n = -4 * (n ** 30) |
10956
cab8365e476d
update ax_blas_f77_func.m4
Jaroslav Hajek <highegg@gmail.com>
parents:
10951
diff
changeset
|
156 n = n + 1 |
cab8365e476d
update ax_blas_f77_func.m4
Jaroslav Hajek <highegg@gmail.com>
parents:
10951
diff
changeset
|
157 if (n >= 0) goto 1 |
cab8365e476d
update ax_blas_f77_func.m4
Jaroslav Hajek <highegg@gmail.com>
parents:
10951
diff
changeset
|
158 c This means we're on 64-bit integers. Check whether the BLAS is, too. |
cab8365e476d
update ax_blas_f77_func.m4
Jaroslav Hajek <highegg@gmail.com>
parents:
10951
diff
changeset
|
159 s = sdot(n,a,1,b,1) |
cab8365e476d
update ax_blas_f77_func.m4
Jaroslav Hajek <highegg@gmail.com>
parents:
10951
diff
changeset
|
160 if (s .ne. 0.0) stop 1 |
cab8365e476d
update ax_blas_f77_func.m4
Jaroslav Hajek <highegg@gmail.com>
parents:
10951
diff
changeset
|
161 1 continue |
cab8365e476d
update ax_blas_f77_func.m4
Jaroslav Hajek <highegg@gmail.com>
parents:
10951
diff
changeset
|
162 c We may be on 32-bit integers, and the BLAS on 64 bits. This is almost bound |
cab8365e476d
update ax_blas_f77_func.m4
Jaroslav Hajek <highegg@gmail.com>
parents:
10951
diff
changeset
|
163 c to have already failed, but just in case, we'll check. |
cab8365e476d
update ax_blas_f77_func.m4
Jaroslav Hajek <highegg@gmail.com>
parents:
10951
diff
changeset
|
164 nn(1) = -1 |
cab8365e476d
update ax_blas_f77_func.m4
Jaroslav Hajek <highegg@gmail.com>
parents:
10951
diff
changeset
|
165 nn(2) = 1 |
cab8365e476d
update ax_blas_f77_func.m4
Jaroslav Hajek <highegg@gmail.com>
parents:
10951
diff
changeset
|
166 nn(3) = -1 |
cab8365e476d
update ax_blas_f77_func.m4
Jaroslav Hajek <highegg@gmail.com>
parents:
10951
diff
changeset
|
167 s = sdot(nn(2),a,1,b,1) |
cab8365e476d
update ax_blas_f77_func.m4
Jaroslav Hajek <highegg@gmail.com>
parents:
10951
diff
changeset
|
168 if (s .ne. 1.0) stop 1 |
19334
d6240c099a02
build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents:
17977
diff
changeset
|
169 ]]),[ax_blas_integer_size_ok=yes], |
d6240c099a02
build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents:
17977
diff
changeset
|
170 [ax_blas_integer_size_ok=no]) |
d6240c099a02
build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents:
17977
diff
changeset
|
171 AC_MSG_RESULT([$ax_blas_integer_size_ok]) |
7683
8136cb19fb7a
implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
172 |
19334
d6240c099a02
build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents:
17977
diff
changeset
|
173 AC_LANG_POP(Fortran 77) |
7683
8136cb19fb7a
implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
174 |
19334
d6240c099a02
build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents:
17977
diff
changeset
|
175 # if any of the tests failed, reject the BLAS library |
d6240c099a02
build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents:
17977
diff
changeset
|
176 if test $ax_blas_lsame_fcall_ok = yes \ |
d6240c099a02
build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents:
17977
diff
changeset
|
177 -a $ax_blas_sdot_fcall_ok = yes \ |
d6240c099a02
build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents:
17977
diff
changeset
|
178 -a $ax_blas_ddot_fcall_ok = yes \ |
d6240c099a02
build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents:
17977
diff
changeset
|
179 -a $ax_blas_cdotu_fcall_ok = yes \ |
d6240c099a02
build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents:
17977
diff
changeset
|
180 -a $ax_blas_zdotu_fcall_ok = yes \ |
d6240c099a02
build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents:
17977
diff
changeset
|
181 -a $ax_blas_integer_size_ok = yes; then |
d6240c099a02
build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents:
17977
diff
changeset
|
182 ax_blas_f77_func_ok=yes; |
d6240c099a02
build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents:
17977
diff
changeset
|
183 $1 |
d6240c099a02
build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents:
17977
diff
changeset
|
184 else |
d6240c099a02
build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents:
17977
diff
changeset
|
185 ax_blas_f77_func_ok=no; |
d6240c099a02
build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents:
17977
diff
changeset
|
186 $2 |
d6240c099a02
build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents:
17977
diff
changeset
|
187 fi |
d6240c099a02
build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents:
17977
diff
changeset
|
188 LIBS="$save_ax_blas_f77_func_LIBS" |
d6240c099a02
build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents:
17977
diff
changeset
|
189 fi |
d6240c099a02
build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents:
17977
diff
changeset
|
190 |
10951 | 191 ])dnl AX_BLAS_F77_FUNC |
7683
8136cb19fb7a
implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
192 |
10951 | 193 AC_DEFUN([AX_BLAS_WITH_F77_FUNC], [ |
19334
d6240c099a02
build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents:
17977
diff
changeset
|
194 AC_PREREQ(2.50) |
d6240c099a02
build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents:
17977
diff
changeset
|
195 AX_BLAS([# disable special action], []) |
d6240c099a02
build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents:
17977
diff
changeset
|
196 if test x$ax_blas_ok = xyes ; then |
d6240c099a02
build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents:
17977
diff
changeset
|
197 AX_BLAS_F77_FUNC( |
d6240c099a02
build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents:
17977
diff
changeset
|
198 [ifelse([$1],,AC_DEFINE(HAVE_BLAS,1,[Define if you have a BLAS library.]),[$1])], |
d6240c099a02
build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents:
17977
diff
changeset
|
199 [ax_blas_ok=no; BLAS_LIBS=]) |
d6240c099a02
build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents:
17977
diff
changeset
|
200 fi |
d6240c099a02
build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents:
17977
diff
changeset
|
201 if test x$ax_blas_ok = xno ; then |
d6240c099a02
build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents:
17977
diff
changeset
|
202 $2 |
d6240c099a02
build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents:
17977
diff
changeset
|
203 fi |
10951 | 204 ])dnl AX_BLAS_WITH_F77_FUNC |