Mercurial > hg > octave-nkf
changeset 10951:97b8d462ef11
Update m4 macros.
author | Ben Abbott <bpabbott@mac.com> |
---|---|
date | Tue, 07 Sep 2010 17:10:00 -0400 |
parents | c9786e03670c |
children | 18b0af0bbd6b |
files | ChangeLog acinclude.m4 configure.ac m4/acx_blas.m4 m4/acx_blas_f77_func.m4 m4/acx_lapack.m4 m4/acx_pthread.m4 m4/ax_blas.m4 m4/ax_blas_f77_func.m4 m4/ax_lapack.m4 m4/ax_pthread.m4 m4/module.mk |
diffstat | 8 files changed, 258 insertions(+), 241 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2010-09-07 Ben Abbott <bpabbott@mac.com> + + * acinclude.m4, configure.ac, m4/module.mk: Update acx_*.m4 + macros to the newer ax_*.m4 versions. + * ax_blas.m4, ax_lapack.m4, ax_blas_f77_func.m4, + ax_pthread.m4: Add files. + * acx_blas.m4, acx_lapack.m4, acx_blas_f77_func.m4, + acx_pthread.m4: Remove files. + 2010-09-01 Jaroslav Hajek <highegg@gmail.com> * NEWS: Update.
--- a/acinclude.m4 +++ b/acinclude.m4 @@ -1589,7 +1589,7 @@ dnl External macros. dnl -m4_include([m4/acx_pthread.m4]) -m4_include([m4/acx_blas.m4]) -m4_include([m4/acx_blas_f77_func.m4]) -m4_include([m4/acx_lapack.m4]) +m4_include([m4/ax_pthread.m4]) +m4_include([m4/ax_blas.m4]) +m4_include([m4/ax_blas_f77_func.m4]) +m4_include([m4/ax_lapack.m4])
--- a/configure.ac +++ b/configure.ac @@ -310,7 +310,7 @@ AC_SUBST(DEPEND_FLAGS) AC_SUBST(DEPEND_EXTRA_SED_PATTERN) -ACX_PTHREAD +AX_PTHREAD ### Include pthread libs and flags here in case other tests need them. ### They seem to be required for the OpenGL tests on Debian systems. LIBS="$PTHREAD_LIBS $LIBS" @@ -947,14 +947,14 @@ save_FFLAGS="$FFLAGS" FFLAGS="$FFLAGS $F77_INTEGER_8_FLAG" -ACX_BLAS_WITH_F77_FUNC([:], [:]) -ACX_LAPACK([:], [:]) +AX_BLAS_WITH_F77_FUNC([:], [:]) +AX_LAPACK([:], [:]) ## Restore FFLAGS. FFLAGS="$save_FFLAGS" -if test "x$acx_blas_f77_func_ok" = "xno"; then - if $USE_64_BIT_IDX_T && test "$acx_blas_integer_size_ok" = "no" ; then +if test "x$ax_blas_f77_func_ok" = "xno"; then + if $USE_64_BIT_IDX_T && test "$ax_blas_integer_size_ok" = "no" ; then ## Attempt to be more informative. AC_MSG_ERROR([BLAS doesn't seem to support 64-bit integers. This is incompatible with --enable-64.]) else @@ -962,7 +962,7 @@ fi fi -if test x$acx_blas_ok = xno || test x$acx_lapack_ok = xno; then +if test x$ax_blas_ok = xno || test x$ax_lapack_ok = xno; then AC_MSG_ERROR([You are required to have BLAS and LAPACK libraries]) fi
rename from m4/acx_blas.m4 rename to m4/ax_blas.m4 --- a/m4/acx_blas.m4 +++ b/m4/ax_blas.m4 @@ -1,169 +1,197 @@ -dnl @synopsis ACX_BLAS([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) -dnl -dnl This macro looks for a library that implements the BLAS -dnl linear-algebra interface (see http://www.netlib.org/blas/). -dnl On success, it sets the BLAS_LIBS output variable to -dnl hold the requisite library linkages. -dnl -dnl To link with BLAS, you should link with: -dnl -dnl $BLAS_LIBS $LIBS $FLIBS -dnl -dnl in that order. FLIBS is the output variable of the -dnl AC_F77_LIBRARY_LDFLAGS macro (called if necessary by ACX_BLAS), -dnl and is sometimes necessary in order to link with F77 libraries. -dnl Users will also need to use AC_F77_DUMMY_MAIN (see the autoconf -dnl manual), for the same reason. -dnl -dnl Many libraries are searched for, from ATLAS to CXML to ESSL. -dnl The user may also use --with-blas=<lib> in order to use some -dnl specific BLAS library <lib>. In order to link successfully, -dnl however, be aware that you will probably need to use the same -dnl Fortran compiler (which can be set via the F77 env. var.) as -dnl was used to compile the BLAS library. -dnl -dnl ACTION-IF-FOUND is a list of shell commands to run if a BLAS -dnl library is found, and ACTION-IF-NOT-FOUND is a list of commands -dnl to run it if it is not found. If ACTION-IF-FOUND is not specified, -dnl the default action will define HAVE_BLAS. -dnl -dnl This macro requires autoconf 2.50 or later. -dnl -dnl @version $Id: acx_blas.m4,v 1.2 2001/12/13 01:03:06 simons Exp $ -dnl @author Steven G. Johnson <stevenj@alum.mit.edu> -dnl -AC_DEFUN([ACX_BLAS], [ +# =========================================================================== +# http://www.gnu.org/software/autoconf-archive/ax_blas.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_BLAS([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) +# +# DESCRIPTION +# +# This macro looks for a library that implements the BLAS linear-algebra +# interface (see http://www.netlib.org/blas/). On success, it sets the +# BLAS_LIBS output variable to hold the requisite library linkages. +# +# To link with BLAS, you should link with: +# +# $BLAS_LIBS $LIBS $FLIBS +# +# in that order. FLIBS is the output variable of the +# AC_F77_LIBRARY_LDFLAGS macro (called if necessary by AX_BLAS), and is +# sometimes necessary in order to link with F77 libraries. Users will also +# need to use AC_F77_DUMMY_MAIN (see the autoconf manual), for the same +# reason. +# +# Many libraries are searched for, from ATLAS to CXML to ESSL. The user +# may also use --with-blas=<lib> in order to use some specific BLAS +# library <lib>. In order to link successfully, however, be aware that you +# will probably need to use the same Fortran compiler (which can be set +# via the F77 env. var.) as was used to compile the BLAS library. +# +# ACTION-IF-FOUND is a list of shell commands to run if a BLAS library is +# found, and ACTION-IF-NOT-FOUND is a list of commands to run it if it is +# not found. If ACTION-IF-FOUND is not specified, the default action will +# define HAVE_BLAS. +# +# LICENSE +# +# Copyright (c) 2008 Steven G. Johnson <stevenj@alum.mit.edu> +# +# This program is free software: you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the +# Free Software Foundation, either version 3 of the License, or (at your +# option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General +# Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program. If not, see <http://www.gnu.org/licenses/>. +# +# As a special exception, the respective Autoconf Macro's copyright owner +# gives unlimited permission to copy, distribute and modify the configure +# scripts that are the output of Autoconf when processing the Macro. You +# need not follow the terms of the GNU General Public License when using +# or distributing such scripts, even though portions of the text of the +# Macro appear in them. The GNU General Public License (GPL) does govern +# all other use of the material that constitutes the Autoconf Macro. +# +# This special exception to the GPL applies to versions of the Autoconf +# Macro released by the Autoconf Archive. When you make and distribute a +# modified version of the Autoconf Macro, you may extend this special +# exception to the GPL to apply to your modified version as well. + +#serial 8 + +AU_ALIAS([ACX_BLAS], [AX_BLAS]) +AC_DEFUN([AX_BLAS], [ AC_PREREQ(2.50) AC_REQUIRE([AC_F77_LIBRARY_LDFLAGS]) -acx_blas_ok=no +ax_blas_ok=no AC_ARG_WITH(blas, [AS_HELP_STRING([--with-blas=<lib>], [use BLAS library <lib>])]) case $with_blas in yes | "") ;; - no) acx_blas_ok=disable ;; + no) ax_blas_ok=disable ;; -* | */* | *.a | *.so | *.so.* | *.o) BLAS_LIBS="$with_blas" ;; *) BLAS_LIBS="-l$with_blas" ;; esac # Get fortran linker names of BLAS functions to check for. -if $have_fortran_compiler; then - AC_F77_FUNC(sgemm) - AC_F77_FUNC(dgemm) -elif $have_f2c; then - sgemm=sgemm_ - dgemm=dgemm_ -fi +AC_F77_FUNC(sgemm) +AC_F77_FUNC(dgemm) -acx_blas_save_LIBS="$LIBS" +ax_blas_save_LIBS="$LIBS" LIBS="$LIBS $FLIBS" # First, check BLAS_LIBS environment variable -if test $acx_blas_ok = no; then +if test $ax_blas_ok = no; then if test "x$BLAS_LIBS" != x; then save_LIBS="$LIBS"; LIBS="$BLAS_LIBS $LIBS" AC_MSG_CHECKING([for $sgemm in $BLAS_LIBS]) - AC_LINK_IFELSE([AC_LANG_CALL([], [$sgemm])], - [acx_blas_ok=yes], [BLAS_LIBS=""]) - AC_MSG_RESULT($acx_blas_ok) + AC_TRY_LINK_FUNC($sgemm, [ax_blas_ok=yes], [BLAS_LIBS=""]) + AC_MSG_RESULT($ax_blas_ok) LIBS="$save_LIBS" fi fi # BLAS linked to by default? (happens on some supercomputers) -if test $acx_blas_ok = no; then +if test $ax_blas_ok = no; then save_LIBS="$LIBS"; LIBS="$LIBS" - AC_CHECK_FUNC($sgemm, [acx_blas_ok=yes]) + AC_CHECK_FUNC($sgemm, [ax_blas_ok=yes]) LIBS="$save_LIBS" fi # BLAS in ATLAS library? (http://math-atlas.sourceforge.net/) -if test $acx_blas_ok = no; then +if test $ax_blas_ok = no; then AC_CHECK_LIB(atlas, ATL_xerbla, [AC_CHECK_LIB(f77blas, $sgemm, [AC_CHECK_LIB(cblas, cblas_dgemm, - [acx_blas_ok=yes + [ax_blas_ok=yes BLAS_LIBS="-lcblas -lf77blas -latlas"], [], [-lf77blas -latlas])], [], [-latlas])]) fi -# BLAS in Apple vecLib framework? (Mac OS X) -if test $acx_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])], - [acx_blas_ok=yes; BLAS_LIBS="$vlib_flags"], - [BLAS_LIBS=""]) - AC_MSG_RESULT($acx_blas_ok) - LIBS="$save_LIBS" -fi - # BLAS in PhiPACK libraries? (requires generic BLAS lib, too) -if test $acx_blas_ok = no; then +if test $ax_blas_ok = no; then AC_CHECK_LIB(blas, $sgemm, [AC_CHECK_LIB(dgemm, $dgemm, [AC_CHECK_LIB(sgemm, $sgemm, - [acx_blas_ok=yes; BLAS_LIBS="-lsgemm -ldgemm -lblas"], + [ax_blas_ok=yes; BLAS_LIBS="-lsgemm -ldgemm -lblas"], [], [-lblas])], [], [-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 $acx_blas_ok = no; then - AC_CHECK_LIB(cxml, $sgemm, [acx_blas_ok=yes;BLAS_LIBS="-lcxml"]) +if test $ax_blas_ok = no; then + AC_CHECK_LIB(cxml, $sgemm, [ax_blas_ok=yes;BLAS_LIBS="-lcxml"]) fi # BLAS in Alpha DXML library? (now called CXML, see above) -if test $acx_blas_ok = no; then - AC_CHECK_LIB(dxml, $sgemm, [acx_blas_ok=yes;BLAS_LIBS="-ldxml"]) +if test $ax_blas_ok = no; then + AC_CHECK_LIB(dxml, $sgemm, [ax_blas_ok=yes;BLAS_LIBS="-ldxml"]) fi # BLAS in Sun Performance library? -if test $acx_blas_ok = no; then +if test $ax_blas_ok = no; then if test "x$GCC" != xyes; then # only works with Sun CC AC_CHECK_LIB(sunmath, acosp, [AC_CHECK_LIB(sunperf, $sgemm, - [BLAS_LIBS="-lsunperf -lsunmath" - acx_blas_ok=yes],[],[-lsunmath])]) + [BLAS_LIBS="-xlic_lib=sunperf -lsunmath" + ax_blas_ok=yes],[],[-lsunmath])]) fi fi # BLAS in SCSL library? (SGI/Cray Scientific Library) -if test $acx_blas_ok = no; then - AC_CHECK_LIB(scs, $sgemm, [acx_blas_ok=yes; BLAS_LIBS="-lscs"]) +if test $ax_blas_ok = no; then + AC_CHECK_LIB(scs, $sgemm, [ax_blas_ok=yes; BLAS_LIBS="-lscs"]) fi # BLAS in SGIMATH library? -if test $acx_blas_ok = no; then +if test $ax_blas_ok = no; then AC_CHECK_LIB(complib.sgimath, $sgemm, - [acx_blas_ok=yes; BLAS_LIBS="-lcomplib.sgimath"]) + [ax_blas_ok=yes; BLAS_LIBS="-lcomplib.sgimath"]) fi # BLAS in IBM ESSL library? (requires generic BLAS lib, too) -if test $acx_blas_ok = no; then +if test $ax_blas_ok = no; then AC_CHECK_LIB(blas, $sgemm, [AC_CHECK_LIB(essl, $sgemm, - [acx_blas_ok=yes; BLAS_LIBS="-lessl -lblas"], + [ax_blas_ok=yes; BLAS_LIBS="-lessl -lblas"], [], [-lblas $FLIBS])]) fi # Generic BLAS library? -if test $acx_blas_ok = no; then - AC_CHECK_LIB(blas, $sgemm, [acx_blas_ok=yes; BLAS_LIBS="-lblas"]) +if test $ax_blas_ok = no; then + AC_CHECK_LIB(blas, $sgemm, [ax_blas_ok=yes; BLAS_LIBS="-lblas"]) fi AC_SUBST(BLAS_LIBS) -LIBS="$acx_blas_save_LIBS" +LIBS="$ax_blas_save_LIBS" # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: -if test x"$acx_blas_ok" = xyes; then +if test x"$ax_blas_ok" = xyes; then ifelse([$1],,AC_DEFINE(HAVE_BLAS,1,[Define if you have a BLAS library.]),[$1]) : else - acx_blas_ok=no + ax_blas_ok=no $2 fi -])dnl ACX_BLAS +])dnl AX_BLAS
rename from m4/acx_blas_f77_func.m4 rename to m4/ax_blas_f77_func.m4 --- a/m4/acx_blas_f77_func.m4 +++ b/m4/ax_blas_f77_func.m4 @@ -1,32 +1,28 @@ # =========================================================================== -# http://autoconf-archive.cryp.to/acx_blas_f77_func.html +# http://www.gnu.org/software/autoconf-archive/ax_blas_f77_func.html # =========================================================================== # # SYNOPSIS # -# ACX_BLAS_F77_FUNC([ACTION-IF-PASS[, ACTION-IF-FAIL[, ACTION-IF-CROSS-COMPILING]]) -# ACX_BLAS_WITH_F77_FUNC([ACTION-IF-FOUND-AND-PASS[, ACTION-IF-NOT-FOUND-OR-FAIL]]) +# AX_BLAS_F77_FUNC([ACTION-IF-PASS[, ACTION-IF-FAIL[, ACTION-IF-CROSS-COMPILING]]) +# AX_BLAS_WITH_F77_FUNC([ACTION-IF-FOUND-AND-PASS[, ACTION-IF-NOT-FOUND-OR-FAIL]]) # # DESCRIPTION # -# These macros are intended as a supplement to the ACX_BLAS macro, to +# These macros are intended as a supplement to the AX_BLAS macro, to # verify that BLAS functions are properly callable from Fortran. This is # necessary, for example, if you want to build the LAPACK library on top # of the BLAS. # -# ACX_BLAS_F77_FUNC uses the defined BLAS_LIBS and Fortran environment to +# AX_BLAS_F77_FUNC uses the defined BLAS_LIBS and Fortran environment to # check for compatibility, and takes a specific action in case of success, # resp. failure, resp. cross-compilation. # -# ACX_BLAS_WITH_F77_FUNC is a drop-in replacement wrapper for ACX_BLAS -# that calls ACX_BLAS_F77_FUNC after detecting a BLAS library and rejects -# it on failure (i.e. pretends that no library was found). +# AX_BLAS_WITH_F77_FUNC is a drop-in replacement wrapper for AX_BLAS that +# calls AX_BLAS_F77_FUNC after detecting a BLAS library and rejects it on +# failure (i.e. pretends that no library was found). # -# LAST MODIFICATION -# -# 2008-06-18 -# -# COPYLEFT +# LICENSE # # Copyright (c) 2008 Jaroslav Hajek <highegg@gmail.com> # @@ -52,19 +48,21 @@ # all other use of the material that constitutes the Autoconf Macro. # # This special exception to the GPL applies to versions of the Autoconf -# Macro released by the Autoconf Macro Archive. When you make and -# distribute a modified version of the Autoconf Macro, you may extend this -# special exception to the GPL to apply to your modified version as well. +# Macro released by the Autoconf Archive. When you make and distribute a +# modified version of the Autoconf Macro, you may extend this special +# exception to the GPL to apply to your modified version as well. -AC_DEFUN([ACX_BLAS_F77_FUNC], [ +#serial 5 + +AU_ALIAS([ACX_BLAS_F77_FUNC], [AX_BLAS_F77_FUNC]) +AC_DEFUN([AX_BLAS_F77_FUNC], [ AC_PREREQ(2.50) -AC_REQUIRE([ACX_BLAS]) +AC_REQUIRE([AX_BLAS]) # F77 call-compatibility checks if test "$cross_compiling" = yes ; then ifelse($3, ,$1,$3) -elif test x"$acx_blas_ok" = xyes; then - save_acx_blas_f77_func_LIBS="$LIBS" +elif test x"$ax_blas_ok" = xyes; then LIBS="$BLAS_LIBS $LIBS" AC_LANG_PUSH(Fortran 77) # LSAME check (LOGICAL return values) @@ -79,9 +77,9 @@ if (w) stop 1 w = lsame(c1,c1) if (.not. w) stop 1 - ]]),[acx_blas_lsame_fcall_ok=yes], - [acx_blas_lsame_fcall_ok=no]) - AC_MSG_RESULT([$acx_blas_lsame_fcall_ok]) + ]]),[ax_blas_lsame_fcall_ok=yes], + [ax_blas_lsame_fcall_ok=no]) + AC_MSG_RESULT([$ax_blas_lsame_fcall_ok]) # ISAMAX check (INTEGER return values) AC_MSG_CHECKING([whether ISAMAX is called correctly from Fortran]) AC_RUN_IFELSE(AC_LANG_PROGRAM(,[[ @@ -92,11 +90,11 @@ a(2) = -2e0 i = isamax(2,a,1) if (i.ne.2) stop 1 - ]]),[acx_blas_isamax_fcall_ok=yes], - [acx_blas_isamax_fcall_ok=no]) - AC_MSG_RESULT([$acx_blas_isamax_fcall_ok]) + ]]),[ax_blas_isamax_fcall_ok=yes], + [ax_blas_isamax_fcall_ok=no]) + AC_MSG_RESULT([$ax_blas_isamax_fcall_ok]) # SDOT check (REAL return values) - AC_MSG_CHECKING([whether SDOT is called correctly from Fortran]) + AC_MSG_CHECKING([whether DDOT is called correctly from Fortran]) AC_RUN_IFELSE(AC_LANG_PROGRAM(,[[ real sdot,a(1),b(1),w external sdot @@ -104,9 +102,9 @@ b(1) = 2e0 w = sdot(1,a,1,b,1) if (w .ne. a(1)*b(1)) stop 1 - ]]),[acx_blas_sdot_fcall_ok=yes], - [acx_blas_sdot_fcall_ok=no]) - AC_MSG_RESULT([$acx_blas_sdot_fcall_ok]) + ]]),[ax_blas_sdot_fcall_ok=yes], + [ax_blas_sdot_fcall_ok=no]) + AC_MSG_RESULT([$ax_blas_sdot_fcall_ok]) # DDOT check (DOUBLE return values) AC_MSG_CHECKING([whether DDOT is called correctly from Fortran]) AC_RUN_IFELSE(AC_LANG_PROGRAM(,[[ @@ -116,9 +114,9 @@ b(1) = 2d0 w = ddot(1,a,1,b,1) if (w .ne. a(1)*b(1)) stop 1 - ]]),[acx_blas_ddot_fcall_ok=yes], - [acx_blas_ddot_fcall_ok=no]) - AC_MSG_RESULT([$acx_blas_ddot_fcall_ok]) + ]]),[ax_blas_ddot_fcall_ok=yes], + [ax_blas_ddot_fcall_ok=no]) + AC_MSG_RESULT([$ax_blas_ddot_fcall_ok]) # CDOTU check (COMPLEX return values) AC_MSG_CHECKING([whether CDOTU is called correctly from Fortran]) AC_RUN_IFELSE(AC_LANG_PROGRAM(,[[ @@ -128,9 +126,9 @@ b(1) = cmplx(1e0,2e0) w = cdotu(1,a,1,b,1) if (w .ne. a(1)*b(1)) stop 1 - ]]),[acx_blas_cdotu_fcall_ok=yes], - [acx_blas_cdotu_fcall_ok=no]) - AC_MSG_RESULT([$acx_blas_cdotu_fcall_ok]) + ]]),[ax_blas_cdotu_fcall_ok=yes], + [ax_blas_cdotu_fcall_ok=no]) + AC_MSG_RESULT([$ax_blas_cdotu_fcall_ok]) # ZDOTU check (DOUBLE COMPLEX return values) AC_MSG_CHECKING([whether ZDOTU is called correctly from Fortran]) AC_RUN_IFELSE(AC_LANG_PROGRAM(,[[ @@ -140,66 +138,37 @@ b(1) = dcmplx(1d0,2d0) w = zdotu(1,a,1,b,1) if (w .ne. a(1)*b(1)) stop 1 - ]]),[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]) + ]]),[ax_blas_zdotu_fcall_ok=yes], + [ax_blas_zdotu_fcall_ok=no]) + AC_MSG_RESULT([$ax_blas_zdotu_fcall_ok]) AC_LANG_POP(Fortran 77) # if any of the tests failed, reject the BLAS library - if test $acx_blas_lsame_fcall_ok = yes \ - -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 \ - -a $acx_blas_integer_size_ok = yes; then - acx_blas_f77_func_ok=yes; + if test $ax_blas_lsame_fcall_ok = yes \ + -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 + ax_blas_f77_func_ok=yes; $1 else - acx_blas_f77_func_ok=no; + ax_blas_f77_func_ok=no; $2 fi - LIBS="$save_acx_blas_f77_func_LIBS" fi -])dnl ACX_BLAS_F77_FUNC +])dnl AX_BLAS_F77_FUNC -AC_DEFUN([ACX_BLAS_WITH_F77_FUNC], [ +AC_DEFUN([AX_BLAS_WITH_F77_FUNC], [ AC_PREREQ(2.50) -ACX_BLAS([# disable special action], []) -if test x$acx_blas_ok = xyes ; then - ACX_BLAS_F77_FUNC( +AX_BLAS([# disable special action], []) +if test x$ax_blas_ok = xyes ; then + AX_BLAS_F77_FUNC( [ifelse([$1],,AC_DEFINE(HAVE_BLAS,1,[Define if you have a BLAS library.]),[$1])], - [acx_blas_ok=no; BLAS_LIBS=]) + [ax_blas_ok=no; BLAS_LIBS=]) fi -if test x$acx_blas_ok = xno ; then +if test x$ax_blas_ok = xno ; then $2 fi -])dnl ACX_BLAS_WITH_F77_FUNC +])dnl AX_BLAS_WITH_F77_FUNC
rename from m4/acx_lapack.m4 rename to m4/ax_lapack.m4 --- a/m4/acx_lapack.m4 +++ b/m4/ax_lapack.m4 @@ -1,10 +1,10 @@ # =========================================================================== -# http://autoconf-archive.cryp.to/acx_lapack.html +# http://www.gnu.org/software/autoconf-archive/ax_lapack.html # =========================================================================== # # SYNOPSIS # -# ACX_LAPACK([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) +# AX_LAPACK([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) # # DESCRIPTION # @@ -14,11 +14,11 @@ # # To link with LAPACK, you should link with: # -# $LAPACK_LIBS $BLAS_LIBS $LIBS $FLIBS +# $LAPACK_LIBS $BLAS_LIBS $LIBS $FLIBS # -# in that order. BLAS_LIBS is the output variable of the ACX_BLAS macro, +# in that order. BLAS_LIBS is the output variable of the AX_BLAS macro, # called automatically. FLIBS is the output variable of the -# AC_F77_LIBRARY_LDFLAGS macro (called if necessary by ACX_BLAS), and is +# AC_F77_LIBRARY_LDFLAGS macro (called if necessary by AX_BLAS), and is # sometimes necessary in order to link with F77 libraries. Users will also # need to use AC_F77_DUMMY_MAIN (see the autoconf manual), for the same # reason. @@ -34,13 +34,9 @@ # is not found. If ACTION-IF-FOUND is not specified, the default action # will define HAVE_LAPACK. # -# LAST MODIFICATION -# -# 2008-06-29 +# LICENSE # -# COPYLEFT -# -# Copyright (c) 2008 Steven G. Johnson <stevenj@alum.mit.edu> +# Copyright (c) 2009 Steven G. Johnson <stevenj@alum.mit.edu> # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the @@ -64,19 +60,22 @@ # all other use of the material that constitutes the Autoconf Macro. # # This special exception to the GPL applies to versions of the Autoconf -# Macro released by the Autoconf Macro Archive. When you make and -# distribute a modified version of the Autoconf Macro, you may extend this -# special exception to the GPL to apply to your modified version as well. +# Macro released by the Autoconf Archive. When you make and distribute a +# modified version of the Autoconf Macro, you may extend this special +# exception to the GPL to apply to your modified version as well. -AC_DEFUN([ACX_LAPACK], [ -AC_REQUIRE([ACX_BLAS]) -acx_lapack_ok=no +#serial 7 + +AU_ALIAS([ACX_LAPACK], [AX_LAPACK]) +AC_DEFUN([AX_LAPACK], [ +AC_REQUIRE([AX_BLAS]) +ax_lapack_ok=no AC_ARG_WITH(lapack, - [AC_HELP_STRING([--with-lapack=<lib>], [use LAPACK library <lib>])]) + [AS_HELP_STRING([--with-lapack=<lib>], [use LAPACK library <lib>])]) case $with_lapack in yes | "") ;; - no) acx_lapack_ok=disable ;; + no) ax_lapack_ok=disable ;; -* | */* | *.a | *.so | *.so.* | *.o) LAPACK_LIBS="$with_lapack" ;; *) LAPACK_LIBS="-l$with_lapack" ;; esac @@ -85,8 +84,8 @@ AC_F77_FUNC(cheev) # We cannot use LAPACK if BLAS is not found -if test "x$acx_blas_ok" != xyes; then - acx_lapack_ok=noblas +if test "x$ax_blas_ok" != xyes; then + ax_lapack_ok=noblas LAPACK_LIBS="" fi @@ -94,27 +93,27 @@ if test "x$LAPACK_LIBS" != x; then save_LIBS="$LIBS"; LIBS="$LAPACK_LIBS $BLAS_LIBS $LIBS $FLIBS" AC_MSG_CHECKING([for $cheev in $LAPACK_LIBS]) - AC_TRY_LINK_FUNC($cheev, [acx_lapack_ok=yes], [LAPACK_LIBS=""]) - AC_MSG_RESULT($acx_lapack_ok) + AC_TRY_LINK_FUNC($cheev, [ax_lapack_ok=yes], [LAPACK_LIBS=""]) + AC_MSG_RESULT($ax_lapack_ok) LIBS="$save_LIBS" - if test $acx_lapack_ok = no; then + if test $ax_lapack_ok = no; then LAPACK_LIBS="" fi fi # LAPACK linked to by default? (is sometimes included in BLAS lib) -if test $acx_lapack_ok = no; then +if test $ax_lapack_ok = no; then save_LIBS="$LIBS"; LIBS="$LIBS $BLAS_LIBS $FLIBS" - AC_CHECK_FUNC($cheev, [acx_lapack_ok=yes]) + AC_CHECK_FUNC($cheev, [ax_lapack_ok=yes]) LIBS="$save_LIBS" fi # Generic LAPACK library? for lapack in lapack lapack_rs6k; do - if test $acx_lapack_ok = no; then + if test $ax_lapack_ok = no; then save_LIBS="$LIBS"; LIBS="$BLAS_LIBS $LIBS" AC_CHECK_LIB($lapack, $cheev, - [acx_lapack_ok=yes; LAPACK_LIBS="-l$lapack"], [], [$FLIBS]) + [ax_lapack_ok=yes; LAPACK_LIBS="-l$lapack"], [], [$FLIBS]) LIBS="$save_LIBS" fi done @@ -122,11 +121,11 @@ AC_SUBST(LAPACK_LIBS) # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: -if test x"$acx_lapack_ok" = xyes; then +if test x"$ax_lapack_ok" = xyes; then ifelse([$1],,AC_DEFINE(HAVE_LAPACK,1,[Define if you have LAPACK library.]),[$1]) : else - acx_lapack_ok=no + ax_lapack_ok=no $2 fi -])dnl ACX_LAPACK +])dnl AX_LAPACK
rename from m4/acx_pthread.m4 rename to m4/ax_pthread.m4 --- a/m4/acx_pthread.m4 +++ b/m4/ax_pthread.m4 @@ -1,10 +1,10 @@ # =========================================================================== -# http://www.nongnu.org/autoconf-archive/acx_pthread.html +# http://www.gnu.org/software/autoconf-archive/ax_pthread.html # =========================================================================== # # SYNOPSIS # -# ACX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) +# AX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) # # DESCRIPTION # @@ -25,9 +25,9 @@ # If you are only building threads programs, you may wish to use these # variables in your default LIBS, CFLAGS, and CC: # -# LIBS="$PTHREAD_LIBS $LIBS" -# CFLAGS="$CFLAGS $PTHREAD_CFLAGS" -# CC="$PTHREAD_CC" +# LIBS="$PTHREAD_LIBS $LIBS" +# CFLAGS="$CFLAGS $PTHREAD_CFLAGS" +# CC="$PTHREAD_CC" # # In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute constant # has a nonstandard name, defines PTHREAD_CREATE_JOINABLE to that name @@ -75,11 +75,14 @@ # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. -AC_DEFUN([ACX_PTHREAD], [ +#serial 9 + +AU_ALIAS([ACX_PTHREAD], [AX_PTHREAD]) +AC_DEFUN([AX_PTHREAD], [ AC_REQUIRE([AC_CANONICAL_HOST]) AC_LANG_SAVE AC_LANG_C -acx_pthread_ok=no +ax_pthread_ok=no # We used to check for pthread.h first, but this fails if pthread.h # requires special compiler flags (e.g. on True64 or Sequent). @@ -94,9 +97,9 @@ save_LIBS="$LIBS" LIBS="$PTHREAD_LIBS $LIBS" AC_MSG_CHECKING([for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS]) - AC_TRY_LINK_FUNC(pthread_join, acx_pthread_ok=yes) - AC_MSG_RESULT($acx_pthread_ok) - if test x"$acx_pthread_ok" = xno; then + AC_TRY_LINK_FUNC(pthread_join, ax_pthread_ok=yes) + AC_MSG_RESULT($ax_pthread_ok) + if test x"$ax_pthread_ok" = xno; then PTHREAD_LIBS="" PTHREAD_CFLAGS="" fi @@ -114,7 +117,7 @@ # which indicates that we try without any flags at all, and "pthread-config" # which is a program returning the flags for the Pth emulation library. -acx_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config" +ax_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config" # The ordering *is* (sometimes) important. Some notes on the # individual items follow: @@ -147,12 +150,16 @@ # who knows whether they'll stub that too in a future libc.) So, # we'll just look for -pthreads and -lpthread first: - acx_pthread_flags="-pthreads pthread -mt -pthread $acx_pthread_flags" + ax_pthread_flags="-pthreads pthread -mt -pthread $ax_pthread_flags" ;; + + *-darwin*) + ax_pthread_flags="-pthread $ax_pthread_flags" + ;; esac -if test x"$acx_pthread_ok" = xno; then -for flag in $acx_pthread_flags; do +if test x"$ax_pthread_ok" = xno; then +for flag in $ax_pthread_flags; do case $flag in none) @@ -165,8 +172,8 @@ ;; pthread-config) - AC_CHECK_PROG(acx_pthread_config, pthread-config, yes, no) - if test x"$acx_pthread_config" = xno; then continue; fi + AC_CHECK_PROG(ax_pthread_config, pthread-config, yes, no) + if test x"$ax_pthread_config" = xno; then continue; fi PTHREAD_CFLAGS="`pthread-config --cflags`" PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`" ;; @@ -191,17 +198,22 @@ # pthread_cleanup_push because it is one of the few pthread # functions on Solaris that doesn't have a non-functional libc stub. # We try pthread_create on general principles. - AC_TRY_LINK([#include <pthread.h>], - [pthread_t th; pthread_join(th, 0); - pthread_attr_init(0); pthread_cleanup_push(0, 0); - pthread_create(0,0,0,0); pthread_cleanup_pop(0); ], - [acx_pthread_ok=yes]) + AC_TRY_LINK([#include <pthread.h> + static void routine(void* a) {a=0;} + static void* start_routine(void* a) {return a;}], + [pthread_t th; pthread_attr_t attr; + pthread_create(&th,0,start_routine,0); + pthread_join(th, 0); + pthread_attr_init(&attr); + pthread_cleanup_push(routine, 0); + pthread_cleanup_pop(0); ], + [ax_pthread_ok=yes]) LIBS="$save_LIBS" CFLAGS="$save_CFLAGS" - AC_MSG_RESULT($acx_pthread_ok) - if test "x$acx_pthread_ok" = xyes; then + AC_MSG_RESULT($ax_pthread_ok) + if test "x$ax_pthread_ok" = xyes; then break; fi @@ -211,7 +223,7 @@ fi # Various other checks: -if test "x$acx_pthread_ok" = xyes; then +if test "x$ax_pthread_ok" = xyes; then save_LIBS="$LIBS" LIBS="$PTHREAD_LIBS $LIBS" save_CFLAGS="$CFLAGS" @@ -260,12 +272,12 @@ AC_SUBST(PTHREAD_CC) # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: -if test x"$acx_pthread_ok" = xyes; then +if test x"$ax_pthread_ok" = xyes; then ifelse([$1],,AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.]),[$1]) : else - acx_pthread_ok=no + ax_pthread_ok=no $2 fi AC_LANG_RESTORE -])dnl ACX_PTHREAD +])dnl AX_PTHREAD
--- a/m4/module.mk +++ b/m4/module.mk @@ -1,9 +1,9 @@ EXTRA_DIST += \ m4/module.mk \ - m4/acx_blas.m4 \ - m4/acx_blas_f77_func.m4 \ - m4/acx_lapack.m4 \ - m4/acx_pthread.m4 \ + m4/ax_blas.m4 \ + m4/ax_blas_f77_func.m4 \ + m4/ax_lapack.m4 \ + m4/ax_pthread.m4 \ m4/gnulib-cache.m4 \ m4/libtool.m4 \ m4/ltoptions.m4 \