annotate m4/ax_blas_f77_func.m4 @ 18479:85d31344fb23 stable rc-3-8-1-2

3.8.1 release candidate 2 * configure.ac (OCTAVE_VERSION): Bump to 3.8.1-rc2. (OCTAVE_MINOR_VERSION): Bump to 1-rc2. (OCTAVE_RELEASE_DATE): Set to 2014-02-14.
author John W. Eaton <jwe@octave.org>
date Mon, 17 Feb 2014 02:20:39 -0500
parents acdee77299e1
children d6240c099a02
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
8027
fd13f9f7dbac update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents: 7683
diff changeset
1 # ===========================================================================
10951
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
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
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
7 # AX_BLAS_F77_FUNC([ACTION-IF-PASS[, ACTION-IF-FAIL[, ACTION-IF-CROSS-COMPILING]])
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
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
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
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
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
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
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
21 # AX_BLAS_WITH_F77_FUNC is a drop-in replacement wrapper for AX_BLAS that
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
22 # calls AX_BLAS_F77_FUNC after detecting a BLAS library and rejects it on
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
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
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
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
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
51 # 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
52 # modified version of the Autoconf Macro, you may extend this special
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
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
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
56
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
57 AU_ALIAS([ACX_BLAS_F77_FUNC], [AX_BLAS_F77_FUNC])
17977
acdee77299e1 ax_blas_f77_func.m4: Overhaul to remove tabs, use indentation, follow m4 quoting guidelines.
Rik <rik@octave.org>
parents: 17976
diff changeset
58
10951
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
59 AC_DEFUN([AX_BLAS_F77_FUNC], [
17977
acdee77299e1 ax_blas_f77_func.m4: Overhaul to remove tabs, use indentation, follow m4 quoting guidelines.
Rik <rik@octave.org>
parents: 17976
diff changeset
60 AC_PREREQ(2.50)
acdee77299e1 ax_blas_f77_func.m4: Overhaul to remove tabs, use indentation, follow m4 quoting guidelines.
Rik <rik@octave.org>
parents: 17976
diff changeset
61 AC_REQUIRE([AX_BLAS])
7683
8136cb19fb7a implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
62
17977
acdee77299e1 ax_blas_f77_func.m4: Overhaul to remove tabs, use indentation, follow m4 quoting guidelines.
Rik <rik@octave.org>
parents: 17976
diff changeset
63 ## F77 call-compatibility checks
acdee77299e1 ax_blas_f77_func.m4: Overhaul to remove tabs, use indentation, follow m4 quoting guidelines.
Rik <rik@octave.org>
parents: 17976
diff changeset
64 if test "$cross_compiling" = yes ; then
acdee77299e1 ax_blas_f77_func.m4: Overhaul to remove tabs, use indentation, follow m4 quoting guidelines.
Rik <rik@octave.org>
parents: 17976
diff changeset
65 ifelse($3, ,$1,$3)
acdee77299e1 ax_blas_f77_func.m4: Overhaul to remove tabs, use indentation, follow m4 quoting guidelines.
Rik <rik@octave.org>
parents: 17976
diff changeset
66 elif test x"$ax_blas_ok" = xyes; then
acdee77299e1 ax_blas_f77_func.m4: Overhaul to remove tabs, use indentation, follow m4 quoting guidelines.
Rik <rik@octave.org>
parents: 17976
diff changeset
67 save_ax_blas_f77_func_LIBS="$LIBS"
acdee77299e1 ax_blas_f77_func.m4: Overhaul to remove tabs, use indentation, follow m4 quoting guidelines.
Rik <rik@octave.org>
parents: 17976
diff changeset
68 LIBS="$BLAS_LIBS $LIBS"
acdee77299e1 ax_blas_f77_func.m4: Overhaul to remove tabs, use indentation, follow m4 quoting guidelines.
Rik <rik@octave.org>
parents: 17976
diff changeset
69 AC_LANG_PUSH(Fortran 77)
acdee77299e1 ax_blas_f77_func.m4: Overhaul to remove tabs, use indentation, follow m4 quoting guidelines.
Rik <rik@octave.org>
parents: 17976
diff changeset
70 ## LSAME check (LOGICAL return values)
acdee77299e1 ax_blas_f77_func.m4: Overhaul to remove tabs, use indentation, follow m4 quoting guidelines.
Rik <rik@octave.org>
parents: 17976
diff changeset
71 AC_MSG_CHECKING([whether LSAME is called correctly from Fortran])
acdee77299e1 ax_blas_f77_func.m4: Overhaul to remove tabs, use indentation, follow m4 quoting guidelines.
Rik <rik@octave.org>
parents: 17976
diff changeset
72 AC_RUN_IFELSE([AC_LANG_PROGRAM([], [[
7683
8136cb19fb7a implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
73 logical lsame,w
8136cb19fb7a implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
74 external lsame
8136cb19fb7a implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
75 character c1,c2
8136cb19fb7a implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
76 c1 = 'A'
8136cb19fb7a implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
77 c2 = 'B'
8136cb19fb7a implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
78 w = lsame(c1,c2)
8136cb19fb7a implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
79 if (w) stop 1
8136cb19fb7a implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
80 w = lsame(c1,c1)
8136cb19fb7a implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
81 if (.not. w) stop 1
17977
acdee77299e1 ax_blas_f77_func.m4: Overhaul to remove tabs, use indentation, follow m4 quoting guidelines.
Rik <rik@octave.org>
parents: 17976
diff changeset
82 ]])],
acdee77299e1 ax_blas_f77_func.m4: Overhaul to remove tabs, use indentation, follow m4 quoting guidelines.
Rik <rik@octave.org>
parents: 17976
diff changeset
83 [ax_blas_lsame_fcall_ok=yes],
acdee77299e1 ax_blas_f77_func.m4: Overhaul to remove tabs, use indentation, follow m4 quoting guidelines.
Rik <rik@octave.org>
parents: 17976
diff changeset
84 [ax_blas_lsame_fcall_ok=no])
acdee77299e1 ax_blas_f77_func.m4: Overhaul to remove tabs, use indentation, follow m4 quoting guidelines.
Rik <rik@octave.org>
parents: 17976
diff changeset
85 AC_MSG_RESULT([$ax_blas_lsame_fcall_ok])
acdee77299e1 ax_blas_f77_func.m4: Overhaul to remove tabs, use indentation, follow m4 quoting guidelines.
Rik <rik@octave.org>
parents: 17976
diff changeset
86 ## ISAMAX check (INTEGER return values)
acdee77299e1 ax_blas_f77_func.m4: Overhaul to remove tabs, use indentation, follow m4 quoting guidelines.
Rik <rik@octave.org>
parents: 17976
diff changeset
87 AC_MSG_CHECKING([whether ISAMAX is called correctly from Fortran])
acdee77299e1 ax_blas_f77_func.m4: Overhaul to remove tabs, use indentation, follow m4 quoting guidelines.
Rik <rik@octave.org>
parents: 17976
diff changeset
88 AC_RUN_IFELSE([AC_LANG_PROGRAM([], [[
8027
fd13f9f7dbac update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents: 7683
diff changeset
89 integer isamax,i
fd13f9f7dbac update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents: 7683
diff changeset
90 external isamax
fd13f9f7dbac update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents: 7683
diff changeset
91 real a(2)
fd13f9f7dbac update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents: 7683
diff changeset
92 a(1) = 1e0
fd13f9f7dbac update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents: 7683
diff changeset
93 a(2) = -2e0
fd13f9f7dbac update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents: 7683
diff changeset
94 i = isamax(2,a,1)
fd13f9f7dbac update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents: 7683
diff changeset
95 if (i.ne.2) stop 1
17977
acdee77299e1 ax_blas_f77_func.m4: Overhaul to remove tabs, use indentation, follow m4 quoting guidelines.
Rik <rik@octave.org>
parents: 17976
diff changeset
96 ]])],
acdee77299e1 ax_blas_f77_func.m4: Overhaul to remove tabs, use indentation, follow m4 quoting guidelines.
Rik <rik@octave.org>
parents: 17976
diff changeset
97 [ax_blas_isamax_fcall_ok=yes],
acdee77299e1 ax_blas_f77_func.m4: Overhaul to remove tabs, use indentation, follow m4 quoting guidelines.
Rik <rik@octave.org>
parents: 17976
diff changeset
98 [ax_blas_isamax_fcall_ok=no])
acdee77299e1 ax_blas_f77_func.m4: Overhaul to remove tabs, use indentation, follow m4 quoting guidelines.
Rik <rik@octave.org>
parents: 17976
diff changeset
99 AC_MSG_RESULT([$ax_blas_isamax_fcall_ok])
acdee77299e1 ax_blas_f77_func.m4: Overhaul to remove tabs, use indentation, follow m4 quoting guidelines.
Rik <rik@octave.org>
parents: 17976
diff changeset
100 ## SDOT check (REAL return values)
acdee77299e1 ax_blas_f77_func.m4: Overhaul to remove tabs, use indentation, follow m4 quoting guidelines.
Rik <rik@octave.org>
parents: 17976
diff changeset
101 AC_MSG_CHECKING([whether SDOT is called correctly from Fortran])
acdee77299e1 ax_blas_f77_func.m4: Overhaul to remove tabs, use indentation, follow m4 quoting guidelines.
Rik <rik@octave.org>
parents: 17976
diff changeset
102 AC_RUN_IFELSE([AC_LANG_PROGRAM([], [[
8027
fd13f9f7dbac update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents: 7683
diff changeset
103 real sdot,a(1),b(1),w
fd13f9f7dbac update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents: 7683
diff changeset
104 external sdot
fd13f9f7dbac update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents: 7683
diff changeset
105 a(1) = 1e0
fd13f9f7dbac update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents: 7683
diff changeset
106 b(1) = 2e0
fd13f9f7dbac update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents: 7683
diff changeset
107 w = sdot(1,a,1,b,1)
fd13f9f7dbac update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents: 7683
diff changeset
108 if (w .ne. a(1)*b(1)) stop 1
17977
acdee77299e1 ax_blas_f77_func.m4: Overhaul to remove tabs, use indentation, follow m4 quoting guidelines.
Rik <rik@octave.org>
parents: 17976
diff changeset
109 ]])],
acdee77299e1 ax_blas_f77_func.m4: Overhaul to remove tabs, use indentation, follow m4 quoting guidelines.
Rik <rik@octave.org>
parents: 17976
diff changeset
110 [ax_blas_sdot_fcall_ok=yes],
acdee77299e1 ax_blas_f77_func.m4: Overhaul to remove tabs, use indentation, follow m4 quoting guidelines.
Rik <rik@octave.org>
parents: 17976
diff changeset
111 [ax_blas_sdot_fcall_ok=no])
acdee77299e1 ax_blas_f77_func.m4: Overhaul to remove tabs, use indentation, follow m4 quoting guidelines.
Rik <rik@octave.org>
parents: 17976
diff changeset
112 AC_MSG_RESULT([$ax_blas_sdot_fcall_ok])
acdee77299e1 ax_blas_f77_func.m4: Overhaul to remove tabs, use indentation, follow m4 quoting guidelines.
Rik <rik@octave.org>
parents: 17976
diff changeset
113 ## DDOT check (DOUBLE return values)
acdee77299e1 ax_blas_f77_func.m4: Overhaul to remove tabs, use indentation, follow m4 quoting guidelines.
Rik <rik@octave.org>
parents: 17976
diff changeset
114 AC_MSG_CHECKING([whether DDOT is called correctly from Fortran])
acdee77299e1 ax_blas_f77_func.m4: Overhaul to remove tabs, use indentation, follow m4 quoting guidelines.
Rik <rik@octave.org>
parents: 17976
diff changeset
115 AC_RUN_IFELSE([AC_LANG_PROGRAM([], [[
7683
8136cb19fb7a implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
116 double precision ddot,a(1),b(1),w
8136cb19fb7a implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
117 external ddot
8027
fd13f9f7dbac update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents: 7683
diff changeset
118 a(1) = 1d0
fd13f9f7dbac update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents: 7683
diff changeset
119 b(1) = 2d0
7683
8136cb19fb7a implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
120 w = ddot(1,a,1,b,1)
8136cb19fb7a implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
121 if (w .ne. a(1)*b(1)) stop 1
17977
acdee77299e1 ax_blas_f77_func.m4: Overhaul to remove tabs, use indentation, follow m4 quoting guidelines.
Rik <rik@octave.org>
parents: 17976
diff changeset
122 ]])],
acdee77299e1 ax_blas_f77_func.m4: Overhaul to remove tabs, use indentation, follow m4 quoting guidelines.
Rik <rik@octave.org>
parents: 17976
diff changeset
123 [ax_blas_ddot_fcall_ok=yes],
acdee77299e1 ax_blas_f77_func.m4: Overhaul to remove tabs, use indentation, follow m4 quoting guidelines.
Rik <rik@octave.org>
parents: 17976
diff changeset
124 [ax_blas_ddot_fcall_ok=no])
acdee77299e1 ax_blas_f77_func.m4: Overhaul to remove tabs, use indentation, follow m4 quoting guidelines.
Rik <rik@octave.org>
parents: 17976
diff changeset
125 AC_MSG_RESULT([$ax_blas_ddot_fcall_ok])
acdee77299e1 ax_blas_f77_func.m4: Overhaul to remove tabs, use indentation, follow m4 quoting guidelines.
Rik <rik@octave.org>
parents: 17976
diff changeset
126 ## CDOTU check (COMPLEX return values)
acdee77299e1 ax_blas_f77_func.m4: Overhaul to remove tabs, use indentation, follow m4 quoting guidelines.
Rik <rik@octave.org>
parents: 17976
diff changeset
127 AC_MSG_CHECKING([whether CDOTU is called correctly from Fortran])
acdee77299e1 ax_blas_f77_func.m4: Overhaul to remove tabs, use indentation, follow m4 quoting guidelines.
Rik <rik@octave.org>
parents: 17976
diff changeset
128 AC_RUN_IFELSE([AC_LANG_PROGRAM([], [[
7683
8136cb19fb7a implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
129 complex cdotu,a(1),b(1),w
8136cb19fb7a implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
130 external cdotu
8136cb19fb7a implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
131 a(1) = cmplx(1e0,1e0)
8136cb19fb7a implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
132 b(1) = cmplx(1e0,2e0)
8136cb19fb7a implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
133 w = cdotu(1,a,1,b,1)
8136cb19fb7a implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
134 if (w .ne. a(1)*b(1)) stop 1
17977
acdee77299e1 ax_blas_f77_func.m4: Overhaul to remove tabs, use indentation, follow m4 quoting guidelines.
Rik <rik@octave.org>
parents: 17976
diff changeset
135 ]])],
acdee77299e1 ax_blas_f77_func.m4: Overhaul to remove tabs, use indentation, follow m4 quoting guidelines.
Rik <rik@octave.org>
parents: 17976
diff changeset
136 [ax_blas_cdotu_fcall_ok=yes],
acdee77299e1 ax_blas_f77_func.m4: Overhaul to remove tabs, use indentation, follow m4 quoting guidelines.
Rik <rik@octave.org>
parents: 17976
diff changeset
137 [ax_blas_cdotu_fcall_ok=no])
acdee77299e1 ax_blas_f77_func.m4: Overhaul to remove tabs, use indentation, follow m4 quoting guidelines.
Rik <rik@octave.org>
parents: 17976
diff changeset
138 AC_MSG_RESULT([$ax_blas_cdotu_fcall_ok])
acdee77299e1 ax_blas_f77_func.m4: Overhaul to remove tabs, use indentation, follow m4 quoting guidelines.
Rik <rik@octave.org>
parents: 17976
diff changeset
139 ## ZDOTU check (DOUBLE COMPLEX return values)
acdee77299e1 ax_blas_f77_func.m4: Overhaul to remove tabs, use indentation, follow m4 quoting guidelines.
Rik <rik@octave.org>
parents: 17976
diff changeset
140 AC_MSG_CHECKING([whether ZDOTU is called correctly from Fortran])
acdee77299e1 ax_blas_f77_func.m4: Overhaul to remove tabs, use indentation, follow m4 quoting guidelines.
Rik <rik@octave.org>
parents: 17976
diff changeset
141 AC_RUN_IFELSE([AC_LANG_PROGRAM([], [[
7683
8136cb19fb7a implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
142 double complex zdotu,a(1),b(1),w
8136cb19fb7a implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
143 external zdotu
8136cb19fb7a implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
144 a(1) = dcmplx(1d0,1d0)
8136cb19fb7a implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
145 b(1) = dcmplx(1d0,2d0)
8136cb19fb7a implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
146 w = zdotu(1,a,1,b,1)
8136cb19fb7a implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
147 if (w .ne. a(1)*b(1)) stop 1
17977
acdee77299e1 ax_blas_f77_func.m4: Overhaul to remove tabs, use indentation, follow m4 quoting guidelines.
Rik <rik@octave.org>
parents: 17976
diff changeset
148 ]])],
acdee77299e1 ax_blas_f77_func.m4: Overhaul to remove tabs, use indentation, follow m4 quoting guidelines.
Rik <rik@octave.org>
parents: 17976
diff changeset
149 [ax_blas_zdotu_fcall_ok=yes],
acdee77299e1 ax_blas_f77_func.m4: Overhaul to remove tabs, use indentation, follow m4 quoting guidelines.
Rik <rik@octave.org>
parents: 17976
diff changeset
150 [ax_blas_zdotu_fcall_ok=no])
acdee77299e1 ax_blas_f77_func.m4: Overhaul to remove tabs, use indentation, follow m4 quoting guidelines.
Rik <rik@octave.org>
parents: 17976
diff changeset
151 AC_MSG_RESULT([$ax_blas_zdotu_fcall_ok])
acdee77299e1 ax_blas_f77_func.m4: Overhaul to remove tabs, use indentation, follow m4 quoting guidelines.
Rik <rik@octave.org>
parents: 17976
diff changeset
152 ## Check for correct integer size
acdee77299e1 ax_blas_f77_func.m4: Overhaul to remove tabs, use indentation, follow m4 quoting guidelines.
Rik <rik@octave.org>
parents: 17976
diff changeset
153 ## FIXME: this may fail with things like -ftrapping-math.
acdee77299e1 ax_blas_f77_func.m4: Overhaul to remove tabs, use indentation, follow m4 quoting guidelines.
Rik <rik@octave.org>
parents: 17976
diff changeset
154 AC_MSG_CHECKING([whether the integer size is correct])
acdee77299e1 ax_blas_f77_func.m4: Overhaul to remove tabs, use indentation, follow m4 quoting guidelines.
Rik <rik@octave.org>
parents: 17976
diff changeset
155 AC_RUN_IFELSE([AC_LANG_PROGRAM([], [[
10956
cab8365e476d update ax_blas_f77_func.m4
Jaroslav Hajek <highegg@gmail.com>
parents: 10951
diff changeset
156 integer n,nn(3)
cab8365e476d update ax_blas_f77_func.m4
Jaroslav Hajek <highegg@gmail.com>
parents: 10951
diff changeset
157 real s,a(1),b(1),sdot
cab8365e476d update ax_blas_f77_func.m4
Jaroslav Hajek <highegg@gmail.com>
parents: 10951
diff changeset
158 a(1) = 1.0
cab8365e476d update ax_blas_f77_func.m4
Jaroslav Hajek <highegg@gmail.com>
parents: 10951
diff changeset
159 b(1) = 1.0
16315
62791b1f06cb * ax_blas_f77_func.m4: Correct expression to generate 2^32.
John W. Eaton <jwe@octave.org>
parents: 15153
diff changeset
160 c Generate -2**32 + 1, if possible
10956
cab8365e476d update ax_blas_f77_func.m4
Jaroslav Hajek <highegg@gmail.com>
parents: 10951
diff changeset
161 n = 2
16315
62791b1f06cb * ax_blas_f77_func.m4: Correct expression to generate 2^32.
John W. Eaton <jwe@octave.org>
parents: 15153
diff changeset
162 n = -4 ** (n ** 30)
10956
cab8365e476d update ax_blas_f77_func.m4
Jaroslav Hajek <highegg@gmail.com>
parents: 10951
diff changeset
163 n = n + 1
cab8365e476d update ax_blas_f77_func.m4
Jaroslav Hajek <highegg@gmail.com>
parents: 10951
diff changeset
164 if (n >= 0) goto 1
cab8365e476d update ax_blas_f77_func.m4
Jaroslav Hajek <highegg@gmail.com>
parents: 10951
diff changeset
165 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
166 s = sdot(n,a,1,b,1)
cab8365e476d update ax_blas_f77_func.m4
Jaroslav Hajek <highegg@gmail.com>
parents: 10951
diff changeset
167 if (s .ne. 0.0) stop 1
cab8365e476d update ax_blas_f77_func.m4
Jaroslav Hajek <highegg@gmail.com>
parents: 10951
diff changeset
168 1 continue
cab8365e476d update ax_blas_f77_func.m4
Jaroslav Hajek <highegg@gmail.com>
parents: 10951
diff changeset
169 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
170 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
171 nn(1) = -1
cab8365e476d update ax_blas_f77_func.m4
Jaroslav Hajek <highegg@gmail.com>
parents: 10951
diff changeset
172 nn(2) = 1
cab8365e476d update ax_blas_f77_func.m4
Jaroslav Hajek <highegg@gmail.com>
parents: 10951
diff changeset
173 nn(3) = -1
cab8365e476d update ax_blas_f77_func.m4
Jaroslav Hajek <highegg@gmail.com>
parents: 10951
diff changeset
174 s = sdot(nn(2),a,1,b,1)
cab8365e476d update ax_blas_f77_func.m4
Jaroslav Hajek <highegg@gmail.com>
parents: 10951
diff changeset
175 if (s .ne. 1.0) stop 1
17977
acdee77299e1 ax_blas_f77_func.m4: Overhaul to remove tabs, use indentation, follow m4 quoting guidelines.
Rik <rik@octave.org>
parents: 17976
diff changeset
176 ]])],
acdee77299e1 ax_blas_f77_func.m4: Overhaul to remove tabs, use indentation, follow m4 quoting guidelines.
Rik <rik@octave.org>
parents: 17976
diff changeset
177 [ax_blas_integer_size_ok=yes],
acdee77299e1 ax_blas_f77_func.m4: Overhaul to remove tabs, use indentation, follow m4 quoting guidelines.
Rik <rik@octave.org>
parents: 17976
diff changeset
178 [ax_blas_integer_size_ok=no])
acdee77299e1 ax_blas_f77_func.m4: Overhaul to remove tabs, use indentation, follow m4 quoting guidelines.
Rik <rik@octave.org>
parents: 17976
diff changeset
179 AC_MSG_RESULT([$ax_blas_integer_size_ok])
7683
8136cb19fb7a implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
180
17977
acdee77299e1 ax_blas_f77_func.m4: Overhaul to remove tabs, use indentation, follow m4 quoting guidelines.
Rik <rik@octave.org>
parents: 17976
diff changeset
181 AC_LANG_POP(Fortran 77)
7683
8136cb19fb7a implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
182
17977
acdee77299e1 ax_blas_f77_func.m4: Overhaul to remove tabs, use indentation, follow m4 quoting guidelines.
Rik <rik@octave.org>
parents: 17976
diff changeset
183 ## if any of the tests failed, reject the BLAS library
acdee77299e1 ax_blas_f77_func.m4: Overhaul to remove tabs, use indentation, follow m4 quoting guidelines.
Rik <rik@octave.org>
parents: 17976
diff changeset
184 if test $ax_blas_lsame_fcall_ok = yes \
acdee77299e1 ax_blas_f77_func.m4: Overhaul to remove tabs, use indentation, follow m4 quoting guidelines.
Rik <rik@octave.org>
parents: 17976
diff changeset
185 -a $ax_blas_sdot_fcall_ok = yes \
acdee77299e1 ax_blas_f77_func.m4: Overhaul to remove tabs, use indentation, follow m4 quoting guidelines.
Rik <rik@octave.org>
parents: 17976
diff changeset
186 -a $ax_blas_ddot_fcall_ok = yes \
acdee77299e1 ax_blas_f77_func.m4: Overhaul to remove tabs, use indentation, follow m4 quoting guidelines.
Rik <rik@octave.org>
parents: 17976
diff changeset
187 -a $ax_blas_cdotu_fcall_ok = yes \
acdee77299e1 ax_blas_f77_func.m4: Overhaul to remove tabs, use indentation, follow m4 quoting guidelines.
Rik <rik@octave.org>
parents: 17976
diff changeset
188 -a $ax_blas_zdotu_fcall_ok = yes \
acdee77299e1 ax_blas_f77_func.m4: Overhaul to remove tabs, use indentation, follow m4 quoting guidelines.
Rik <rik@octave.org>
parents: 17976
diff changeset
189 -a $ax_blas_integer_size_ok = yes; then
acdee77299e1 ax_blas_f77_func.m4: Overhaul to remove tabs, use indentation, follow m4 quoting guidelines.
Rik <rik@octave.org>
parents: 17976
diff changeset
190 ax_blas_f77_func_ok=yes;
acdee77299e1 ax_blas_f77_func.m4: Overhaul to remove tabs, use indentation, follow m4 quoting guidelines.
Rik <rik@octave.org>
parents: 17976
diff changeset
191 $1
acdee77299e1 ax_blas_f77_func.m4: Overhaul to remove tabs, use indentation, follow m4 quoting guidelines.
Rik <rik@octave.org>
parents: 17976
diff changeset
192 else
acdee77299e1 ax_blas_f77_func.m4: Overhaul to remove tabs, use indentation, follow m4 quoting guidelines.
Rik <rik@octave.org>
parents: 17976
diff changeset
193 ax_blas_f77_func_ok=no;
acdee77299e1 ax_blas_f77_func.m4: Overhaul to remove tabs, use indentation, follow m4 quoting guidelines.
Rik <rik@octave.org>
parents: 17976
diff changeset
194 $2
acdee77299e1 ax_blas_f77_func.m4: Overhaul to remove tabs, use indentation, follow m4 quoting guidelines.
Rik <rik@octave.org>
parents: 17976
diff changeset
195 fi
acdee77299e1 ax_blas_f77_func.m4: Overhaul to remove tabs, use indentation, follow m4 quoting guidelines.
Rik <rik@octave.org>
parents: 17976
diff changeset
196 LIBS="$save_ax_blas_f77_func_LIBS"
acdee77299e1 ax_blas_f77_func.m4: Overhaul to remove tabs, use indentation, follow m4 quoting guidelines.
Rik <rik@octave.org>
parents: 17976
diff changeset
197 fi
10951
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
198 ])dnl AX_BLAS_F77_FUNC
7683
8136cb19fb7a implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
199
10951
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
200 AC_DEFUN([AX_BLAS_WITH_F77_FUNC], [
17977
acdee77299e1 ax_blas_f77_func.m4: Overhaul to remove tabs, use indentation, follow m4 quoting guidelines.
Rik <rik@octave.org>
parents: 17976
diff changeset
201 AC_PREREQ(2.50)
acdee77299e1 ax_blas_f77_func.m4: Overhaul to remove tabs, use indentation, follow m4 quoting guidelines.
Rik <rik@octave.org>
parents: 17976
diff changeset
202 AX_BLAS([# disable special action], [])
acdee77299e1 ax_blas_f77_func.m4: Overhaul to remove tabs, use indentation, follow m4 quoting guidelines.
Rik <rik@octave.org>
parents: 17976
diff changeset
203 if test x$ax_blas_ok = xyes ; then
acdee77299e1 ax_blas_f77_func.m4: Overhaul to remove tabs, use indentation, follow m4 quoting guidelines.
Rik <rik@octave.org>
parents: 17976
diff changeset
204 AX_BLAS_F77_FUNC(
acdee77299e1 ax_blas_f77_func.m4: Overhaul to remove tabs, use indentation, follow m4 quoting guidelines.
Rik <rik@octave.org>
parents: 17976
diff changeset
205 [ifelse([$1],,AC_DEFINE(HAVE_BLAS,1,[Define if you have a BLAS library.]),[$1])],
acdee77299e1 ax_blas_f77_func.m4: Overhaul to remove tabs, use indentation, follow m4 quoting guidelines.
Rik <rik@octave.org>
parents: 17976
diff changeset
206 [ax_blas_ok=no; BLAS_LIBS=],
acdee77299e1 ax_blas_f77_func.m4: Overhaul to remove tabs, use indentation, follow m4 quoting guidelines.
Rik <rik@octave.org>
parents: 17976
diff changeset
207 [$3])
acdee77299e1 ax_blas_f77_func.m4: Overhaul to remove tabs, use indentation, follow m4 quoting guidelines.
Rik <rik@octave.org>
parents: 17976
diff changeset
208 fi
acdee77299e1 ax_blas_f77_func.m4: Overhaul to remove tabs, use indentation, follow m4 quoting guidelines.
Rik <rik@octave.org>
parents: 17976
diff changeset
209 if test x$ax_blas_ok = xno ; then
acdee77299e1 ax_blas_f77_func.m4: Overhaul to remove tabs, use indentation, follow m4 quoting guidelines.
Rik <rik@octave.org>
parents: 17976
diff changeset
210 $2
acdee77299e1 ax_blas_f77_func.m4: Overhaul to remove tabs, use indentation, follow m4 quoting guidelines.
Rik <rik@octave.org>
parents: 17976
diff changeset
211 fi
10951
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
212 ])dnl AX_BLAS_WITH_F77_FUNC