octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

updating macros from autoconf archive in the Octave sources


From: John W. Eaton
Subject: updating macros from autoconf archive in the Octave sources
Date: Fri, 29 Jan 2010 15:48:04 -0500

I would like to update our copies of macros from the autoconf macro
archive, but we have some local changes.  If possible, I'd like to
resolve these differences by getting our changes included in the
macros in the archive instead of maintaining them only in Octave.  The
substantial changes I see are as follows.  In these diffs, + indicates
something in our copy and - is what is in the autoconf archive.  Also,
in the the archive ACX and acx are now AX and ax.  Before making the
diffs below, I made that substitution to our versions.

Jaroslav, would you please get our changes to ax_blas_f77_func.m4
transferred to the autoconf archive?

Thomas, we discussed the -framework vecLib issue in this thread:

  
https://www-old.cae.wisc.edu/pipermail/octave-maintainers/2007-October/004512.html

Is this still required?  If so, can you please report this problem to
the maintainer of the ax_blas.m4 package so this problem can be fixed
for all users of the autconf archive?

Jim, you reported needing "-lsunperf -lsunmath" instead of
"-xlic_lib=sunperf -lsunmath" even when compiling with the Sun
compiler.  Is that correct?  It looks like what is intended to be
happening is that the -xlic_lib=sunperf option is only supposed to be
tried if not using GCC, so it seems that someone thought that
-xlic_lib was required for non-GCC compilers.  Is that not correct, so
-lsunperf should also work properly with the Sun compiler?  I'm not
finding any documentation about this on the web, so I'm not sure what
is correct.  If you can help me understand the problem, I'll report it
to the autoconf archive maintainer.

Thanks,

jwe


-------------------
ax_blas_f77_func.m4
-------------------

--- ax_blas_f77_func.m4 2010-01-29 14:18:04.000000000 -0500
+++ /home/jwe/src/octave/m4/ax_blas_f77_func.m4 2010-01-29 14:51:06.000000000 
-0500
@@ -63,6 +64,7 @@
 if test "$cross_compiling" = yes ; then
        ifelse($3, ,$1,$3)
 elif test x"$ax_blas_ok" = xyes; then
+       save_ax_blas_f77_func_LIBS="$LIBS"
        LIBS="$BLAS_LIBS $LIBS"
        AC_LANG_PUSH(Fortran 77)
 # LSAME check (LOGICAL return values)
@@ -94,7 +96,7 @@
        [ax_blas_isamax_fcall_ok=no])
        AC_MSG_RESULT([$ax_blas_isamax_fcall_ok])
 # SDOT check (REAL return values)
-       AC_MSG_CHECKING([whether DDOT is called correctly from Fortran])
+       AC_MSG_CHECKING([whether SDOT is called correctly from Fortran])
        AC_RUN_IFELSE(AC_LANG_PROGRAM(,[[
       real sdot,a(1),b(1),w
       external sdot
@@ -141,6 +143,33 @@
       ]]),[ax_blas_zdotu_fcall_ok=yes],
        [ax_blas_zdotu_fcall_ok=no])
        AC_MSG_RESULT([$ax_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
+       ]]),[ax_blas_integer_size_ok=yes],
+       [ax_blas_integer_size_ok=no])
+       AC_MSG_RESULT([$ax_blas_integer_size_ok])
 
        AC_LANG_POP(Fortran 77)
 
@@ -149,13 +178,15 @@
                -a $ax_blas_sdot_fcall_ok = yes \
                -a $ax_blas_ddot_fcall_ok = yes \
                -a $ax_blas_cdotu_fcall_ok = yes \
-               -a $ax_blas_zdotu_fcall_ok = yes ; then
+               -a $ax_blas_zdotu_fcall_ok = yes \
+               -a $ax_blas_integer_size_ok = yes; then
                ax_blas_f77_func_ok=yes;
                $1
        else
                ax_blas_f77_func_ok=no;
                $2
        fi
+       LIBS="$save_ax_blas_f77_func_LIBS"
 fi
 
 ])dnl AX_BLAS_F77_FUNC


----------
ax_blas.m4
----------

--- ax_blas.m4  2010-01-29 14:18:04.000000000 -0500
+++ /home/jwe/src/octave/m4/ax_blas.m4  2010-01-29 14:51:18.000000000 -0500
@@ -116,6 +88,18 @@
                        [], [-latlas])])
 fi
 
+# BLAS in Apple vecLib framework? (Mac OS X)
+if test $ax_blas_ok = no; then
+       vlib_flags="-Wl,-framework -Wl,vecLib"
+       save_LIBS="$LIBS"; LIBS="$vlib_flags $LIBS"
+       AC_MSG_CHECKING([for $sgemm in $vlib_flags])
+       AC_LINK_IFELSE([AC_LANG_CALL([], [$sgemm])],
+                       [ax_blas_ok=yes; BLAS_LIBS="$vlib_flags"],
+                      [BLAS_LIBS=""])
+       AC_MSG_RESULT($ax_blas_ok)
+       LIBS="$save_LIBS"
+fi
+
 # BLAS in PhiPACK libraries? (requires generic BLAS lib, too)
 if test $ax_blas_ok = no; then
        AC_CHECK_LIB(blas, $sgemm,
@@ -126,18 +110,6 @@
                        [], [-lblas])])
 fi
 
-# BLAS in Intel MKL library?
-if test $ax_blas_ok = no; then
-       AC_CHECK_LIB(mkl, $sgemm, [ax_blas_ok=yes;BLAS_LIBS="-lmkl"])
-fi
-
-# BLAS in Apple vecLib library?
-if test $ax_blas_ok = no; then
-       save_LIBS="$LIBS"; LIBS="-framework vecLib $LIBS"
-       AC_CHECK_FUNC($sgemm, [ax_blas_ok=yes;BLAS_LIBS="-framework vecLib"])
-       LIBS="$save_LIBS"
-fi
-
 # BLAS in Alpha CXML library?
 if test $ax_blas_ok = no; then
        AC_CHECK_LIB(cxml, $sgemm, [ax_blas_ok=yes;BLAS_LIBS="-lcxml"])
@@ -153,7 +125,7 @@
        if test "x$GCC" != xyes; then # only works with Sun CC
                AC_CHECK_LIB(sunmath, acosp,
                        [AC_CHECK_LIB(sunperf, $sgemm,
-                               [BLAS_LIBS="-xlic_lib=sunperf -lsunmath"
+                               [BLAS_LIBS="-lsunperf -lsunmath"
                                  ax_blas_ok=yes],[],[-lsunmath])])
        fi
 fi




reply via email to

[Prev in Thread] Current Thread [Next in Thread]