annotate acx_blas_f77_func.m4 @ 8710:739141cde75a ss-3-1-52

fix typo in Array-f.cc
author Jaroslav Hajek <highegg@gmail.com>
date Mon, 09 Feb 2009 21:51:31 +0100
parents fd13f9f7dbac
children afbdf01bcacc
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 # ===========================================================================
fd13f9f7dbac update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents: 7683
diff changeset
2 # http://autoconf-archive.cryp.to/acx_blas_f77_func.html
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 #
8136cb19fb7a implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
7 # ACX_BLAS_F77_FUNC([ACTION-IF-PASS[, ACTION-IF-FAIL[, ACTION-IF-CROSS-COMPILING]])
8136cb19fb7a implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
8 # ACX_BLAS_WITH_F77_FUNC([ACTION-IF-FOUND-AND-PASS[, ACTION-IF-NOT-FOUND-OR-FAIL]])
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 #
8136cb19fb7a implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
12 # These macros are intended as a supplement to the ACX_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 #
8027
fd13f9f7dbac update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents: 7683
diff changeset
17 # ACX_BLAS_F77_FUNC uses the defined BLAS_LIBS and Fortran environment to
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 #
8027
fd13f9f7dbac update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents: 7683
diff changeset
21 # ACX_BLAS_WITH_F77_FUNC is a drop-in replacement wrapper for ACX_BLAS
fd13f9f7dbac update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents: 7683
diff changeset
22 # that calls ACX_BLAS_F77_FUNC after detecting a BLAS library and rejects
fd13f9f7dbac update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents: 7683
diff changeset
23 # it on 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 #
8136cb19fb7a implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
25 # LAST MODIFICATION
8136cb19fb7a implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
26 #
8027
fd13f9f7dbac update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents: 7683
diff changeset
27 # 2008-06-18
7683
8136cb19fb7a implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
28 #
8136cb19fb7a implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
29 # COPYLEFT
8136cb19fb7a implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
30 #
8136cb19fb7a implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
31 # Copyright (c) 2008 Jaroslav Hajek <highegg@gmail.com>
8136cb19fb7a implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
32 #
8027
fd13f9f7dbac update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents: 7683
diff changeset
33 # 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
34 # 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
35 # 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
36 # option) any later version.
7683
8136cb19fb7a implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
37 #
8136cb19fb7a implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
38 # 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
39 # 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
40 # 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
41 # Public License for more details.
7683
8136cb19fb7a implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
42 #
8027
fd13f9f7dbac update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents: 7683
diff changeset
43 # 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
44 # 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
45 #
8027
fd13f9f7dbac update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents: 7683
diff changeset
46 # 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
47 # 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
48 # 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
49 # 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
50 # 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
51 # 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
52 # 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
53 #
8027
fd13f9f7dbac update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents: 7683
diff changeset
54 # This special exception to the GPL applies to versions of the Autoconf
fd13f9f7dbac update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents: 7683
diff changeset
55 # Macro released by the Autoconf Macro Archive. When you make and
fd13f9f7dbac update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents: 7683
diff changeset
56 # distribute a modified version of the Autoconf Macro, you may extend this
fd13f9f7dbac update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents: 7683
diff changeset
57 # special 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
58
8136cb19fb7a implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
59 AC_DEFUN([ACX_BLAS_F77_FUNC], [
8136cb19fb7a implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
60 AC_PREREQ(2.50)
8136cb19fb7a implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
61 AC_REQUIRE([ACX_BLAS])
8136cb19fb7a implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
62
8136cb19fb7a implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
63 # F77 call-compatibility checks
8136cb19fb7a implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
64 if test "$cross_compiling" = yes ; then
8136cb19fb7a implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
65 ifelse($3, ,$1,$3)
8136cb19fb7a implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
66 elif test x"$acx_blas_ok" = xyes; then
8136cb19fb7a implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
67 LIBS="$BLAS_LIBS $LIBS"
8136cb19fb7a implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
68 AC_LANG_PUSH(Fortran 77)
8136cb19fb7a implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
69 # LSAME check (LOGICAL return values)
8136cb19fb7a implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
70 AC_MSG_CHECKING([whether LSAME is called correctly from Fortran])
8136cb19fb7a implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
71 AC_RUN_IFELSE(AC_LANG_PROGRAM(,[[
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
8136cb19fb7a implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
81 ]]),[acx_blas_lsame_fcall_ok=yes],
8136cb19fb7a implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
82 [acx_blas_lsame_fcall_ok=no])
8136cb19fb7a implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
83 AC_MSG_RESULT([$acx_blas_lsame_fcall_ok])
8027
fd13f9f7dbac update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents: 7683
diff changeset
84 # ISAMAX check (INTEGER return values)
fd13f9f7dbac update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents: 7683
diff changeset
85 AC_MSG_CHECKING([whether ISAMAX is called correctly from Fortran])
fd13f9f7dbac update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents: 7683
diff changeset
86 AC_RUN_IFELSE(AC_LANG_PROGRAM(,[[
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
fd13f9f7dbac update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents: 7683
diff changeset
94 ]]),[acx_blas_isamax_fcall_ok=yes],
fd13f9f7dbac update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents: 7683
diff changeset
95 [acx_blas_isamax_fcall_ok=no])
fd13f9f7dbac update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents: 7683
diff changeset
96 AC_MSG_RESULT([$acx_blas_isamax_fcall_ok])
fd13f9f7dbac update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents: 7683
diff changeset
97 # SDOT check (REAL return values)
fd13f9f7dbac update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents: 7683
diff changeset
98 AC_MSG_CHECKING([whether DDOT is called correctly from Fortran])
fd13f9f7dbac update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents: 7683
diff changeset
99 AC_RUN_IFELSE(AC_LANG_PROGRAM(,[[
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
fd13f9f7dbac update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents: 7683
diff changeset
106 ]]),[acx_blas_sdot_fcall_ok=yes],
fd13f9f7dbac update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents: 7683
diff changeset
107 [acx_blas_sdot_fcall_ok=no])
fd13f9f7dbac update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents: 7683
diff changeset
108 AC_MSG_RESULT([$acx_blas_sdot_fcall_ok])
7683
8136cb19fb7a implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
109 # DDOT check (DOUBLE return values)
8136cb19fb7a implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
110 AC_MSG_CHECKING([whether DDOT is called correctly from Fortran])
8136cb19fb7a implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
111 AC_RUN_IFELSE(AC_LANG_PROGRAM(,[[
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
8136cb19fb7a implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
118 ]]),[acx_blas_ddot_fcall_ok=yes],
8136cb19fb7a implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
119 [acx_blas_ddot_fcall_ok=no])
8136cb19fb7a implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
120 AC_MSG_RESULT([$acx_blas_ddot_fcall_ok])
8136cb19fb7a implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
121 # CDOTU check (COMPLEX return values)
8136cb19fb7a implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
122 AC_MSG_CHECKING([whether CDOTU is called correctly from Fortran])
8136cb19fb7a implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
123 AC_RUN_IFELSE(AC_LANG_PROGRAM(,[[
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
8136cb19fb7a implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
130 ]]),[acx_blas_cdotu_fcall_ok=yes],
8136cb19fb7a implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
131 [acx_blas_cdotu_fcall_ok=no])
8136cb19fb7a implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
132 AC_MSG_RESULT([$acx_blas_cdotu_fcall_ok])
8136cb19fb7a implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
133 # ZDOTU check (DOUBLE COMPLEX return values)
8136cb19fb7a implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
134 AC_MSG_CHECKING([whether ZDOTU is called correctly from Fortran])
8136cb19fb7a implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
135 AC_RUN_IFELSE(AC_LANG_PROGRAM(,[[
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
8136cb19fb7a implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
142 ]]),[acx_blas_zdotu_fcall_ok=yes],
8136cb19fb7a implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
143 [acx_blas_zdotu_fcall_ok=no])
8136cb19fb7a implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
144 AC_MSG_RESULT([$acx_blas_zdotu_fcall_ok])
8136cb19fb7a implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
145
8136cb19fb7a implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
146 AC_LANG_POP(Fortran 77)
8136cb19fb7a implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
147
8136cb19fb7a implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
148 # if any of the tests failed, reject the BLAS library
8136cb19fb7a implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
149 if test $acx_blas_lsame_fcall_ok = yes \
8027
fd13f9f7dbac update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents: 7683
diff changeset
150 -a $acx_blas_sdot_fcall_ok = yes \
7683
8136cb19fb7a implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
151 -a $acx_blas_ddot_fcall_ok = yes \
8136cb19fb7a implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
152 -a $acx_blas_cdotu_fcall_ok = yes \
8136cb19fb7a implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
153 -a $acx_blas_zdotu_fcall_ok = yes ; then
8136cb19fb7a implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
154 acx_blas_f77_func_ok=yes;
8136cb19fb7a implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
155 $1
8136cb19fb7a implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
156 else
8136cb19fb7a implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
157 acx_blas_f77_func_ok=no;
8136cb19fb7a implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
158 $2
8136cb19fb7a implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
159 fi
8136cb19fb7a implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
160 fi
8136cb19fb7a implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
161
8136cb19fb7a implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
162 ])dnl ACX_BLAS_F77_FUNC
8136cb19fb7a implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
163
8136cb19fb7a implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
164 AC_DEFUN([ACX_BLAS_WITH_F77_FUNC], [
8136cb19fb7a implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
165 AC_PREREQ(2.50)
8136cb19fb7a implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
166 ACX_BLAS([# disable special action], [])
8136cb19fb7a implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
167 if test x$acx_blas_ok = xyes ; then
8136cb19fb7a implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
168 ACX_BLAS_F77_FUNC(
8136cb19fb7a implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
169 [ifelse([$1],,AC_DEFINE(HAVE_BLAS,1,[Define if you have a BLAS library.]),[$1])],
8136cb19fb7a implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
170 [acx_blas_ok=no; BLAS_LIBS=])
8136cb19fb7a implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
171 fi
8136cb19fb7a implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
172 if test x$acx_blas_ok = xno ; then
8136cb19fb7a implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
173 $2
8136cb19fb7a implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
174 fi
8136cb19fb7a implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
175 ])dnl ACX_BLAS_WITH_F77_FUNC