changeset 7052:ee70ac66041f

[project @ 2007-10-23 17:46:48 by jwe]
author jwe
date Tue, 23 Oct 2007 17:46:48 +0000
parents 405001b6a514
children 570a382ce556
files configure.in liboctave/CRowVector.cc liboctave/ChangeLog
diffstat 3 files changed, 58 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/configure.in	Tue Oct 23 14:26:55 2007 +0000
+++ b/configure.in	Tue Oct 23 17:46:48 2007 +0000
@@ -29,7 +29,7 @@
 EXTERN_CXXFLAGS="$CXXFLAGS"
 
 AC_INIT
-AC_REVISION($Revision: 1.582 $)
+AC_REVISION($Revision: 1.583 $)
 AC_PREREQ(2.57)
 AC_CONFIG_SRCDIR([src/octave.cc])
 AC_CONFIG_HEADER(config.h)
@@ -853,6 +853,58 @@
 AC_SUBST(BLAS_DIR)
 AC_SUBST(LAPACK_DIR)
 
+dnl I see no clean way to do the following check with autoconf macros,
+dnl hence the big mess.
+
+AC_MSG_CHECKING([BLAS library calling convention compatibility])
+cat << EOF > conftest.$ac_fc_srcext
+      program foo
+      double complex zdotu, tmp, zx(10), zy(10), retval
+      integer n, incx, incy
+      n = 10
+      incx = 1
+      incy = 1
+      do 10 i = 1, n
+        zx(i) = dcmplx (i, 0);
+        zy(i) = dcmplx (0, i);
+   10 continue
+      retval = zdotu (n, zx, incx, zy, incy)
+      if (retval .eq. dcmplx (0, 385)) then
+        print *, 'succeeded'
+      else
+        print *, 'failed'
+        print *, retval
+      endif
+      end
+EOF
+XLIBS="$LIBS"
+LIBS="$BLAS_LIBS $LIBS $FLIBS"
+if $have_fortran_compiler; then
+  AC_LANG_PUSH(Fortran 77)
+  $ac_compile
+  $ac_link
+  AC_LANG_POP(Fortran 77)
+elif $have_f2c; then
+  AC_LANG_PUSH(C)
+  $(F2C) $(F2CFLAGS) < conftest.$ac_fc_srcext > conftest.$ac_ext
+  $ac_compile
+  $ac_link
+  AC_LANG_POP(C)
+fi
+LIBS="$XLIBS"
+case "`conftest.$ac_exeext`" in
+  *success*)
+  AC_MSG_RESULT(yes)
+;;
+  *)
+  AC_MSG_RESULT(no)
+  AC_MSG_WARN([Your BLAS library was apparently compiled with a Fortran])
+  AC_MSG_WARN([compiler that uses a different calling convention from])
+  AC_MSG_WARN([the one used by the selected compiler, $F77.])
+  AC_MSG_ERROR([You must correct this problem before building Octave.])
+;;
+esac
+
 # Check for AMD library
 AMD_LIBS=
 AC_SUBST(AMD_LIBS)
--- a/liboctave/CRowVector.cc	Tue Oct 23 14:26:55 2007 +0000
+++ b/liboctave/CRowVector.cc	Tue Oct 23 17:46:48 2007 +0000
@@ -502,8 +502,6 @@
     gripe_nonconformant ("operator *", len, a_len);
   else if (len != 0)
     F77_FUNC (xzdotu, XZDOTU) (len, v.data (), 1, a.data (), 1, retval);
-  for (octave_idx_type i = 0; i < len; i++)
-    retval += v.elem (i) * a.elem (i);
 
   return retval;
 }
--- a/liboctave/ChangeLog	Tue Oct 23 14:26:55 2007 +0000
+++ b/liboctave/ChangeLog	Tue Oct 23 17:46:48 2007 +0000
@@ -1,3 +1,8 @@
+2007-10-23  John W. Eaton  <jwe@octave.org>
+
+	* CRowVector.cc (operator * const ComplexRowVector&, const
+	ComplexColumnVector&)): Delete spurious code left from patch.
+
 2007-10-22  Kim Hansen  <kimhanse@gmail.com>
 
 	* chMatrix.cc, lo-utils.cc, oct-env.cc, oct-uname.cc,