annotate m4/octave_blas_f77_func.m4 @ 31210:9ad55d2e1bbf stable

Make sure we don't pass short 8.3 path to latex on Windows (bug #62779). * latex-text-renderer.cc (latex_renderer::write_tex_file): On Windows, use canonicalized path of temporary directory.
author Pantxo Diribarne <pantxo.diribarne@gmail.com>
date Sun, 28 Aug 2022 22:44:49 +0200
parents f19e621d7f2d
children 1077a1c277fb
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
14 # 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
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
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
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
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
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
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
28 # 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
29 # 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
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
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
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
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
58 # 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
59 # modified version of the Autoconf Macro, you may extend this special
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
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
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
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(,[[
25632
171d90967f16 fix test for 8-byte integer BLAS lib on big-endian systems (bug #53853)
John W. Eaton <jwe@octave.org>
parents: 24893
diff changeset
157 integer*8 two, n
171d90967f16 fix test for 8-byte integer BLAS lib on big-endian systems (bug #53853)
John W. Eaton <jwe@octave.org>
parents: 24893
diff changeset
158 integer*4 n2(2)
171d90967f16 fix test for 8-byte integer BLAS lib on big-endian systems (bug #53853)
John W. Eaton <jwe@octave.org>
parents: 24893
diff changeset
159 double precision d, a(1), b(1), ddot
171d90967f16 fix test for 8-byte integer BLAS lib on big-endian systems (bug #53853)
John W. Eaton <jwe@octave.org>
parents: 24893
diff changeset
160 equivalence (n, n2)
171d90967f16 fix test for 8-byte integer BLAS lib on big-endian systems (bug #53853)
John W. Eaton <jwe@octave.org>
parents: 24893
diff changeset
161
10956
cab8365e476d update ax_blas_f77_func.m4
Jaroslav Hajek <highegg@gmail.com>
parents: 10951
diff changeset
162 a(1) = 1.0
cab8365e476d update ax_blas_f77_func.m4
Jaroslav Hajek <highegg@gmail.com>
parents: 10951
diff changeset
163 b(1) = 1.0
25632
171d90967f16 fix test for 8-byte integer BLAS lib on big-endian systems (bug #53853)
John W. Eaton <jwe@octave.org>
parents: 24893
diff changeset
164
171d90967f16 fix test for 8-byte integer BLAS lib on big-endian systems (bug #53853)
John W. Eaton <jwe@octave.org>
parents: 24893
diff changeset
165 c Generate 2**32 + 1 in an 8-byte integer. Whether we have a big
171d90967f16 fix test for 8-byte integer BLAS lib on big-endian systems (bug #53853)
John W. Eaton <jwe@octave.org>
parents: 24893
diff changeset
166 c endian or little endian system, both 4-byte words of this value
171d90967f16 fix test for 8-byte integer BLAS lib on big-endian systems (bug #53853)
John W. Eaton <jwe@octave.org>
parents: 24893
diff changeset
167 c should be 1.
171d90967f16 fix test for 8-byte integer BLAS lib on big-endian systems (bug #53853)
John W. Eaton <jwe@octave.org>
parents: 24893
diff changeset
168
171d90967f16 fix test for 8-byte integer BLAS lib on big-endian systems (bug #53853)
John W. Eaton <jwe@octave.org>
parents: 24893
diff changeset
169 two = 2
171d90967f16 fix test for 8-byte integer BLAS lib on big-endian systems (bug #53853)
John W. Eaton <jwe@octave.org>
parents: 24893
diff changeset
170 n = (two ** 32) + 1
171d90967f16 fix test for 8-byte integer BLAS lib on big-endian systems (bug #53853)
John W. Eaton <jwe@octave.org>
parents: 24893
diff changeset
171
171d90967f16 fix test for 8-byte integer BLAS lib on big-endian systems (bug #53853)
John W. Eaton <jwe@octave.org>
parents: 24893
diff changeset
172 c Check that our expectation about the type conversions are correct.
171d90967f16 fix test for 8-byte integer BLAS lib on big-endian systems (bug #53853)
John W. Eaton <jwe@octave.org>
parents: 24893
diff changeset
173
171d90967f16 fix test for 8-byte integer BLAS lib on big-endian systems (bug #53853)
John W. Eaton <jwe@octave.org>
parents: 24893
diff changeset
174 if (n2(1) .ne. 1 .or. n2(2) .ne. 1) then
22986
21707d6a02c7 make --enable-64 the default
John W. Eaton <jwe@octave.org>
parents: 19300
diff changeset
175 print *, 'invalid assumption about integer type conversion'
21707d6a02c7 make --enable-64 the default
John W. Eaton <jwe@octave.org>
parents: 19300
diff changeset
176 stop 2
21707d6a02c7 make --enable-64 the default
John W. Eaton <jwe@octave.org>
parents: 19300
diff changeset
177 endif
25632
171d90967f16 fix test for 8-byte integer BLAS lib on big-endian systems (bug #53853)
John W. Eaton <jwe@octave.org>
parents: 24893
diff changeset
178
171d90967f16 fix test for 8-byte integer BLAS lib on big-endian systems (bug #53853)
John W. Eaton <jwe@octave.org>
parents: 24893
diff changeset
179 * print *, n, n2(1), n2(2)
171d90967f16 fix test for 8-byte integer BLAS lib on big-endian systems (bug #53853)
John W. Eaton <jwe@octave.org>
parents: 24893
diff changeset
180 * print *, a(1), b(1)
171d90967f16 fix test for 8-byte integer BLAS lib on big-endian systems (bug #53853)
John W. Eaton <jwe@octave.org>
parents: 24893
diff changeset
181
171d90967f16 fix test for 8-byte integer BLAS lib on big-endian systems (bug #53853)
John W. Eaton <jwe@octave.org>
parents: 24893
diff changeset
182 c DDOT will either see 1 or a large value for N. Since INCX and INCY
171d90967f16 fix test for 8-byte integer BLAS lib on big-endian systems (bug #53853)
John W. Eaton <jwe@octave.org>
parents: 24893
diff changeset
183 c are both 0, we will never increment the index, so A and B only need to
171d90967f16 fix test for 8-byte integer BLAS lib on big-endian systems (bug #53853)
John W. Eaton <jwe@octave.org>
parents: 24893
diff changeset
184 c have a single element. If N is interpreted as 1 (BLAS compiled with 4
171d90967f16 fix test for 8-byte integer BLAS lib on big-endian systems (bug #53853)
John W. Eaton <jwe@octave.org>
parents: 24893
diff changeset
185 c byte integers) then the result will be 1. If N is interpreted as a
171d90967f16 fix test for 8-byte integer BLAS lib on big-endian systems (bug #53853)
John W. Eaton <jwe@octave.org>
parents: 24893
diff changeset
186 c large value (BLAS compiled with 8 byte integers) then the result will
171d90967f16 fix test for 8-byte integer BLAS lib on big-endian systems (bug #53853)
John W. Eaton <jwe@octave.org>
parents: 24893
diff changeset
187 c be the summation a(1)*b(1) 2^32+1 times. This will also take some
171d90967f16 fix test for 8-byte integer BLAS lib on big-endian systems (bug #53853)
John W. Eaton <jwe@octave.org>
parents: 24893
diff changeset
188 c time to compute, but at least for now it is the unusual case so we are
171d90967f16 fix test for 8-byte integer BLAS lib on big-endian systems (bug #53853)
John W. Eaton <jwe@octave.org>
parents: 24893
diff changeset
189 c much more likely to exit quickly after detecting that the BLAS library
171d90967f16 fix test for 8-byte integer BLAS lib on big-endian systems (bug #53853)
John W. Eaton <jwe@octave.org>
parents: 24893
diff changeset
190 c was compiled with 4-byte integers.
171d90967f16 fix test for 8-byte integer BLAS lib on big-endian systems (bug #53853)
John W. Eaton <jwe@octave.org>
parents: 24893
diff changeset
191
171d90967f16 fix test for 8-byte integer BLAS lib on big-endian systems (bug #53853)
John W. Eaton <jwe@octave.org>
parents: 24893
diff changeset
192 d = ddot (n, a, 0, b, 0)
171d90967f16 fix test for 8-byte integer BLAS lib on big-endian systems (bug #53853)
John W. Eaton <jwe@octave.org>
parents: 24893
diff changeset
193
171d90967f16 fix test for 8-byte integer BLAS lib on big-endian systems (bug #53853)
John W. Eaton <jwe@octave.org>
parents: 24893
diff changeset
194 * print *, a(1), b(1), d
171d90967f16 fix test for 8-byte integer BLAS lib on big-endian systems (bug #53853)
John W. Eaton <jwe@octave.org>
parents: 24893
diff changeset
195
171d90967f16 fix test for 8-byte integer BLAS lib on big-endian systems (bug #53853)
John W. Eaton <jwe@octave.org>
parents: 24893
diff changeset
196 c Success (0 exit status) means we detected BLAS compiled with
171d90967f16 fix test for 8-byte integer BLAS lib on big-endian systems (bug #53853)
John W. Eaton <jwe@octave.org>
parents: 24893
diff changeset
197 c 8-byte integers.
171d90967f16 fix test for 8-byte integer BLAS lib on big-endian systems (bug #53853)
John W. Eaton <jwe@octave.org>
parents: 24893
diff changeset
198
171d90967f16 fix test for 8-byte integer BLAS lib on big-endian systems (bug #53853)
John W. Eaton <jwe@octave.org>
parents: 24893
diff changeset
199 if (d .eq. 1.0) then
171d90967f16 fix test for 8-byte integer BLAS lib on big-endian systems (bug #53853)
John W. Eaton <jwe@octave.org>
parents: 24893
diff changeset
200 stop 1
171d90967f16 fix test for 8-byte integer BLAS lib on big-endian systems (bug #53853)
John W. Eaton <jwe@octave.org>
parents: 24893
diff changeset
201 endif
171d90967f16 fix test for 8-byte integer BLAS lib on big-endian systems (bug #53853)
John W. Eaton <jwe@octave.org>
parents: 24893
diff changeset
202
22986
21707d6a02c7 make --enable-64 the default
John W. Eaton <jwe@octave.org>
parents: 19300
diff changeset
203 ]]),[ax_blas_integer_size=8],
23876
b6e756d8f485 maint: eliminate TAB characters from source files
John W. Eaton <jwe@octave.org>
parents: 23085
diff changeset
204 [ax_blas_integer_size=4])
b6e756d8f485 maint: eliminate TAB characters from source files
John W. Eaton <jwe@octave.org>
parents: 23085
diff changeset
205 AC_MSG_RESULT([$ax_blas_integer_size])
7683
8136cb19fb7a implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
206
23876
b6e756d8f485 maint: eliminate TAB characters from source files
John W. Eaton <jwe@octave.org>
parents: 23085
diff changeset
207 AC_LANG_POP(Fortran 77)
7683
8136cb19fb7a implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
208
19300
d6240c099a02 build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents: 17977
diff changeset
209 # 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
210 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
211 -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
212 -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
213 -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
214 -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
215 ax_blas_f77_func_ok=yes;
b6e756d8f485 maint: eliminate TAB characters from source files
John W. Eaton <jwe@octave.org>
parents: 23085
diff changeset
216 $1
b6e756d8f485 maint: eliminate TAB characters from source files
John W. Eaton <jwe@octave.org>
parents: 23085
diff changeset
217 else
b6e756d8f485 maint: eliminate TAB characters from source files
John W. Eaton <jwe@octave.org>
parents: 23085
diff changeset
218 ax_blas_f77_func_ok=no;
b6e756d8f485 maint: eliminate TAB characters from source files
John W. Eaton <jwe@octave.org>
parents: 23085
diff changeset
219 $2
b6e756d8f485 maint: eliminate TAB characters from source files
John W. Eaton <jwe@octave.org>
parents: 23085
diff changeset
220 fi
b6e756d8f485 maint: eliminate TAB characters from source files
John W. Eaton <jwe@octave.org>
parents: 23085
diff changeset
221 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
222 fi
d6240c099a02 build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents: 17977
diff changeset
223
10951
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
224 ])dnl AX_BLAS_F77_FUNC
7683
8136cb19fb7a implement BLAS-F77 call compatibility check
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
225
22986
21707d6a02c7 make --enable-64 the default
John W. Eaton <jwe@octave.org>
parents: 19300
diff changeset
226 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
227 AC_PREREQ(2.50)
d6240c099a02 build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents: 17977
diff changeset
228 AX_BLAS([# disable special action], [])
d6240c099a02 build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents: 17977
diff changeset
229 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
230 OCTAVE_BLAS_F77_FUNC(
b6e756d8f485 maint: eliminate TAB characters from source files
John W. Eaton <jwe@octave.org>
parents: 23085
diff changeset
231 [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
232 [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
233 fi
d6240c099a02 build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents: 17977
diff changeset
234 if test x$ax_blas_ok = xno ; then
27487
f19e621d7f2d avoid error if second arg for OCTAVE_BLAS_F77_FUNC is empty (bug #57042)
John W. Eaton <jwe@octave.org>
parents: 25765
diff changeset
235 :
23876
b6e756d8f485 maint: eliminate TAB characters from source files
John W. Eaton <jwe@octave.org>
parents: 23085
diff changeset
236 $2
19300
d6240c099a02 build: Update m4 macros to their latest versions (bug #43517).
Rik <rik@octave.org>
parents: 17977
diff changeset
237 fi
10951
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 9645
diff changeset
238 ])dnl AX_BLAS_WITH_F77_FUNC