Mercurial > octave
annotate m4/octave_blas_f77_func.m4 @ 24893:a3eb0d746042 stable
doc: use canonical https URLs for all external gnu.org references
* Doxyfile.in, install.txi, native2unicode.m, unicode2native.m: Use canonical
https URLs to other GNU packages.
* find-dialog.cc, find-dialog.h: Use canonical https URLs for GPL and LGPL-2.1
license texts.
* ax_blas.m4, ax_compare_version.m4, ax_lapack.m4, ax_openmp.m4, ax_pthread.m4,
octave_blas_f77_func.m4: Use canonical https URL to original file source.
author | Mike Miller <mtmiller@octave.org> |
---|---|
date | Wed, 14 Mar 2018 22:49:19 -0700 |
parents | 194eb4bd202b |
children | 171d90967f16 |
rev | line source |
---|---|
22986
21707d6a02c7
make --enable-64 the default
John W. Eaton <jwe@octave.org>
parents:
19300
diff
changeset
|
1 # OCTAVE_BLAS_F77_FUNC |
21707d6a02c7
make --enable-64 the default
John W. Eaton <jwe@octave.org>
parents:
19300
diff
changeset
|
2 # |
21707d6a02c7
make --enable-64 the default
John W. Eaton <jwe@octave.org>
parents:
19300
diff
changeset
|
3 # The same as AX_BLAS_F77_FUNC (described below) except attempt to |
21707d6a02c7
make --enable-64 the default
John W. Eaton <jwe@octave.org>
parents:
19300
diff
changeset
|
4 # determine whether the BLAS library uses 32- or 64-bit integers instead |
21707d6a02c7
make --enable-64 the default
John W. Eaton <jwe@octave.org>
parents:
19300
diff
changeset
|
5 # of failing if the default size of Fortran integers does not appear to |
21707d6a02c7
make --enable-64 the default
John W. Eaton <jwe@octave.org>
parents:
19300
diff
changeset
|
6 # match the size of integers used by the BLAS library. |
21707d6a02c7
make --enable-64 the default
John W. Eaton <jwe@octave.org>
parents:
19300
diff
changeset
|
7 |
8027
fd13f9f7dbac
update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents:
7683
diff
changeset
|
8 # =========================================================================== |
24893
a3eb0d746042
doc: use canonical https URLs for all external gnu.org references
Mike Miller <mtmiller@octave.org>
parents:
24534
diff
changeset
|
9 # https://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
|
10 # =========================================================================== |
7683
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 # SYNOPSIS |
8136cb19fb7a
implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
13 # |
10951 | 14 # AX_BLAS_F77_FUNC([ACTION-IF-PASS[, ACTION-IF-FAIL[, ACTION-IF-CROSS-COMPILING]]) |
15 # 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
|
16 # |
8136cb19fb7a
implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
17 # DESCRIPTION |
8136cb19fb7a
implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
18 # |
10951 | 19 # 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
|
20 # 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
|
21 # 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
|
22 # of the BLAS. |
7683
8136cb19fb7a
implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
23 # |
10951 | 24 # 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
|
25 # 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
|
26 # resp. failure, resp. cross-compilation. |
7683
8136cb19fb7a
implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
27 # |
10951 | 28 # AX_BLAS_WITH_F77_FUNC is a drop-in replacement wrapper for AX_BLAS that |
29 # calls AX_BLAS_F77_FUNC after detecting a BLAS library and rejects it on | |
30 # 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
|
31 # |
10951 | 32 # LICENSE |
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 # Copyright (c) 2008 Jaroslav Hajek <highegg@gmail.com> |
8136cb19fb7a
implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
35 # |
8027
fd13f9f7dbac
update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents:
7683
diff
changeset
|
36 # 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
|
37 # 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
|
38 # 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
|
39 # option) any later version. |
7683
8136cb19fb7a
implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
40 # |
8136cb19fb7a
implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
41 # 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
|
42 # 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
|
43 # 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
|
44 # Public License for more details. |
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 # You should have received a copy of the GNU General Public License along |
24534
194eb4bd202b
maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents:
23876
diff
changeset
|
47 # with this program. If not, see <https://www.gnu.org/licenses/>. |
7683
8136cb19fb7a
implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
48 # |
8027
fd13f9f7dbac
update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents:
7683
diff
changeset
|
49 # 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
|
50 # 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
|
51 # 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
|
52 # 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
|
53 # 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
|
54 # 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
|
55 # 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
|
56 # |
8027
fd13f9f7dbac
update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents:
7683
diff
changeset
|
57 # This special exception to the GPL applies to versions of the Autoconf |
10951 | 58 # Macro released by the Autoconf Archive. When you make and distribute a |
59 # modified version of the Autoconf Macro, you may extend this special | |
60 # 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
|
61 |
15153
ba431d1106e3
build: Update ax_XXX macros in m4 directory to newest versions.
Rik <rik@octave.org>
parents:
10956
diff
changeset
|
62 #serial 8 |
10951 | 63 |
23085
dffa2b8c9482
maint: strip trailing whitespace from source files.
John W. Eaton <jwe@octave.org>
parents:
22986
diff
changeset
|
64 ## Derived from |
22986
21707d6a02c7
make --enable-64 the default
John W. Eaton <jwe@octave.org>
parents:
19300
diff
changeset
|
65 AC_DEFUN([OCTAVE_BLAS_F77_FUNC], [ |
19300
d6240c099a02
build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents:
17977
diff
changeset
|
66 AC_PREREQ(2.50) |
d6240c099a02
build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents:
17977
diff
changeset
|
67 AC_REQUIRE([AX_BLAS]) |
7683
8136cb19fb7a
implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
68 |
19300
d6240c099a02
build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents:
17977
diff
changeset
|
69 # F77 call-compatibility checks |
d6240c099a02
build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents:
17977
diff
changeset
|
70 if test "$cross_compiling" = yes ; then |
23876
b6e756d8f485
maint: eliminate TAB characters from source files
John W. Eaton <jwe@octave.org>
parents:
23085
diff
changeset
|
71 ifelse($3, ,$1,$3) |
19300
d6240c099a02
build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents:
17977
diff
changeset
|
72 elif test x"$ax_blas_ok" = xyes; then |
23876
b6e756d8f485
maint: eliminate TAB characters from source files
John W. Eaton <jwe@octave.org>
parents:
23085
diff
changeset
|
73 save_ax_blas_f77_func_LIBS="$LIBS" |
b6e756d8f485
maint: eliminate TAB characters from source files
John W. Eaton <jwe@octave.org>
parents:
23085
diff
changeset
|
74 LIBS="$BLAS_LIBS $LIBS" |
b6e756d8f485
maint: eliminate TAB characters from source files
John W. Eaton <jwe@octave.org>
parents:
23085
diff
changeset
|
75 AC_LANG_PUSH(Fortran 77) |
19300
d6240c099a02
build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents:
17977
diff
changeset
|
76 # LSAME check (LOGICAL return values) |
23876
b6e756d8f485
maint: eliminate TAB characters from source files
John W. Eaton <jwe@octave.org>
parents:
23085
diff
changeset
|
77 AC_MSG_CHECKING([whether LSAME is called correctly from Fortran]) |
b6e756d8f485
maint: eliminate TAB characters from source files
John W. Eaton <jwe@octave.org>
parents:
23085
diff
changeset
|
78 AC_RUN_IFELSE(AC_LANG_PROGRAM(,[[ |
7683
8136cb19fb7a
implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
79 logical lsame,w |
8136cb19fb7a
implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
80 external lsame |
8136cb19fb7a
implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
81 character c1,c2 |
8136cb19fb7a
implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
82 c1 = 'A' |
8136cb19fb7a
implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
83 c2 = 'B' |
8136cb19fb7a
implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
84 w = lsame(c1,c2) |
8136cb19fb7a
implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
85 if (w) stop 1 |
8136cb19fb7a
implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
86 w = lsame(c1,c1) |
8136cb19fb7a
implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
87 if (.not. w) stop 1 |
19300
d6240c099a02
build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents:
17977
diff
changeset
|
88 ]]),[ax_blas_lsame_fcall_ok=yes], |
23876
b6e756d8f485
maint: eliminate TAB characters from source files
John W. Eaton <jwe@octave.org>
parents:
23085
diff
changeset
|
89 [ax_blas_lsame_fcall_ok=no]) |
b6e756d8f485
maint: eliminate TAB characters from source files
John W. Eaton <jwe@octave.org>
parents:
23085
diff
changeset
|
90 AC_MSG_RESULT([$ax_blas_lsame_fcall_ok]) |
19300
d6240c099a02
build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents:
17977
diff
changeset
|
91 # ISAMAX check (INTEGER return values) |
23876
b6e756d8f485
maint: eliminate TAB characters from source files
John W. Eaton <jwe@octave.org>
parents:
23085
diff
changeset
|
92 AC_MSG_CHECKING([whether ISAMAX is called correctly from Fortran]) |
b6e756d8f485
maint: eliminate TAB characters from source files
John W. Eaton <jwe@octave.org>
parents:
23085
diff
changeset
|
93 AC_RUN_IFELSE(AC_LANG_PROGRAM(,[[ |
8027
fd13f9f7dbac
update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents:
7683
diff
changeset
|
94 integer isamax,i |
fd13f9f7dbac
update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents:
7683
diff
changeset
|
95 external isamax |
fd13f9f7dbac
update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents:
7683
diff
changeset
|
96 real a(2) |
fd13f9f7dbac
update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents:
7683
diff
changeset
|
97 a(1) = 1e0 |
fd13f9f7dbac
update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents:
7683
diff
changeset
|
98 a(2) = -2e0 |
fd13f9f7dbac
update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents:
7683
diff
changeset
|
99 i = isamax(2,a,1) |
fd13f9f7dbac
update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents:
7683
diff
changeset
|
100 if (i.ne.2) stop 1 |
19300
d6240c099a02
build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents:
17977
diff
changeset
|
101 ]]),[ax_blas_isamax_fcall_ok=yes], |
23876
b6e756d8f485
maint: eliminate TAB characters from source files
John W. Eaton <jwe@octave.org>
parents:
23085
diff
changeset
|
102 [ax_blas_isamax_fcall_ok=no]) |
b6e756d8f485
maint: eliminate TAB characters from source files
John W. Eaton <jwe@octave.org>
parents:
23085
diff
changeset
|
103 AC_MSG_RESULT([$ax_blas_isamax_fcall_ok]) |
19300
d6240c099a02
build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents:
17977
diff
changeset
|
104 # SDOT check (REAL return values) |
23876
b6e756d8f485
maint: eliminate TAB characters from source files
John W. Eaton <jwe@octave.org>
parents:
23085
diff
changeset
|
105 AC_MSG_CHECKING([whether SDOT is called correctly from Fortran]) |
b6e756d8f485
maint: eliminate TAB characters from source files
John W. Eaton <jwe@octave.org>
parents:
23085
diff
changeset
|
106 AC_RUN_IFELSE(AC_LANG_PROGRAM(,[[ |
8027
fd13f9f7dbac
update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents:
7683
diff
changeset
|
107 real sdot,a(1),b(1),w |
fd13f9f7dbac
update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents:
7683
diff
changeset
|
108 external sdot |
fd13f9f7dbac
update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents:
7683
diff
changeset
|
109 a(1) = 1e0 |
fd13f9f7dbac
update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents:
7683
diff
changeset
|
110 b(1) = 2e0 |
fd13f9f7dbac
update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents:
7683
diff
changeset
|
111 w = sdot(1,a,1,b,1) |
fd13f9f7dbac
update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents:
7683
diff
changeset
|
112 if (w .ne. a(1)*b(1)) stop 1 |
19300
d6240c099a02
build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents:
17977
diff
changeset
|
113 ]]),[ax_blas_sdot_fcall_ok=yes], |
23876
b6e756d8f485
maint: eliminate TAB characters from source files
John W. Eaton <jwe@octave.org>
parents:
23085
diff
changeset
|
114 [ax_blas_sdot_fcall_ok=no]) |
b6e756d8f485
maint: eliminate TAB characters from source files
John W. Eaton <jwe@octave.org>
parents:
23085
diff
changeset
|
115 AC_MSG_RESULT([$ax_blas_sdot_fcall_ok]) |
19300
d6240c099a02
build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents:
17977
diff
changeset
|
116 # DDOT check (DOUBLE return values) |
23876
b6e756d8f485
maint: eliminate TAB characters from source files
John W. Eaton <jwe@octave.org>
parents:
23085
diff
changeset
|
117 AC_MSG_CHECKING([whether DDOT is called correctly from Fortran]) |
b6e756d8f485
maint: eliminate TAB characters from source files
John W. Eaton <jwe@octave.org>
parents:
23085
diff
changeset
|
118 AC_RUN_IFELSE(AC_LANG_PROGRAM(,[[ |
7683
8136cb19fb7a
implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
119 double precision ddot,a(1),b(1),w |
8136cb19fb7a
implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
120 external ddot |
8027
fd13f9f7dbac
update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents:
7683
diff
changeset
|
121 a(1) = 1d0 |
fd13f9f7dbac
update macros from cryp.to auoconf archive
Jaroslav Hajek <highegg@gmail.com>
parents:
7683
diff
changeset
|
122 b(1) = 2d0 |
7683
8136cb19fb7a
implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
123 w = ddot(1,a,1,b,1) |
8136cb19fb7a
implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
124 if (w .ne. a(1)*b(1)) stop 1 |
19300
d6240c099a02
build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents:
17977
diff
changeset
|
125 ]]),[ax_blas_ddot_fcall_ok=yes], |
23876
b6e756d8f485
maint: eliminate TAB characters from source files
John W. Eaton <jwe@octave.org>
parents:
23085
diff
changeset
|
126 [ax_blas_ddot_fcall_ok=no]) |
b6e756d8f485
maint: eliminate TAB characters from source files
John W. Eaton <jwe@octave.org>
parents:
23085
diff
changeset
|
127 AC_MSG_RESULT([$ax_blas_ddot_fcall_ok]) |
19300
d6240c099a02
build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents:
17977
diff
changeset
|
128 # CDOTU check (COMPLEX return values) |
23876
b6e756d8f485
maint: eliminate TAB characters from source files
John W. Eaton <jwe@octave.org>
parents:
23085
diff
changeset
|
129 AC_MSG_CHECKING([whether CDOTU is called correctly from Fortran]) |
b6e756d8f485
maint: eliminate TAB characters from source files
John W. Eaton <jwe@octave.org>
parents:
23085
diff
changeset
|
130 AC_RUN_IFELSE(AC_LANG_PROGRAM(,[[ |
7683
8136cb19fb7a
implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
131 complex cdotu,a(1),b(1),w |
8136cb19fb7a
implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
132 external cdotu |
8136cb19fb7a
implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
133 a(1) = cmplx(1e0,1e0) |
8136cb19fb7a
implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
134 b(1) = cmplx(1e0,2e0) |
8136cb19fb7a
implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
135 w = cdotu(1,a,1,b,1) |
8136cb19fb7a
implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
136 if (w .ne. a(1)*b(1)) stop 1 |
19300
d6240c099a02
build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents:
17977
diff
changeset
|
137 ]]),[ax_blas_cdotu_fcall_ok=yes], |
23876
b6e756d8f485
maint: eliminate TAB characters from source files
John W. Eaton <jwe@octave.org>
parents:
23085
diff
changeset
|
138 [ax_blas_cdotu_fcall_ok=no]) |
b6e756d8f485
maint: eliminate TAB characters from source files
John W. Eaton <jwe@octave.org>
parents:
23085
diff
changeset
|
139 AC_MSG_RESULT([$ax_blas_cdotu_fcall_ok]) |
19300
d6240c099a02
build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents:
17977
diff
changeset
|
140 # ZDOTU check (DOUBLE COMPLEX return values) |
23876
b6e756d8f485
maint: eliminate TAB characters from source files
John W. Eaton <jwe@octave.org>
parents:
23085
diff
changeset
|
141 AC_MSG_CHECKING([whether ZDOTU is called correctly from Fortran]) |
b6e756d8f485
maint: eliminate TAB characters from source files
John W. Eaton <jwe@octave.org>
parents:
23085
diff
changeset
|
142 AC_RUN_IFELSE(AC_LANG_PROGRAM(,[[ |
7683
8136cb19fb7a
implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
143 double complex zdotu,a(1),b(1),w |
8136cb19fb7a
implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
144 external zdotu |
8136cb19fb7a
implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
145 a(1) = dcmplx(1d0,1d0) |
8136cb19fb7a
implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
146 b(1) = dcmplx(1d0,2d0) |
8136cb19fb7a
implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
147 w = zdotu(1,a,1,b,1) |
8136cb19fb7a
implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
148 if (w .ne. a(1)*b(1)) stop 1 |
19300
d6240c099a02
build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents:
17977
diff
changeset
|
149 ]]),[ax_blas_zdotu_fcall_ok=yes], |
23876
b6e756d8f485
maint: eliminate TAB characters from source files
John W. Eaton <jwe@octave.org>
parents:
23085
diff
changeset
|
150 [ax_blas_zdotu_fcall_ok=no]) |
b6e756d8f485
maint: eliminate TAB characters from source files
John W. Eaton <jwe@octave.org>
parents:
23085
diff
changeset
|
151 AC_MSG_RESULT([$ax_blas_zdotu_fcall_ok]) |
22986
21707d6a02c7
make --enable-64 the default
John W. Eaton <jwe@octave.org>
parents:
19300
diff
changeset
|
152 # Check BLAS library integer size. If it does not appear to be |
21707d6a02c7
make --enable-64 the default
John W. Eaton <jwe@octave.org>
parents:
19300
diff
changeset
|
153 # 8 bytes, we assume it is 4 bytes. |
19300
d6240c099a02
build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents:
17977
diff
changeset
|
154 # FIXME: this may fail with things like -ftrapping-math. |
22986
21707d6a02c7
make --enable-64 the default
John W. Eaton <jwe@octave.org>
parents:
19300
diff
changeset
|
155 AC_MSG_CHECKING([BLAS library integer size]) |
19300
d6240c099a02
build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents:
17977
diff
changeset
|
156 AC_RUN_IFELSE(AC_LANG_PROGRAM(,[[ |
22986
21707d6a02c7
make --enable-64 the default
John W. Eaton <jwe@octave.org>
parents:
19300
diff
changeset
|
157 integer*8 n |
21707d6a02c7
make --enable-64 the default
John W. Eaton <jwe@octave.org>
parents:
19300
diff
changeset
|
158 integer*4 n4 |
10956
cab8365e476d
update ax_blas_f77_func.m4
Jaroslav Hajek <highegg@gmail.com>
parents:
10951
diff
changeset
|
159 real s,a(1),b(1),sdot |
cab8365e476d
update ax_blas_f77_func.m4
Jaroslav Hajek <highegg@gmail.com>
parents:
10951
diff
changeset
|
160 a(1) = 1.0 |
cab8365e476d
update ax_blas_f77_func.m4
Jaroslav Hajek <highegg@gmail.com>
parents:
10951
diff
changeset
|
161 b(1) = 1.0 |
22986
21707d6a02c7
make --enable-64 the default
John W. Eaton <jwe@octave.org>
parents:
19300
diff
changeset
|
162 c Generate -2**33 + 1. With BLAS compiled to use 64-bit integers, SDOT |
21707d6a02c7
make --enable-64 the default
John W. Eaton <jwe@octave.org>
parents:
19300
diff
changeset
|
163 c will return early, setting the result to 0. With BLAS compiled to use |
21707d6a02c7
make --enable-64 the default
John W. Eaton <jwe@octave.org>
parents:
19300
diff
changeset
|
164 c 32-bit integers, this value should be interpreted as 1 and SDOT will |
21707d6a02c7
make --enable-64 the default
John W. Eaton <jwe@octave.org>
parents:
19300
diff
changeset
|
165 c return 1. |
10956
cab8365e476d
update ax_blas_f77_func.m4
Jaroslav Hajek <highegg@gmail.com>
parents:
10951
diff
changeset
|
166 n = 2 |
19300
d6240c099a02
build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents:
17977
diff
changeset
|
167 n = -4 * (n ** 30) |
10956
cab8365e476d
update ax_blas_f77_func.m4
Jaroslav Hajek <highegg@gmail.com>
parents:
10951
diff
changeset
|
168 n = n + 1 |
22986
21707d6a02c7
make --enable-64 the default
John W. Eaton <jwe@octave.org>
parents:
19300
diff
changeset
|
169 c Check that our expectation about the type conversion is correct. |
21707d6a02c7
make --enable-64 the default
John W. Eaton <jwe@octave.org>
parents:
19300
diff
changeset
|
170 n4 = n |
21707d6a02c7
make --enable-64 the default
John W. Eaton <jwe@octave.org>
parents:
19300
diff
changeset
|
171 if (n4 .ne. 1) then |
21707d6a02c7
make --enable-64 the default
John W. Eaton <jwe@octave.org>
parents:
19300
diff
changeset
|
172 print *, 'invalid assumption about integer type conversion' |
21707d6a02c7
make --enable-64 the default
John W. Eaton <jwe@octave.org>
parents:
19300
diff
changeset
|
173 stop 2 |
21707d6a02c7
make --enable-64 the default
John W. Eaton <jwe@octave.org>
parents:
19300
diff
changeset
|
174 endif |
10956
cab8365e476d
update ax_blas_f77_func.m4
Jaroslav Hajek <highegg@gmail.com>
parents:
10951
diff
changeset
|
175 s = sdot(n,a,1,b,1) |
cab8365e476d
update ax_blas_f77_func.m4
Jaroslav Hajek <highegg@gmail.com>
parents:
10951
diff
changeset
|
176 if (s .ne. 0.0) stop 1 |
22986
21707d6a02c7
make --enable-64 the default
John W. Eaton <jwe@octave.org>
parents:
19300
diff
changeset
|
177 ]]),[ax_blas_integer_size=8], |
23876
b6e756d8f485
maint: eliminate TAB characters from source files
John W. Eaton <jwe@octave.org>
parents:
23085
diff
changeset
|
178 [ax_blas_integer_size=4]) |
b6e756d8f485
maint: eliminate TAB characters from source files
John W. Eaton <jwe@octave.org>
parents:
23085
diff
changeset
|
179 AC_MSG_RESULT([$ax_blas_integer_size]) |
7683
8136cb19fb7a
implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
180 |
23876
b6e756d8f485
maint: eliminate TAB characters from source files
John W. Eaton <jwe@octave.org>
parents:
23085
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 |
19300
d6240c099a02
build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents:
17977
diff
changeset
|
183 # if any of the tests failed, reject the BLAS library |
23876
b6e756d8f485
maint: eliminate TAB characters from source files
John W. Eaton <jwe@octave.org>
parents:
23085
diff
changeset
|
184 if test $ax_blas_lsame_fcall_ok = yes \ |
b6e756d8f485
maint: eliminate TAB characters from source files
John W. Eaton <jwe@octave.org>
parents:
23085
diff
changeset
|
185 -a $ax_blas_sdot_fcall_ok = yes \ |
b6e756d8f485
maint: eliminate TAB characters from source files
John W. Eaton <jwe@octave.org>
parents:
23085
diff
changeset
|
186 -a $ax_blas_ddot_fcall_ok = yes \ |
b6e756d8f485
maint: eliminate TAB characters from source files
John W. Eaton <jwe@octave.org>
parents:
23085
diff
changeset
|
187 -a $ax_blas_cdotu_fcall_ok = yes \ |
b6e756d8f485
maint: eliminate TAB characters from source files
John W. Eaton <jwe@octave.org>
parents:
23085
diff
changeset
|
188 -a $ax_blas_zdotu_fcall_ok = yes ; then |
b6e756d8f485
maint: eliminate TAB characters from source files
John W. Eaton <jwe@octave.org>
parents:
23085
diff
changeset
|
189 ax_blas_f77_func_ok=yes; |
b6e756d8f485
maint: eliminate TAB characters from source files
John W. Eaton <jwe@octave.org>
parents:
23085
diff
changeset
|
190 $1 |
b6e756d8f485
maint: eliminate TAB characters from source files
John W. Eaton <jwe@octave.org>
parents:
23085
diff
changeset
|
191 else |
b6e756d8f485
maint: eliminate TAB characters from source files
John W. Eaton <jwe@octave.org>
parents:
23085
diff
changeset
|
192 ax_blas_f77_func_ok=no; |
b6e756d8f485
maint: eliminate TAB characters from source files
John W. Eaton <jwe@octave.org>
parents:
23085
diff
changeset
|
193 $2 |
b6e756d8f485
maint: eliminate TAB characters from source files
John W. Eaton <jwe@octave.org>
parents:
23085
diff
changeset
|
194 fi |
b6e756d8f485
maint: eliminate TAB characters from source files
John W. Eaton <jwe@octave.org>
parents:
23085
diff
changeset
|
195 LIBS="$save_ax_blas_f77_func_LIBS" |
19300
d6240c099a02
build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents:
17977
diff
changeset
|
196 fi |
d6240c099a02
build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents:
17977
diff
changeset
|
197 |
10951 | 198 ])dnl AX_BLAS_F77_FUNC |
7683
8136cb19fb7a
implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
199 |
22986
21707d6a02c7
make --enable-64 the default
John W. Eaton <jwe@octave.org>
parents:
19300
diff
changeset
|
200 AC_DEFUN([OCTAVE_BLAS_WITH_F77_FUNC], [ |
19300
d6240c099a02
build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents:
17977
diff
changeset
|
201 AC_PREREQ(2.50) |
d6240c099a02
build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents:
17977
diff
changeset
|
202 AX_BLAS([# disable special action], []) |
d6240c099a02
build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents:
17977
diff
changeset
|
203 if test x$ax_blas_ok = xyes ; then |
23876
b6e756d8f485
maint: eliminate TAB characters from source files
John W. Eaton <jwe@octave.org>
parents:
23085
diff
changeset
|
204 OCTAVE_BLAS_F77_FUNC( |
b6e756d8f485
maint: eliminate TAB characters from source files
John W. Eaton <jwe@octave.org>
parents:
23085
diff
changeset
|
205 [ifelse([$1],,AC_DEFINE(HAVE_BLAS,1,[Define if you have a BLAS library.]),[$1])], |
b6e756d8f485
maint: eliminate TAB characters from source files
John W. Eaton <jwe@octave.org>
parents:
23085
diff
changeset
|
206 [ax_blas_ok=no; BLAS_LIBS=]) |
19300
d6240c099a02
build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents:
17977
diff
changeset
|
207 fi |
d6240c099a02
build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents:
17977
diff
changeset
|
208 if test x$ax_blas_ok = xno ; then |
23876
b6e756d8f485
maint: eliminate TAB characters from source files
John W. Eaton <jwe@octave.org>
parents:
23085
diff
changeset
|
209 $2 |
19300
d6240c099a02
build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents:
17977
diff
changeset
|
210 fi |
10951 | 211 ])dnl AX_BLAS_WITH_F77_FUNC |