# HG changeset patch # User Jaroslav Hajek # Date 1251873348 -7200 # Node ID de6f547574be7918e8b8c5c767bf16384e685436 # Parent 7be1bddd0f110c821550050d8121e9f377e37d2b BLAS integer size check in acx_blas_f77_func diff -r 7be1bddd0f11 -r de6f547574be ChangeLog --- a/ChangeLog Tue Sep 01 16:50:54 2009 -0400 +++ b/ChangeLog Wed Sep 02 08:35:48 2009 +0200 @@ -1,3 +1,8 @@ +2009-09-02 Jaroslav Hajek + + * acx_blas_f77_func.m4 (ACX_BLAS_F77_FUNC): Check for correct INTEGER + size. + 2009-09-01 John W. Eaton * aclocal.m4 (OCTAVE_REQUIRE_64_BIT_FORTRAN_INTEGERS): New macro. diff -r 7be1bddd0f11 -r de6f547574be acx_blas_f77_func.m4 --- a/acx_blas_f77_func.m4 Tue Sep 01 16:50:54 2009 -0400 +++ b/acx_blas_f77_func.m4 Wed Sep 02 08:35:48 2009 +0200 @@ -143,6 +143,33 @@ ]]),[acx_blas_zdotu_fcall_ok=yes], [acx_blas_zdotu_fcall_ok=no]) AC_MSG_RESULT([$acx_blas_zdotu_fcall_ok]) +# Check for correct integer size +# FIXME: this may fail with things like -ftrapping-math. + AC_MSG_CHECKING([whether the integer size is correct]) + AC_RUN_IFELSE(AC_LANG_PROGRAM(,[[ + integer n,nn(3) + real s,a(1),b(1),sdot + a(1) = 1.0 + b(1) = 1.0 +c Generate -2**33 + 1, if possible + n = 2 + n = -4 * (n ** 30) + n = n + 1 + if (n >= 0) goto 1 +c This means we're on 64-bit integers. Check whether the BLAS is, too. + s = sdot(n,a,1,b,1) + if (s .ne. 0.0) stop 1 + 1 continue +c We may be on 32-bit integers, and the BLAS on 64 bits. This is almost bound +c to have already failed, but just in case, we'll check. + nn(1) = -1 + nn(2) = 1 + nn(3) = -1 + s = sdot(nn(2),a,1,b,1) + if (s .ne. 1.0) stop 1 + ]]),[acx_blas_integer_size_ok=yes], + [acx_blas_integer_size_ok=no]) + AC_MSG_RESULT([$acx_blas_integer_size_ok]) AC_LANG_POP(Fortran 77) @@ -151,7 +178,8 @@ -a $acx_blas_sdot_fcall_ok = yes \ -a $acx_blas_ddot_fcall_ok = yes \ -a $acx_blas_cdotu_fcall_ok = yes \ - -a $acx_blas_zdotu_fcall_ok = yes ; then + -a $acx_blas_zdotu_fcall_ok = yes \ + -a $acx_blas_integer_size_ok = yes; then acx_blas_f77_func_ok=yes; $1 else