diff --git a/libadaptivity/aclocal.m4 b/libadaptivity/aclocal.m4 index 095dd05c0d..39f351d558 100644 --- a/libadaptivity/aclocal.m4 +++ b/libadaptivity/aclocal.m4 @@ -1,404 +1,386 @@ -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 $FCLIBS -dnl -dnl in that order. FCLIBS is the output variable of the -dnl AC_FC_LIBRARY_LDFLAGS macro (called if necessary by ACX_BLAS), -dnl and is sometimes necessary in order to link with FC libraries. -dnl Users will also need to use AC_FC_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= in order to use some -dnl specific BLAS library . 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 FC 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: aclocal.m4 7146 2008-07-22 22:40:14Z pfarrell $ -dnl @author Steven G. Johnson -dnl -dnl Modified by Jonas Juselius -dnl -AC_DEFUN([ACX_BLAS], [ -AC_PREREQ(2.59) - -acx_blas_ok=no -acx_blas_save_LIBS="$LIBS" -acx_blas_save_LDFLAGS="$LDFLAGS" -acx_blas_save_FFLAGS="$FFLAGS" -acx_blas_libs="" -acx_blas_dir="" +# =========================================================================== +# https://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= in order to use some specific BLAS +# library . 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 +# Copyright (c) 2019 Geoffrey M. Oxberry +# +# 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 . +# +# 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 21 + +AU_ALIAS([ACX_BLAS], [AX_BLAS]) +AC_DEFUN([AX_BLAS], [ +AC_PREREQ([2.55]) +AC_REQUIRE([AC_F77_LIBRARY_LDFLAGS]) +AC_REQUIRE([AC_CANONICAL_HOST]) +ax_blas_ok=no AC_ARG_WITH(blas, - [AC_HELP_STRING([--with-blas=], [use BLAS library ])]) - + [AS_HELP_STRING([--with-blas=], [use BLAS library ])]) case $with_blas in yes | "") ;; - no) acx_blas_ok=disable ;; - -l* | */* | *.a | *.so | *.so.* | *.o) acx_blas_libs="$with_blas" ;; - *) acx_blas_libs="-l$with_blas" ;; -esac - -AC_ARG_WITH(blas_dir, - [AC_HELP_STRING([--with-blas-dir=], [look for BLAS library in ])]) - -case $with_blas_dir in - yes | no | "") ;; - -L*) LDFLAGS="$LDFLAGS $with_blas_dir" - acx_blas_dir="$with_blas_dir" ;; - *) LDFLAGS="$LDFLAGS -L$with_blas_dir" - acx_blas_dir="-L$with_blas_dir" ;; + no) ax_blas_ok=disable ;; + -* | */* | *.a | *.so | *.so.* | *.dylib | *.dylib.* | *.o) + BLAS_LIBS="$with_blas" + ;; + *) BLAS_LIBS="-l$with_blas" ;; esac -# Are we linking from C? -case "$ac_ext" in - f*|F*) sgemm="sgemm" ;; - *) - AC_FC_FUNC([sgemm]) - LIBS="$LIBS $FCLIBS" - ;; -esac +# Get fortran linker names of BLAS functions to check for. +AC_F77_FUNC(sgemm) +AC_F77_FUNC(dgemm) -# If --with-blas is defined, then look for THIS AND ONLY THIS blas lib -if test $acx_blas_ok = no; then -case $with_blas in - ""|yes) ;; - *) save_LIBS="$LIBS"; LIBS="$acx_blas_libs $LIBS" - AC_MSG_CHECKING([for $sgemm in $acx_blas_libs]) - AC_TRY_LINK_FUNC($sgemm, [acx_blas_ok=yes]) - AC_MSG_RESULT($acx_blas_ok) - LIBS="$save_LIBS" - acx_blas_ok=specific - ;; -esac -fi +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_TRY_LINK_FUNC($sgemm, [acx_blas_ok=yes; acx_blas_libs=$BLAS_LIBS]) - AC_MSG_RESULT($acx_blas_ok) + AC_LINK_IFELSE([AC_LANG_CALL([], [$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 - AC_MSG_CHECKING([for builtin $sgemm]) - AC_TRY_LINK_FUNC($sgemm, [acx_blas_ok=yes]) - AC_MSG_RESULT($acx_blas_ok) +if test $ax_blas_ok = no; then + save_LIBS="$LIBS"; LIBS="$LIBS" + AC_MSG_CHECKING([if $sgemm is being linked in already]) + AC_LINK_IFELSE([AC_LANG_CALL([], [$sgemm])], [ax_blas_ok=yes]) + AC_MSG_RESULT($ax_blas_ok) + LIBS="$save_LIBS" fi -# Intel mkl BLAS. Unfortunately some of Intel's blas routines are -# in their lapack library... -if test $acx_blas_ok = no; then - AC_CHECK_LIB(mkl_def, $sgemm, - [acx_blas_ok=yes; acx_blas_libs="-lmkl_def -lm"], - [],[-lm]) -fi -if test $acx_blas_ok = no; then - AC_CHECK_LIB(mkl_ipf, $sgemm, - [acx_blas_ok=yes; acx_blas_libs="-lmkl_ipf -lguide -lm"], - [],[-lguide -lm]) -fi -if test $acx_blas_ok = no; then - AC_CHECK_LIB(mkl_em64t, $sgemm, - [acx_blas_ok=yes; acx_blas_libs="-lmkl_em64t -lguide -liomp5"], - [],[-lguide -liomp5]) -fi -# check for older mkl -if test $acx_blas_ok = no; then - AC_MSG_NOTICE([trying Intel MKL < 7:]) - unset ac_cv_lib_mkl_def_sgemm - AC_CHECK_LIB(mkl_lapack, lsame, [ - acx_lapack_ok=yes; - AC_CHECK_LIB(mkl_def, $sgemm, - [acx_blas_ok=yes; - acx_blas_libs="-lmkl_def -lmkl_lapack -lm -lpthread"], - [],[-lm -lpthread - ]) - ]) - AC_MSG_NOTICE([Intel MKL < 7... $acx_blas_ok]) -fi +# BLAS linked to by flexiblas? (Default on FC33+ and RHEL9+) -# BLAS in ACML (pgi) -if test $acx_blas_ok = no; then - AC_CHECK_LIB(acml, $sgemm, [acx_blas_ok=yes; acx_blas_libs="-lacml"]) +if test $ax_blas_ok = no; then + AC_CHECK_LIB(flexiblas, $sgemm, [ax_blas_ok=yes + BLAS_LIBS="-lflexiblas"]) fi -# BLAS in ATLAS library? (http://math-atlas.sourceforge.net/) -if test $acx_blas_ok = no; then - AC_CHECK_LIB(f77blas, $sgemm, - [acx_blas_ok=yes; acx_blas_libs="-lf77blas -latlas"], - [], [-latlas]) +# BLAS in OpenBLAS library? (http://xianyi.github.com/OpenBLAS/) +if test $ax_blas_ok = no; then + AC_CHECK_LIB(openblas, $sgemm, [ax_blas_ok=yes + BLAS_LIBS="-lopenblas"]) fi -# ia64-hp-hpux11.22 BLAS library? -if test $acx_blas_ok = no; then - AC_CHECK_LIB(veclib, $sgemm, - [acx_blas_ok=yes; acx_blas_libs="-lveclib8"]) +# BLAS in ATLAS library? (http://math-atlas.sourceforge.net/) +if test $ax_blas_ok = no; then + AC_CHECK_LIB(atlas, ATL_xerbla, + [AC_CHECK_LIB(f77blas, $sgemm, + [AC_CHECK_LIB(cblas, cblas_dgemm, + [ax_blas_ok=yes + BLAS_LIBS="-lcblas -lf77blas -latlas"], + [], [-lf77blas -latlas])], + [], [-latlas])]) fi # BLAS in PhiPACK libraries? (requires generic BLAS lib, too) -if test $acx_blas_ok = no; then - AC_MSG_NOTICE([trying PhiPACK:]) +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; acx_blas_libs="-lsgemm -ldgemm -lblas"], + [AC_CHECK_LIB(dgemm, $dgemm, + [AC_CHECK_LIB(sgemm, $sgemm, + [ax_blas_ok=yes; BLAS_LIBS="-lsgemm -ldgemm -lblas"], [], [-lblas])], - [], [-lblas]) - ]) - AC_MSG_NOTICE([PhiPACK... $acx_blas_ok]) + [], [-lblas])]) +fi + +# BLAS in Intel MKL library? +if test $ax_blas_ok = no; then + # MKL for gfortran + if test x"$ac_cv_fc_compiler_gnu" = xyes; then + # 64 bit + if test $host_cpu = x86_64; then + AC_CHECK_LIB(mkl_gf_lp64, $sgemm, + [ax_blas_ok=yes;BLAS_LIBS="-lmkl_gf_lp64 -lmkl_sequential -lmkl_core -lpthread"],, + [-lmkl_gf_lp64 -lmkl_sequential -lmkl_core -lpthread]) + # 32 bit + elif test $host_cpu = i686; then + AC_CHECK_LIB(mkl_gf, $sgemm, + [ax_blas_ok=yes;BLAS_LIBS="-lmkl_gf -lmkl_sequential -lmkl_core -lpthread"],, + [-lmkl_gf -lmkl_sequential -lmkl_core -lpthread]) + fi + # MKL for other compilers (Intel, PGI, ...?) + else + # 64-bit + if test $host_cpu = x86_64; then + AC_CHECK_LIB(mkl_intel_lp64, $sgemm, + [ax_blas_ok=yes;BLAS_LIBS="-lmkl_intel_lp64 -lmkl_sequential -lmkl_core -lpthread"],, + [-lmkl_intel_lp64 -lmkl_sequential -lmkl_core -lpthread]) + # 32-bit + elif test $host_cpu = i686; then + AC_CHECK_LIB(mkl_intel, $sgemm, + [ax_blas_ok=yes;BLAS_LIBS="-lmkl_intel -lmkl_sequential -lmkl_core -lpthread"],, + [-lmkl_intel -lmkl_sequential -lmkl_core -lpthread]) + fi + fi +fi +# Old versions of MKL +if test $ax_blas_ok = no; then + AC_CHECK_LIB(mkl, $sgemm, [ax_blas_ok=yes;BLAS_LIBS="-lmkl -lguide -lpthread"],,[-lguide -lpthread]) +fi + +# BLAS in Apple vecLib library? +if test $ax_blas_ok = no; then + save_LIBS="$LIBS"; LIBS="-framework Accelerate $LIBS" + AC_MSG_CHECKING([for $sgemm in -framework Accelerate]) + AC_LINK_IFELSE([AC_LANG_CALL([], [$sgemm])], [ax_blas_ok=yes;BLAS_LIBS="-framework Accelerate"]) + AC_MSG_RESULT($ax_blas_ok) + 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;acx_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;acx_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, - [acx_blas_libs="-xlic_lib=sunperf -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; acx_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; acx_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 - unset ac_cv_lib_blas_sgemm - AC_MSG_NOTICE([trying IBM ESSL:]) +if test $ax_blas_ok = no; then AC_CHECK_LIB(blas, $sgemm, [AC_CHECK_LIB(essl, $sgemm, - [acx_blas_ok=yes; acx_blas_libs="-lessl -lblas"], - [], [-lblas]) - ]) - AC_MSG_NOTICE([IBM ESSL... $acx_blas_ok]) + [ax_blas_ok=yes; BLAS_LIBS="-lessl -lblas"], + [], [-lblas $FLIBS])]) fi # Generic BLAS library? -if test $acx_blas_ok = no; then - unset ac_cv_lib_blas_sgemm - AC_CHECK_LIB(blas, $sgemm, [acx_blas_ok=yes; acx_blas_libs="-lblas"]) +if test $ax_blas_ok = no; then + AC_CHECK_LIB(blas, $sgemm, [ax_blas_ok=yes; BLAS_LIBS="-lblas"]) fi -# blas on SGI/CRAY -if test $acx_blas_ok = no; then - unset ac_cv_lib_blas_sgemm - AC_CHECK_LIB(blas, $sgemm, - [acx_blas_ok=yes; acx_blas_libs="-lblas -lcraylibs"],[],[-lcraylibs]) -fi - -# Check for vecLib framework (Darwin) -if test $acx_blas_ok = no; then - save_LIBS="$LIBS"; LIBS="-framework vecLib $LIBS" - AC_MSG_CHECKING([for $sgemm in vecLib]) - AC_TRY_LINK_FUNC($sgemm, [acx_blas_ok=yes; acx_blas_libs="-framework vecLib"]) - AC_MSG_RESULT($acx_blas_ok) - LIBS="$save_LIBS" -fi - -BLAS_LIBS="$acx_blas_libs" AC_SUBST(BLAS_LIBS) -LIBS="$acx_blas_save_LIBS" -LDFLAGS="$acx_blas_save_LDFLAGS $acx_blas_dir" +LIBS="$ax_blas_save_LIBS" -test x"$acx_blas_ok" = xspecific && acx_blas_ok=yes # 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 @synopsis ACX_LAPACK([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) -dnl -dnl This macro looks for a library that implements the LAPACK -dnl linear-algebra interface (see http://www.netlib.org/lapack/). -dnl On success, it sets the LAPACK_LIBS output variable to -dnl hold the requisite library linkages. -dnl -dnl To link with LAPACK, you should link with: -dnl -dnl $LAPACK_LIBS $BLAS_LIBS $LIBS -dnl -dnl in that order. BLAS_LIBS is the output variable of the ACX_BLAS -dnl macro, called automatically. 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 The user may also use --with-lapack= in order to use some -dnl specific LAPACK library . 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 LAPACK and BLAS libraries. -dnl -dnl ACTION-IF-FOUND is a list of shell commands to run if a LAPACK -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_LAPACK. -dnl -dnl @version $Id: aclocal.m4 7146 2008-07-22 22:40:14Z pfarrell $ -dnl @author Steven G. Johnson -dnl -AC_DEFUN([ACX_LAPACK], [ -AC_REQUIRE([ACX_BLAS]) -acx_lapack_ok=no -acx_lapack_save_LIBS="$LIBS" -acx_lapack_save_LDFLAGS="$LDFLAGS" -acx_lapack_save_FFLAGS="$FFLAGS" -acx_lapack_libs="" -acx_lapack_dir="" +])dnl AX_BLAS +# =========================================================================== +# https://www.gnu.org/software/autoconf-archive/ax_lapack.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_LAPACK([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) +# +# DESCRIPTION +# +# This macro looks for a library that implements the LAPACK linear-algebra +# interface (see http://www.netlib.org/lapack/). On success, it sets the +# LAPACK_LIBS output variable to hold the requisite library linkages. +# +# To link with LAPACK, you should link with: +# +# $LAPACK_LIBS $BLAS_LIBS $LIBS $FLIBS +# +# 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 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. +# +# The user may also use --with-lapack= in order to use some specific +# LAPACK library . 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 LAPACK and BLAS +# libraries. +# +# ACTION-IF-FOUND is a list of shell commands to run if a LAPACK 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_LAPACK. +# +# LICENSE +# +# Copyright (c) 2009 Steven G. Johnson +# Copyright (c) 2019 Geoffrey M. Oxberry +# +# 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 . +# +# 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 10 + +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=], [use LAPACK library ])]) - + [AS_HELP_STRING([--with-lapack=], [use LAPACK library ])]) case $with_lapack in - yes | "") ;; - no) acx_lapack_ok=disable ;; - -l* | */* | *.a | *.so | *.so.* | *.o) acx_lapack_libs="$with_lapack" ;; - *) acx_lapack_libs="-l$with_lapack" ;; + yes | "") ;; + no) ax_lapack_ok=disable ;; + -* | */* | *.a | *.so | *.so.* | *.dylib | *.dylib.* | *.o) + LAPACK_LIBS="$with_lapack" + ;; + *) LAPACK_LIBS="-l$with_lapack" ;; esac -AC_ARG_WITH(lapack_dir, - [AC_HELP_STRING([--with-lapack-dir=], [look for LAPACK library in ])]) - -case $with_lapack_dir in - yes | no | "") ;; - -L*) LDFLAGS="$LDFLAGS $with_lapack_dir" - acx_lapack_dir="$with_lapack_dir" ;; - *) LDFLAGS="$LDFLAGS -L$with_lapack_dir" - acx_lapack_dir="-L$with_lapack_dir" ;; -esac +# Get fortran linker name of LAPACK function to check for. +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 -fi - -# add BLAS to libs -LIBS="$BLAS_LIBS $LIBS" - -# Are we linking from C? -case "$ac_ext" in - f*|F*) dsyev="dsyev" ;; - *) - AC_FC_FUNC([dsyev]) - LIBS="$LIBS $FCLIBS" - ;; -esac - -# If --with-lapack is defined, then look for THIS AND ONLY THIS lapack lib -if test $acx_lapack_ok = no; then -case $with_lapack in - ""|yes) ;; - *) save_LIBS="$LIBS"; LIBS="$acx_lapack_libs $LIBS" - AC_MSG_CHECKING([for $dsyev in $acx_lapack_libs]) - AC_TRY_LINK_FUNC($dsyev, [acx_lapack_ok=yes]) - AC_MSG_RESULT($acx_lapack_ok) - LIBS="$save_LIBS" - acx_lapack_ok=yes - ;; -esac +if test "x$ax_blas_ok" != xyes; then + ax_lapack_ok=noblas + LAPACK_LIBS="" fi # First, check LAPACK_LIBS environment variable -if test $acx_lapack_ok = no; then if test "x$LAPACK_LIBS" != x; then - save_LIBS="$LIBS"; LIBS="$LAPACK_LIBS $LIBS" - AC_MSG_CHECKING([for $dsyev in $LAPACK_LIBS]) - AC_TRY_LINK_FUNC($dsyev, [acx_lapack_ok=yes; - acx_lapack_libs=$LAPACK_LIBS]) - AC_MSG_RESULT($acx_lapack_ok) - LIBS="$save_LIBS" -fi -fi - -# Intel MKL LAPACK? -if test $acx_lapack_ok = no; then - AC_CHECK_LIB(mkl_lapack, $dsyev, - [acx_lapack_ok=yes; acx_lapack_libs="-lmkl_lapack -lguide"], - [],[]) -fi - -# Sun sunperf? -if test $acx_lapack_ok = no; then - AC_CHECK_LIB(sunperf, $dsyev, - [acx_lapack_ok=yes; acx_lapack_libs="-lsunperf"], - [],[]) + save_LIBS="$LIBS"; LIBS="$LAPACK_LIBS $BLAS_LIBS $LIBS $FLIBS" + AC_MSG_CHECKING([for $cheev in $LAPACK_LIBS]) + AC_LINK_IFELSE([AC_LANG_CALL([], [$cheev])], [ax_lapack_ok=yes], [LAPACK_LIBS=""]) + AC_MSG_RESULT($ax_lapack_ok) + LIBS="$save_LIBS" + 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 - AC_MSG_CHECKING([for $dsyev in BLAS library]) - AC_TRY_LINK_FUNC($dsyev, [acx_lapack_ok=yes; acx_lapack_libs=""]) - AC_MSG_RESULT($acx_lapack_ok) +if test $ax_lapack_ok = no; then + save_LIBS="$LIBS"; LIBS="$LIBS $BLAS_LIBS $FLIBS" + AC_CHECK_FUNC($cheev, [ax_lapack_ok=yes]) + LIBS="$save_LIBS" fi # Generic LAPACK library? -if test $acx_lapack_ok = no; then - AC_CHECK_LIB(lapack, $dsyev, - [acx_lapack_ok=yes; acx_lapack_libs="-llapack"], [], []) -fi - -LAPACK_LIBS="$LAPACK_LIBS $acx_lapack_libs" -LIBS="$acx_lapack_save_LIBS" -LDFLAGS="$acx_lapack_save_LDFLAGS $acx_lapack_dir" +for lapack in lapack lapack_rs6k; do + if test $ax_lapack_ok = no; then + save_LIBS="$LIBS"; LIBS="$BLAS_LIBS $LIBS" + AC_CHECK_LIB($lapack, $cheev, + [ax_lapack_ok=yes; LAPACK_LIBS="-l$lapack"], [], [$FLIBS]) + LIBS="$save_LIBS" + fi +done 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 + dnl ---------------------------------------------------------------------------- dnl check for the required PETSc library dnl ---------------------------------------------------------------------------- diff --git a/libadaptivity/acx_blas.m4 b/libadaptivity/acx_blas.m4 deleted file mode 100644 index 847e0aea05..0000000000 --- a/libadaptivity/acx_blas.m4 +++ /dev/null @@ -1,248 +0,0 @@ -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 $FCLIBS -dnl -dnl in that order. FCLIBS is the output variable of the -dnl AC_FC_LIBRARY_LDFLAGS macro (called if necessary by ACX_BLAS), -dnl and is sometimes necessary in order to link with FC libraries. -dnl Users will also need to use AC_FC_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= in order to use some -dnl specific BLAS library . 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 FC 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 2170 2006-12-21 01:10:37Z adrian $ -dnl @author Steven G. Johnson -dnl -dnl Modified by Jonas Juselius -dnl -AC_DEFUN([ACX_BLAS], [ -AC_PREREQ(2.59) - -acx_blas_ok=no -acx_blas_save_LIBS="$LIBS" -acx_blas_save_LDFLAGS="$LDFLAGS" -acx_blas_save_FFLAGS="$FFLAGS" -acx_blas_libs="" -acx_blas_dir="" - -AC_ARG_WITH(blas, - [AC_HELP_STRING([--with-blas=], [use BLAS library ])]) - -case $with_blas in - yes | "") ;; - no) acx_blas_ok=disable ;; - -l* | */* | *.a | *.so | *.so.* | *.o) acx_blas_libs="$with_blas" ;; - *) acx_blas_libs="-l$with_blas" ;; -esac - -AC_ARG_WITH(blas_dir, - [AC_HELP_STRING([--with-blas-dir=], [look for BLAS library in ])]) - -case $with_blas_dir in - yes | no | "") ;; - -L*) LDFLAGS="$LDFLAGS $with_blas_dir" - acx_blas_dir="$with_blas_dir" ;; - *) LDFLAGS="$LDFLAGS -L$with_blas_dir" - acx_blas_dir="-L$with_blas_dir" ;; -esac - -# Are we linking from C? -case "$ac_ext" in - f*|F*) sgemm="sgemm" ;; - *) - AC_FC_FUNC([sgemm]) - LIBS="$LIBS $FCLIBS" - ;; -esac - -# If --with-blas is defined, then look for THIS AND ONLY THIS blas lib -if test $acx_blas_ok = no; then -case $with_blas in - ""|yes) ;; - *) save_LIBS="$LIBS"; LIBS="$acx_blas_libs $LIBS" - AC_MSG_CHECKING([for $sgemm in $acx_blas_libs]) - AC_TRY_LINK_FUNC($sgemm, [acx_blas_ok=yes]) - AC_MSG_RESULT($acx_blas_ok) - LIBS="$save_LIBS" - acx_blas_ok=specific - ;; -esac -fi - -# First, check BLAS_LIBS environment variable -if test $acx_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_TRY_LINK_FUNC($sgemm, [acx_blas_ok=yes; acx_blas_libs=$BLAS_LIBS]) - AC_MSG_RESULT($acx_blas_ok) - LIBS="$save_LIBS" -fi -fi - -# BLAS linked to by default? (happens on some supercomputers) -if test $acx_blas_ok = no; then - AC_MSG_CHECKING([for builtin $sgemm]) - AC_TRY_LINK_FUNC($sgemm, [acx_blas_ok=yes]) - AC_MSG_RESULT($acx_blas_ok) -fi - -# Intel mkl BLAS. Unfortunately some of Intel's blas routines are -# in their lapack library... -if test $acx_blas_ok = no; then - AC_CHECK_LIB(mkl_def, $sgemm, - [acx_blas_ok=yes; acx_blas_libs="-lmkl_def -lm"], - [],[-lm]) -fi -if test $acx_blas_ok = no; then - AC_CHECK_LIB(mkl_ipf, $sgemm, - [acx_blas_ok=yes; acx_blas_libs="-lmkl_ipf -lguide -lm"], - [],[-lguide -lm]) -fi -# check for older mkl -if test $acx_blas_ok = no; then - AC_MSG_NOTICE([trying Intel MKL < 7:]) - unset ac_cv_lib_mkl_def_sgemm - AC_CHECK_LIB(mkl_lapack, lsame, [ - acx_lapack_ok=yes; - AC_CHECK_LIB(mkl_def, $sgemm, - [acx_blas_ok=yes; - acx_blas_libs="-lmkl_def -lmkl_lapack -lm -lpthread"], - [],[-lm -lpthread - ]) - ]) - AC_MSG_NOTICE([Intel MKL < 7... $acx_blas_ok]) -fi - -# BLAS in ACML (pgi) -if test $acx_blas_ok = no; then - AC_CHECK_LIB(acml, $sgemm, [acx_blas_ok=yes; acx_blas_libs="-lacml"]) -fi - -# BLAS in ATLAS library? (http://math-atlas.sourceforge.net/) -if test $acx_blas_ok = no; then - AC_CHECK_LIB(f77blas, $sgemm, - [acx_blas_ok=yes; acx_blas_libs="-lf77blas -latlas"], - [], [-latlas]) -fi - -# ia64-hp-hpux11.22 BLAS library? -if test $acx_blas_ok = no; then - AC_CHECK_LIB(veclib, $sgemm, - [acx_blas_ok=yes; acx_blas_libs="-lveclib8"]) -fi - -# BLAS in PhiPACK libraries? (requires generic BLAS lib, too) -if test $acx_blas_ok = no; then - AC_MSG_NOTICE([trying PhiPACK:]) - AC_CHECK_LIB(blas, $sgemm, - [AC_CHECK_LIB(dgemm, dgemm, - [AC_CHECK_LIB(sgemm, $sgemm, - [acx_blas_ok=yes; acx_blas_libs="-lsgemm -ldgemm -lblas"], - [], [-lblas])], - [], [-lblas]) - ]) - AC_MSG_NOTICE([PhiPACK... $acx_blas_ok]) -fi - -# BLAS in Alpha CXML library? -if test $acx_blas_ok = no; then - AC_CHECK_LIB(cxml, $sgemm, [acx_blas_ok=yes;acx_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;acx_blas_libs="-ldxml"]) -fi - -# BLAS in Sun Performance library? -if test $acx_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, - [acx_blas_libs="-xlic_lib=sunperf -lsunmath" - acx_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; acx_blas_libs="-lscs"]) -fi - -# BLAS in SGIMATH library? -if test $acx_blas_ok = no; then - AC_CHECK_LIB(complib.sgimath, $sgemm, - [acx_blas_ok=yes; acx_blas_libs="-lcomplib.sgimath"]) -fi - -# BLAS in IBM ESSL library? (requires generic BLAS lib, too) -if test $acx_blas_ok = no; then - unset ac_cv_lib_blas_sgemm - AC_MSG_NOTICE([trying IBM ESSL:]) - AC_CHECK_LIB(blas, $sgemm, - [AC_CHECK_LIB(essl, $sgemm, - [acx_blas_ok=yes; acx_blas_libs="-lessl -lblas"], - [], [-lblas]) - ]) - AC_MSG_NOTICE([IBM ESSL... $acx_blas_ok]) -fi - -# Generic BLAS library? -if test $acx_blas_ok = no; then - unset ac_cv_lib_blas_sgemm - AC_CHECK_LIB(blas, $sgemm, [acx_blas_ok=yes; acx_blas_libs="-lblas"]) -fi - -# blas on SGI/CRAY -if test $acx_blas_ok = no; then - unset ac_cv_lib_blas_sgemm - AC_CHECK_LIB(blas, $sgemm, - [acx_blas_ok=yes; acx_blas_libs="-lblas -lcraylibs"],[],[-lcraylibs]) -fi - -# Check for vecLib framework (Darwin) -if test $acx_blas_ok = no; then - save_LIBS="$LIBS"; LIBS="-framework vecLib $LIBS" - AC_MSG_CHECKING([for $sgemm in vecLib]) - AC_TRY_LINK_FUNC($sgemm, [acx_blas_ok=yes; acx_blas_libs="-framework vecLib"]) - AC_MSG_RESULT($acx_blas_ok) - LIBS="$save_LIBS" -fi - -BLAS_LIBS="$acx_blas_libs" -AC_SUBST(BLAS_LIBS) - -LIBS="$acx_blas_save_LIBS" -LDFLAGS="$acx_blas_save_LDFLAGS $acx_blas_dir" - -test x"$acx_blas_ok" = xspecific && acx_blas_ok=yes -# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: -if test x"$acx_blas_ok" = xyes; then - ifelse([$1],,AC_DEFINE(HAVE_BLAS,1,[Define if you have a BLAS library.]),[$1]) - : -else - acx_blas_ok=no - $2 -fi -])dnl ACX_BLAS diff --git a/libadaptivity/acx_lapack.m4 b/libadaptivity/acx_lapack.m4 deleted file mode 100644 index 1f532a118d..0000000000 --- a/libadaptivity/acx_lapack.m4 +++ /dev/null @@ -1,140 +0,0 @@ -dnl @synopsis ACX_LAPACK([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) -dnl -dnl This macro looks for a library that implements the LAPACK -dnl linear-algebra interface (see http://www.netlib.org/lapack/). -dnl On success, it sets the LAPACK_LIBS output variable to -dnl hold the requisite library linkages. -dnl -dnl To link with LAPACK, you should link with: -dnl -dnl $LAPACK_LIBS $BLAS_LIBS $LIBS -dnl -dnl in that order. BLAS_LIBS is the output variable of the ACX_BLAS -dnl macro, called automatically. 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 The user may also use --with-lapack= in order to use some -dnl specific LAPACK library . 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 LAPACK and BLAS libraries. -dnl -dnl ACTION-IF-FOUND is a list of shell commands to run if a LAPACK -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_LAPACK. -dnl -dnl @version $Id: acx_lapack.m4,v 1.2 2003/04/01 09:18:55 juselius Exp $ -dnl @author Steven G. Johnson -dnl -AC_DEFUN([ACX_LAPACK], [ -AC_REQUIRE([ACX_BLAS]) -acx_lapack_ok=no -acx_lapack_save_LIBS="$LIBS" -acx_lapack_save_LDFLAGS="$LDFLAGS" -acx_lapack_save_FFLAGS="$FFLAGS" -acx_lapack_libs="" -acx_lapack_dir="" - -AC_ARG_WITH(lapack, - [AC_HELP_STRING([--with-lapack=], [use LAPACK library ])]) - -case $with_lapack in - yes | "") ;; - no) acx_lapack_ok=disable ;; - -l* | */* | *.a | *.so | *.so.* | *.o) acx_lapack_libs="$with_lapack" ;; - *) acx_lapack_libs="-l$with_lapack" ;; -esac - -AC_ARG_WITH(lapack_dir, - [AC_HELP_STRING([--with-lapack-dir=], [look for LAPACK library in ])]) - -case $with_lapack_dir in - yes | no | "") ;; - -L*) LDFLAGS="$LDFLAGS $with_lapack_dir" - acx_lapack_dir="$with_lapack_dir" ;; - *) LDFLAGS="$LDFLAGS -L$with_lapack_dir" - acx_lapack_dir="-L$with_lapack_dir" ;; -esac - -# We cannot use LAPACK if BLAS is not found -if test "x$acx_blas_ok" != xyes; then - acx_lapack_ok=noblas -fi - -# add BLAS to libs -LIBS="$BLAS_LIBS $LIBS" - -# Are we linking from C? -case "$ac_ext" in - f*|F*) dsyev="dsyev" ;; - *) - AC_FC_FUNC([dsyev]) - LIBS="$LIBS $FCLIBS" - ;; -esac - -# If --with-lapack is defined, then look for THIS AND ONLY THIS lapack lib -if test $acx_lapack_ok = no; then -case $with_lapack in - ""|yes) ;; - *) save_LIBS="$LIBS"; LIBS="$acx_lapack_libs $LIBS" - AC_MSG_CHECKING([for $dsyev in $acx_lapack_libs]) - AC_TRY_LINK_FUNC($dsyev, [acx_lapack_ok=yes]) - AC_MSG_RESULT($acx_lapack_ok) - LIBS="$save_LIBS" - acx_lapack_ok=specific - ;; -esac -fi - -# First, check LAPACK_LIBS environment variable -if test $acx_lapack_ok = no; then -if test "x$LAPACK_LIBS" != x; then - save_LIBS="$LIBS"; LIBS="$LAPACK_LIBS $LIBS" - AC_MSG_CHECKING([for $dsyev in $LAPACK_LIBS]) - AC_TRY_LINK_FUNC($dsyev, [acx_lapack_ok=yes; - acx_lapack_libs=$LAPACK_LIBS]) - AC_MSG_RESULT($acx_lapack_ok) - LIBS="$save_LIBS" -fi -fi - -# Intel MKL LAPACK? -if test $acx_lapack_ok = no; then - AC_CHECK_LIB(mkl_lapack, $dsyev, - [acx_lapack_ok=yes; acx_lapack_libs="-lmkl_lapack"], - [],[]) -fi - -# LAPACK linked to by default? (is sometimes included in BLAS lib) -if test $acx_lapack_ok = no; then - AC_MSG_CHECKING([for $dsyev in BLAS library]) - AC_TRY_LINK_FUNC($dsyev, [acx_lapack_ok=yes; acx_lapack_libs=""]) - AC_MSG_RESULT($acx_lapack_ok) -fi - -# Generic LAPACK library? -if test $acx_lapack_ok = no; then - AC_CHECK_LIB(lapack, $dsyev, - [acx_lapack_ok=yes; acx_lapack_libs="-llapack"], [], []) -fi - -LAPACK_LIBS="$acx_lapack_libs" -LIBS="$acx_lapack_save_LIBS" -LDFLAGS="$acx_lapack_save_LDFLAGS $acx_lapack_dir" - -AC_SUBST(LAPACK_LIBS) - -# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: -if test x"$acx_lapack_ok" = xyes; then - ifelse([$1],,AC_DEFINE(HAVE_LAPACK,1,[Define if you have LAPACK library.]),[$1]) - : -else - acx_lapack_ok=no - $2 -fi -])dnl ACX_LAPACK diff --git a/libadaptivity/ax_blas.m4 b/libadaptivity/ax_blas.m4 new file mode 100644 index 0000000000..851a25712c --- /dev/null +++ b/libadaptivity/ax_blas.m4 @@ -0,0 +1,248 @@ +# =========================================================================== +# https://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= in order to use some specific BLAS +# library . 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 +# Copyright (c) 2019 Geoffrey M. Oxberry +# +# 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 . +# +# 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 21 + +AU_ALIAS([ACX_BLAS], [AX_BLAS]) +AC_DEFUN([AX_BLAS], [ +AC_PREREQ([2.55]) +AC_REQUIRE([AC_F77_LIBRARY_LDFLAGS]) +AC_REQUIRE([AC_CANONICAL_HOST]) +ax_blas_ok=no + +AC_ARG_WITH(blas, + [AS_HELP_STRING([--with-blas=], [use BLAS library ])]) +case $with_blas in + yes | "") ;; + no) ax_blas_ok=disable ;; + -* | */* | *.a | *.so | *.so.* | *.dylib | *.dylib.* | *.o) + BLAS_LIBS="$with_blas" + ;; + *) BLAS_LIBS="-l$with_blas" ;; +esac + +# Get fortran linker names of BLAS functions to check for. +AC_F77_FUNC(sgemm) +AC_F77_FUNC(dgemm) + +ax_blas_save_LIBS="$LIBS" +LIBS="$LIBS $FLIBS" + +# First, check BLAS_LIBS environment variable +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])], [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 $ax_blas_ok = no; then + save_LIBS="$LIBS"; LIBS="$LIBS" + AC_MSG_CHECKING([if $sgemm is being linked in already]) + AC_LINK_IFELSE([AC_LANG_CALL([], [$sgemm])], [ax_blas_ok=yes]) + AC_MSG_RESULT($ax_blas_ok) + LIBS="$save_LIBS" +fi + +# BLAS linked to by flexiblas? (Default on FC33+ and RHEL9+) + +if test $ax_blas_ok = no; then + AC_CHECK_LIB(flexiblas, $sgemm, [ax_blas_ok=yes + BLAS_LIBS="-lflexiblas"]) +fi + +# BLAS in OpenBLAS library? (http://xianyi.github.com/OpenBLAS/) +if test $ax_blas_ok = no; then + AC_CHECK_LIB(openblas, $sgemm, [ax_blas_ok=yes + BLAS_LIBS="-lopenblas"]) +fi + +# BLAS in ATLAS library? (http://math-atlas.sourceforge.net/) +if test $ax_blas_ok = no; then + AC_CHECK_LIB(atlas, ATL_xerbla, + [AC_CHECK_LIB(f77blas, $sgemm, + [AC_CHECK_LIB(cblas, cblas_dgemm, + [ax_blas_ok=yes + BLAS_LIBS="-lcblas -lf77blas -latlas"], + [], [-lf77blas -latlas])], + [], [-latlas])]) +fi + +# BLAS in PhiPACK libraries? (requires generic BLAS lib, too) +if test $ax_blas_ok = no; then + AC_CHECK_LIB(blas, $sgemm, + [AC_CHECK_LIB(dgemm, $dgemm, + [AC_CHECK_LIB(sgemm, $sgemm, + [ax_blas_ok=yes; BLAS_LIBS="-lsgemm -ldgemm -lblas"], + [], [-lblas])], + [], [-lblas])]) +fi + +# BLAS in Intel MKL library? +if test $ax_blas_ok = no; then + # MKL for gfortran + if test x"$ac_cv_fc_compiler_gnu" = xyes; then + # 64 bit + if test $host_cpu = x86_64; then + AC_CHECK_LIB(mkl_gf_lp64, $sgemm, + [ax_blas_ok=yes;BLAS_LIBS="-lmkl_gf_lp64 -lmkl_sequential -lmkl_core -lpthread"],, + [-lmkl_gf_lp64 -lmkl_sequential -lmkl_core -lpthread]) + # 32 bit + elif test $host_cpu = i686; then + AC_CHECK_LIB(mkl_gf, $sgemm, + [ax_blas_ok=yes;BLAS_LIBS="-lmkl_gf -lmkl_sequential -lmkl_core -lpthread"],, + [-lmkl_gf -lmkl_sequential -lmkl_core -lpthread]) + fi + # MKL for other compilers (Intel, PGI, ...?) + else + # 64-bit + if test $host_cpu = x86_64; then + AC_CHECK_LIB(mkl_intel_lp64, $sgemm, + [ax_blas_ok=yes;BLAS_LIBS="-lmkl_intel_lp64 -lmkl_sequential -lmkl_core -lpthread"],, + [-lmkl_intel_lp64 -lmkl_sequential -lmkl_core -lpthread]) + # 32-bit + elif test $host_cpu = i686; then + AC_CHECK_LIB(mkl_intel, $sgemm, + [ax_blas_ok=yes;BLAS_LIBS="-lmkl_intel -lmkl_sequential -lmkl_core -lpthread"],, + [-lmkl_intel -lmkl_sequential -lmkl_core -lpthread]) + fi + fi +fi +# Old versions of MKL +if test $ax_blas_ok = no; then + AC_CHECK_LIB(mkl, $sgemm, [ax_blas_ok=yes;BLAS_LIBS="-lmkl -lguide -lpthread"],,[-lguide -lpthread]) +fi + +# BLAS in Apple vecLib library? +if test $ax_blas_ok = no; then + save_LIBS="$LIBS"; LIBS="-framework Accelerate $LIBS" + AC_MSG_CHECKING([for $sgemm in -framework Accelerate]) + AC_LINK_IFELSE([AC_LANG_CALL([], [$sgemm])], [ax_blas_ok=yes;BLAS_LIBS="-framework Accelerate"]) + AC_MSG_RESULT($ax_blas_ok) + 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"]) +fi + +# BLAS in Alpha DXML library? (now called CXML, see above) +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 $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="-xlic_lib=sunperf -lsunmath" + ax_blas_ok=yes],[],[-lsunmath])]) + fi +fi + +# BLAS in SCSL library? (SGI/Cray Scientific Library) +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 $ax_blas_ok = no; then + AC_CHECK_LIB(complib.sgimath, $sgemm, + [ax_blas_ok=yes; BLAS_LIBS="-lcomplib.sgimath"]) +fi + +# BLAS in IBM ESSL library? (requires generic BLAS lib, too) +if test $ax_blas_ok = no; then + AC_CHECK_LIB(blas, $sgemm, + [AC_CHECK_LIB(essl, $sgemm, + [ax_blas_ok=yes; BLAS_LIBS="-lessl -lblas"], + [], [-lblas $FLIBS])]) +fi + +# Generic BLAS library? +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="$ax_blas_save_LIBS" + +# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: +if test x"$ax_blas_ok" = xyes; then + ifelse([$1],,AC_DEFINE(HAVE_BLAS,1,[Define if you have a BLAS library.]),[$1]) + : +else + ax_blas_ok=no + $2 +fi +])dnl AX_BLAS diff --git a/libadaptivity/ax_lapack.m4 b/libadaptivity/ax_lapack.m4 new file mode 100644 index 0000000000..abaff9d171 --- /dev/null +++ b/libadaptivity/ax_lapack.m4 @@ -0,0 +1,134 @@ +# =========================================================================== +# https://www.gnu.org/software/autoconf-archive/ax_lapack.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_LAPACK([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) +# +# DESCRIPTION +# +# This macro looks for a library that implements the LAPACK linear-algebra +# interface (see http://www.netlib.org/lapack/). On success, it sets the +# LAPACK_LIBS output variable to hold the requisite library linkages. +# +# To link with LAPACK, you should link with: +# +# $LAPACK_LIBS $BLAS_LIBS $LIBS $FLIBS +# +# 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 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. +# +# The user may also use --with-lapack= in order to use some specific +# LAPACK library . 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 LAPACK and BLAS +# libraries. +# +# ACTION-IF-FOUND is a list of shell commands to run if a LAPACK 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_LAPACK. +# +# LICENSE +# +# Copyright (c) 2009 Steven G. Johnson +# Copyright (c) 2019 Geoffrey M. Oxberry +# +# 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 . +# +# 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 10 + +AU_ALIAS([ACX_LAPACK], [AX_LAPACK]) +AC_DEFUN([AX_LAPACK], [ +AC_REQUIRE([AX_BLAS]) +ax_lapack_ok=no + +AC_ARG_WITH(lapack, + [AS_HELP_STRING([--with-lapack=], [use LAPACK library ])]) +case $with_lapack in + yes | "") ;; + no) ax_lapack_ok=disable ;; + -* | */* | *.a | *.so | *.so.* | *.dylib | *.dylib.* | *.o) + LAPACK_LIBS="$with_lapack" + ;; + *) LAPACK_LIBS="-l$with_lapack" ;; +esac + +# Get fortran linker name of LAPACK function to check for. +AC_F77_FUNC(cheev) + +# We cannot use LAPACK if BLAS is not found +if test "x$ax_blas_ok" != xyes; then + ax_lapack_ok=noblas + LAPACK_LIBS="" +fi + +# First, check LAPACK_LIBS environment variable +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_LINK_IFELSE([AC_LANG_CALL([], [$cheev])], [ax_lapack_ok=yes], [LAPACK_LIBS=""]) + AC_MSG_RESULT($ax_lapack_ok) + LIBS="$save_LIBS" + if test $ax_lapack_ok = no; then + LAPACK_LIBS="" + fi +fi + +# LAPACK linked to by default? (is sometimes included in BLAS lib) +if test $ax_lapack_ok = no; then + save_LIBS="$LIBS"; LIBS="$LIBS $BLAS_LIBS $FLIBS" + AC_CHECK_FUNC($cheev, [ax_lapack_ok=yes]) + LIBS="$save_LIBS" +fi + +# Generic LAPACK library? +for lapack in lapack lapack_rs6k; do + if test $ax_lapack_ok = no; then + save_LIBS="$LIBS"; LIBS="$BLAS_LIBS $LIBS" + AC_CHECK_LIB($lapack, $cheev, + [ax_lapack_ok=yes; LAPACK_LIBS="-l$lapack"], [], [$FLIBS]) + LIBS="$save_LIBS" + fi +done + +AC_SUBST(LAPACK_LIBS) + +# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: +if test x"$ax_lapack_ok" = xyes; then + ifelse([$1],,AC_DEFINE(HAVE_LAPACK,1,[Define if you have LAPACK library.]),[$1]) + : +else + ax_lapack_ok=no + $2 +fi +])dnl AX_LAPACK diff --git a/libadaptivity/configure b/libadaptivity/configure index 42e688dfd1..33faaa70a4 100755 --- a/libadaptivity/configure +++ b/libadaptivity/configure @@ -739,9 +739,7 @@ ac_user_opts=' enable_option_checking enable_debugging with_blas -with_blas_dir with_lapack -with_lapack_dir enable_vtk enable_shared enable_verbose @@ -1399,9 +1397,7 @@ Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-blas= use BLAS library - --with-blas-dir= look for BLAS library in --with-lapack= use LAPACK library - --with-lapack-dir= look for LAPACK library in Some influential environment variables: F77 Fortran 77 compiler command @@ -2053,52 +2049,75 @@ fi } # ac_fn_cxx_try_link -# ac_fn_f77_try_link LINENO -# ------------------------- -# Try to link conftest.$ac_ext, and return whether this succeeded. -ac_fn_f77_try_link () +# ac_fn_c_check_func LINENO FUNC VAR +# ---------------------------------- +# Tests whether FUNC exists, setting the cache variable VAR accordingly +ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext conftest.beam conftest$ac_exeext - if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -printf "%s\n" "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { - test -z "$ac_f77_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - test -x conftest$ac_exeext - } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +printf %s "checking for $2... " >&6; } +if eval test \${$3+y} then : - ac_retval=0 + printf %s "(cached) " >&6 else $as_nop - printf "%s\n" "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Define $2 to an innocuous variant, in case declares $2. + For example, HP-UX 11i declares gettimeofday. */ +#define $2 innocuous_$2 - ac_retval=1 +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $2 (); below. */ + +#include +#undef $2 + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $2 (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$2 || defined __stub___$2 +choke me +#endif + +#ifdef F77_DUMMY_MAIN + +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } + +#endif +int +main (void) +{ +return $2 (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + eval "$3=yes" +else $as_nop + eval "$3=no" fi - # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information - # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would - # interfere with the next link command; also delete a directory that is - # left behind by Apple's compiler. We do this before executing the actions. - rm -rf conftest.dSYM conftest_ipa8_conftest.oo +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +fi +eval ac_res=\$$3 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval -} # ac_fn_f77_try_link +} # ac_fn_c_check_func # ac_fn_cxx_check_header_compile LINENO HEADER VAR INCLUDES # --------------------------------------------------------- @@ -6847,30 +6866,84 @@ printf "%s\n" "$as_me: Will look in $i for MKL." >&6;} LAPACK_LIBS="-L$i $LAPACK_LIBS" fi done - ac_ext=${ac_fc_srcext-f} -ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5' -ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_fc_compiler_gnu -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dummy main to link with Fortran libraries" >&5 -printf %s "checking for dummy main to link with Fortran libraries... " >&6; } -if test ${ac_cv_fc_dummy_main+y} + + + + +ax_blas_ok=no + + +# Check whether --with-blas was given. +if test ${with_blas+y} then : - printf %s "(cached) " >&6 -else $as_nop - ac_fc_dm_save_LIBS=$LIBS - LIBS="$LIBS $FCLIBS" - ac_fortran_dm_var=FC_DUMMY_MAIN - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu + withval=$with_blas; +fi - # First, try linking without a dummy main: - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +case $with_blas in + yes | "") ;; + no) ax_blas_ok=disable ;; + -* | */* | *.a | *.so | *.so.* | *.dylib | *.dylib.* | *.o) + BLAS_LIBS="$with_blas" + ;; + *) BLAS_LIBS="-l$with_blas" ;; +esac + +# Get fortran linker names of BLAS functions to check for. +ac_ext=f +ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' +ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_f77_compiler_gnu +case $ac_cv_f77_mangling in + upper*) ac_val="SGEMM" ;; + lower*) ac_val="sgemm" ;; + *) ac_val="unknown" ;; +esac +case $ac_cv_f77_mangling in *," underscore"*) ac_val="$ac_val"_ ;; esac + +sgemm="$ac_val" + +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + +ac_ext=f +ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' +ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_f77_compiler_gnu +case $ac_cv_f77_mangling in + upper*) ac_val="DGEMM" ;; + lower*) ac_val="dgemm" ;; + *) ac_val="unknown" ;; +esac +case $ac_cv_f77_mangling in *," underscore"*) ac_val="$ac_val"_ ;; esac + +dgemm="$ac_val" + +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + +ax_blas_save_LIBS="$LIBS" +LIBS="$LIBS $FLIBS" + +# First, check BLAS_LIBS environment variable +if test $ax_blas_ok = no; then +if test "x$BLAS_LIBS" != x; then + save_LIBS="$LIBS"; LIBS="$BLAS_LIBS $LIBS" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $sgemm in $BLAS_LIBS" >&5 +printf %s "checking for $sgemm in $BLAS_LIBS... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ +namespace conftest { + extern "C" int $sgemm (); +} #ifdef F77_DUMMY_MAIN # ifdef __cplusplus @@ -6878,37 +6951,40 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu # endif int F77_DUMMY_MAIN() { return 1; } -#endif -#ifdef FC_DUMMY_MAIN -#ifndef FC_DUMMY_MAIN_EQ_F77 -# ifdef __cplusplus - extern "C" -# endif - int FC_DUMMY_MAIN() { return 1; } -#endif #endif int main (void) { - +return conftest::$sgemm (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO" +if ac_fn_cxx_try_link "$LINENO" then : - ac_cv_fortran_dummy_main=none + ax_blas_ok=yes else $as_nop - ac_cv_fortran_dummy_main=unknown + BLAS_LIBS="" fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_blas_ok" >&5 +printf "%s\n" "$ax_blas_ok" >&6; } + LIBS="$save_LIBS" +fi +fi - if test $ac_cv_fortran_dummy_main = unknown; then - for ac_func in MAIN__ MAIN_ __main MAIN _MAIN __MAIN main_ main__ _main; do - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +# BLAS linked to by default? (happens on some supercomputers) +if test $ax_blas_ok = no; then + save_LIBS="$LIBS"; LIBS="$LIBS" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $sgemm is being linked in already" >&5 +printf %s "checking if $sgemm is being linked in already... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#define $ac_fortran_dm_var $ac_func + +namespace conftest { + extern "C" int $sgemm (); +} #ifdef F77_DUMMY_MAIN # ifdef __cplusplus @@ -6916,109 +6992,44 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam \ # endif int F77_DUMMY_MAIN() { return 1; } -#endif -#ifdef FC_DUMMY_MAIN -#ifndef FC_DUMMY_MAIN_EQ_F77 -# ifdef __cplusplus - extern "C" -# endif - int FC_DUMMY_MAIN() { return 1; } -#endif #endif int main (void) { - +return conftest::$sgemm (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO" +if ac_fn_cxx_try_link "$LINENO" then : - ac_cv_fortran_dummy_main=$ac_func; break + ax_blas_ok=yes fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - done - fi - ac_ext=${ac_fc_srcext-f} -ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5' -ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_fc_compiler_gnu - ac_cv_fc_dummy_main=$ac_cv_fortran_dummy_main - rm -rf conftest* - LIBS=$ac_fc_dm_save_LIBS - -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_fc_dummy_main" >&5 -printf "%s\n" "$ac_cv_fc_dummy_main" >&6; } -FC_DUMMY_MAIN=$ac_cv_fc_dummy_main -if test "$FC_DUMMY_MAIN" != unknown -then : - if test $FC_DUMMY_MAIN != none; then - -printf "%s\n" "#define FC_DUMMY_MAIN $FC_DUMMY_MAIN" >>confdefs.h - - if test "x$ac_cv_fc_dummy_main" = "x$ac_cv_f77_dummy_main"; then - -printf "%s\n" "#define FC_DUMMY_MAIN_EQ_F77 1" >>confdefs.h - - fi -fi -else $as_nop - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "linking to Fortran libraries from C fails -See \`config.log' for more details" "$LINENO" 5; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_blas_ok" >&5 +printf "%s\n" "$ax_blas_ok" >&6; } + LIBS="$save_LIBS" fi -ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +# BLAS linked to by flexiblas? (Default on FC33+ and RHEL9+) -ac_ext=${ac_fc_srcext-f} -ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5' -ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_fc_compiler_gnu -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for Fortran name-mangling scheme" >&5 -printf %s "checking for Fortran name-mangling scheme... " >&6; } -if test ${ac_cv_fc_mangling+y} +if test $ax_blas_ok = no; then + as_ac_Lib=`printf "%s\n" "ac_cv_lib_flexiblas_$sgemm" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $sgemm in -lflexiblas" >&5 +printf %s "checking for $sgemm in -lflexiblas... " >&6; } +if eval test \${$as_ac_Lib+y} then : printf %s "(cached) " >&6 else $as_nop - cat > conftest.$ac_ext <<_ACEOF - subroutine foobar() - return - end - subroutine foo_bar() - return - end -_ACEOF -if ac_fn_fc_try_compile "$LINENO" -then : - mv conftest.$ac_objext cfortran_test.$ac_objext - - ac_save_LIBS=$LIBS - LIBS="cfortran_test.$ac_objext $LIBS $FCLIBS" - - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - ac_success=no - for ac_foobar in foobar FOOBAR; do - for ac_underscore in "" "_"; do - ac_func="$ac_foobar$ac_underscore" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + ac_check_lib_save_LIBS=$LIBS +LIBS="-lflexiblas $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char $ac_func (); +namespace conftest { + extern "C" int $sgemm (); +} #ifdef F77_DUMMY_MAIN # ifdef __cplusplus @@ -7026,63 +7037,53 @@ char $ac_func (); # endif int F77_DUMMY_MAIN() { return 1; } -#endif -#ifdef FC_DUMMY_MAIN -#ifndef FC_DUMMY_MAIN_EQ_F77 -# ifdef __cplusplus - extern "C" -# endif - int FC_DUMMY_MAIN() { return 1; } -#endif #endif int main (void) { -return $ac_func (); +return conftest::$sgemm (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO" +if ac_fn_cxx_try_link "$LINENO" then : - ac_success=yes; break 2 + eval "$as_ac_Lib=yes" +else $as_nop + eval "$as_ac_Lib=no" fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - done - done - ac_ext=${ac_fc_srcext-f} -ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5' -ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_fc_compiler_gnu +LIBS=$ac_check_lib_save_LIBS +fi +eval ac_res=\$$as_ac_Lib + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_ac_Lib"\" = x"yes" +then : + ax_blas_ok=yes + BLAS_LIBS="-lflexiblas" +fi - if test "$ac_success" = "yes"; then - case $ac_foobar in - foobar) - ac_case=lower - ac_foo_bar=foo_bar - ;; - FOOBAR) - ac_case=upper - ac_foo_bar=FOO_BAR - ;; - esac +fi - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - ac_success_extra=no - for ac_extra in "" "_"; do - ac_func="$ac_foo_bar$ac_underscore$ac_extra" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +# BLAS in OpenBLAS library? (http://xianyi.github.com/OpenBLAS/) +if test $ax_blas_ok = no; then + as_ac_Lib=`printf "%s\n" "ac_cv_lib_openblas_$sgemm" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $sgemm in -lopenblas" >&5 +printf %s "checking for $sgemm in -lopenblas... " >&6; } +if eval test \${$as_ac_Lib+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-lopenblas $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char $ac_func (); +namespace conftest { + extern "C" int $sgemm (); +} #ifdef F77_DUMMY_MAIN # ifdef __cplusplus @@ -7090,156 +7091,51 @@ char $ac_func (); # endif int F77_DUMMY_MAIN() { return 1; } -#endif -#ifdef FC_DUMMY_MAIN -#ifndef FC_DUMMY_MAIN_EQ_F77 -# ifdef __cplusplus - extern "C" -# endif - int FC_DUMMY_MAIN() { return 1; } -#endif #endif int main (void) { -return $ac_func (); +return conftest::$sgemm (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO" +if ac_fn_cxx_try_link "$LINENO" then : - ac_success_extra=yes; break + eval "$as_ac_Lib=yes" +else $as_nop + eval "$as_ac_Lib=no" fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - done - ac_ext=${ac_fc_srcext-f} -ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5' -ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_fc_compiler_gnu - - if test "$ac_success_extra" = "yes"; then - ac_cv_fc_mangling="$ac_case case" - if test -z "$ac_underscore"; then - ac_cv_fc_mangling="$ac_cv_fc_mangling, no underscore" - else - ac_cv_fc_mangling="$ac_cv_fc_mangling, underscore" - fi - if test -z "$ac_extra"; then - ac_cv_fc_mangling="$ac_cv_fc_mangling, no extra underscore" - else - ac_cv_fc_mangling="$ac_cv_fc_mangling, extra underscore" - fi - else - ac_cv_fc_mangling="unknown" - fi - else - ac_cv_fc_mangling="unknown" - fi - - LIBS=$ac_save_LIBS - rm -rf conftest* - rm -f cfortran_test* -else $as_nop - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot compile a simple Fortran program -See \`config.log' for more details" "$LINENO" 5; } -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - +LIBS=$ac_check_lib_save_LIBS fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_fc_mangling" >&5 -printf "%s\n" "$ac_cv_fc_mangling" >&6; } - -ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - - - - -acx_blas_ok=no -acx_blas_save_LIBS="$LIBS" -acx_blas_save_LDFLAGS="$LDFLAGS" -acx_blas_save_FFLAGS="$FFLAGS" -acx_blas_libs="" -acx_blas_dir="" - - -# Check whether --with-blas was given. -if test ${with_blas+y} +eval ac_res=\$$as_ac_Lib + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_ac_Lib"\" = x"yes" then : - withval=$with_blas; + ax_blas_ok=yes + BLAS_LIBS="-lopenblas" fi - -case $with_blas in - yes | "") ;; - no) acx_blas_ok=disable ;; - -l* | */* | *.a | *.so | *.so.* | *.o) acx_blas_libs="$with_blas" ;; - *) acx_blas_libs="-l$with_blas" ;; -esac - - -# Check whether --with-blas_dir was given. -if test ${with_blas_dir+y} -then : - withval=$with_blas_dir; fi - -case $with_blas_dir in - yes | no | "") ;; - -L*) LDFLAGS="$LDFLAGS $with_blas_dir" - acx_blas_dir="$with_blas_dir" ;; - *) LDFLAGS="$LDFLAGS -L$with_blas_dir" - acx_blas_dir="-L$with_blas_dir" ;; -esac - -# Are we linking from C? -case "$ac_ext" in - f*|F*) sgemm="sgemm" ;; - *) - ac_ext=${ac_fc_srcext-f} -ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5' -ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_fc_compiler_gnu -case $ac_cv_fc_mangling in - upper*) ac_val="SGEMM" ;; - lower*) ac_val="sgemm" ;; - *) ac_val="unknown" ;; -esac -case $ac_cv_fc_mangling in *," underscore"*) ac_val="$ac_val"_ ;; esac - -sgemm="$ac_val" - -ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - LIBS="$LIBS $FCLIBS" - ;; -esac - -# If --with-blas is defined, then look for THIS AND ONLY THIS blas lib -if test $acx_blas_ok = no; then -case $with_blas in - ""|yes) ;; - *) save_LIBS="$LIBS"; LIBS="$acx_blas_libs $LIBS" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $sgemm in $acx_blas_libs" >&5 -printf %s "checking for $sgemm in $acx_blas_libs... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +# BLAS in ATLAS library? (http://math-atlas.sourceforge.net/) +if test $ax_blas_ok = no; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ATL_xerbla in -latlas" >&5 +printf %s "checking for ATL_xerbla in -latlas... " >&6; } +if test ${ac_cv_lib_atlas_ATL_xerbla+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-latlas $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ namespace conftest { - extern "C" int $sgemm (); + extern "C" int ATL_xerbla (); } #ifdef F77_DUMMY_MAIN @@ -7248,44 +7144,39 @@ namespace conftest { # endif int F77_DUMMY_MAIN() { return 1; } -#endif -#ifdef FC_DUMMY_MAIN -#ifndef FC_DUMMY_MAIN_EQ_F77 -# ifdef __cplusplus - extern "C" -# endif - int FC_DUMMY_MAIN() { return 1; } -#endif #endif int main (void) { -return conftest::$sgemm (); +return conftest::ATL_xerbla (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO" then : - acx_blas_ok=yes + ac_cv_lib_atlas_ATL_xerbla=yes +else $as_nop + ac_cv_lib_atlas_ATL_xerbla=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $acx_blas_ok" >&5 -printf "%s\n" "$acx_blas_ok" >&6; } - LIBS="$save_LIBS" - acx_blas_ok=specific - ;; -esac +LIBS=$ac_check_lib_save_LIBS fi - -# First, check BLAS_LIBS environment variable -if test $acx_blas_ok = no; then -if test "x$BLAS_LIBS" != x; then - save_LIBS="$LIBS"; LIBS="$BLAS_LIBS $LIBS" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $sgemm in $BLAS_LIBS" >&5 -printf %s "checking for $sgemm in $BLAS_LIBS... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_atlas_ATL_xerbla" >&5 +printf "%s\n" "$ac_cv_lib_atlas_ATL_xerbla" >&6; } +if test "x$ac_cv_lib_atlas_ATL_xerbla" = xyes +then : + as_ac_Lib=`printf "%s\n" "ac_cv_lib_f77blas_$sgemm" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $sgemm in -lf77blas" >&5 +printf %s "checking for $sgemm in -lf77blas... " >&6; } +if eval test \${$as_ac_Lib+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-lf77blas -latlas $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ namespace conftest { @@ -7298,14 +7189,6 @@ namespace conftest { # endif int F77_DUMMY_MAIN() { return 1; } -#endif -#ifdef FC_DUMMY_MAIN -#ifndef FC_DUMMY_MAIN_EQ_F77 -# ifdef __cplusplus - extern "C" -# endif - int FC_DUMMY_MAIN() { return 1; } -#endif #endif int main (void) @@ -7317,25 +7200,32 @@ return conftest::$sgemm (); _ACEOF if ac_fn_cxx_try_link "$LINENO" then : - acx_blas_ok=yes; acx_blas_libs=$BLAS_LIBS + eval "$as_ac_Lib=yes" +else $as_nop + eval "$as_ac_Lib=no" fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $acx_blas_ok" >&5 -printf "%s\n" "$acx_blas_ok" >&6; } - LIBS="$save_LIBS" -fi +LIBS=$ac_check_lib_save_LIBS fi - -# BLAS linked to by default? (happens on some supercomputers) -if test $acx_blas_ok = no; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for builtin $sgemm" >&5 -printf %s "checking for builtin $sgemm... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +eval ac_res=\$$as_ac_Lib + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_ac_Lib"\" = x"yes" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for cblas_dgemm in -lcblas" >&5 +printf %s "checking for cblas_dgemm in -lcblas... " >&6; } +if test ${ac_cv_lib_cblas_cblas_dgemm+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-lcblas -lf77blas -latlas $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ namespace conftest { - extern "C" int $sgemm (); + extern "C" int cblas_dgemm (); } #ifdef F77_DUMMY_MAIN @@ -7344,45 +7234,50 @@ namespace conftest { # endif int F77_DUMMY_MAIN() { return 1; } -#endif -#ifdef FC_DUMMY_MAIN -#ifndef FC_DUMMY_MAIN_EQ_F77 -# ifdef __cplusplus - extern "C" -# endif - int FC_DUMMY_MAIN() { return 1; } -#endif #endif int main (void) { -return conftest::$sgemm (); +return conftest::cblas_dgemm (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO" then : - acx_blas_ok=yes + ac_cv_lib_cblas_cblas_dgemm=yes +else $as_nop + ac_cv_lib_cblas_cblas_dgemm=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $acx_blas_ok" >&5 -printf "%s\n" "$acx_blas_ok" >&6; } +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cblas_cblas_dgemm" >&5 +printf "%s\n" "$ac_cv_lib_cblas_cblas_dgemm" >&6; } +if test "x$ac_cv_lib_cblas_cblas_dgemm" = xyes +then : + ax_blas_ok=yes + BLAS_LIBS="-lcblas -lf77blas -latlas" +fi + +fi + +fi + fi -# Intel mkl BLAS. Unfortunately some of Intel's blas routines are -# in their lapack library... -if test $acx_blas_ok = no; then - as_ac_Lib=`printf "%s\n" "ac_cv_lib_mkl_def_$sgemm" | $as_tr_sh` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $sgemm in -lmkl_def" >&5 -printf %s "checking for $sgemm in -lmkl_def... " >&6; } +# BLAS in PhiPACK libraries? (requires generic BLAS lib, too) +if test $ax_blas_ok = no; then + as_ac_Lib=`printf "%s\n" "ac_cv_lib_blas_$sgemm" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $sgemm in -lblas" >&5 +printf %s "checking for $sgemm in -lblas... " >&6; } if eval test \${$as_ac_Lib+y} then : printf %s "(cached) " >&6 else $as_nop ac_check_lib_save_LIBS=$LIBS -LIBS="-lmkl_def -lm $LIBS" +LIBS="-lblas $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -7396,14 +7291,6 @@ namespace conftest { # endif int F77_DUMMY_MAIN() { return 1; } -#endif -#ifdef FC_DUMMY_MAIN -#ifndef FC_DUMMY_MAIN_EQ_F77 -# ifdef __cplusplus - extern "C" -# endif - int FC_DUMMY_MAIN() { return 1; } -#endif #endif int main (void) @@ -7428,25 +7315,20 @@ eval ac_res=\$$as_ac_Lib printf "%s\n" "$ac_res" >&6; } if eval test \"x\$"$as_ac_Lib"\" = x"yes" then : - acx_blas_ok=yes; acx_blas_libs="-lmkl_def -lm" -fi - -fi -if test $acx_blas_ok = no; then - as_ac_Lib=`printf "%s\n" "ac_cv_lib_mkl_ipf_$sgemm" | $as_tr_sh` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $sgemm in -lmkl_ipf" >&5 -printf %s "checking for $sgemm in -lmkl_ipf... " >&6; } + as_ac_Lib=`printf "%s\n" "ac_cv_lib_dgemm_$dgemm" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $dgemm in -ldgemm" >&5 +printf %s "checking for $dgemm in -ldgemm... " >&6; } if eval test \${$as_ac_Lib+y} then : printf %s "(cached) " >&6 else $as_nop ac_check_lib_save_LIBS=$LIBS -LIBS="-lmkl_ipf -lguide -lm $LIBS" +LIBS="-ldgemm -lblas $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ namespace conftest { - extern "C" int $sgemm (); + extern "C" int $dgemm (); } #ifdef F77_DUMMY_MAIN @@ -7455,19 +7337,11 @@ namespace conftest { # endif int F77_DUMMY_MAIN() { return 1; } -#endif -#ifdef FC_DUMMY_MAIN -#ifndef FC_DUMMY_MAIN_EQ_F77 -# ifdef __cplusplus - extern "C" -# endif - int FC_DUMMY_MAIN() { return 1; } -#endif #endif int main (void) { -return conftest::$sgemm (); +return conftest::$dgemm (); ; return 0; } @@ -7487,20 +7361,15 @@ eval ac_res=\$$as_ac_Lib printf "%s\n" "$ac_res" >&6; } if eval test \"x\$"$as_ac_Lib"\" = x"yes" then : - acx_blas_ok=yes; acx_blas_libs="-lmkl_ipf -lguide -lm" -fi - -fi -if test $acx_blas_ok = no; then - as_ac_Lib=`printf "%s\n" "ac_cv_lib_mkl_em64t_$sgemm" | $as_tr_sh` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $sgemm in -lmkl_em64t" >&5 -printf %s "checking for $sgemm in -lmkl_em64t... " >&6; } + as_ac_Lib=`printf "%s\n" "ac_cv_lib_sgemm_$sgemm" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $sgemm in -lsgemm" >&5 +printf %s "checking for $sgemm in -lsgemm... " >&6; } if eval test \${$as_ac_Lib+y} then : printf %s "(cached) " >&6 else $as_nop ac_check_lib_save_LIBS=$LIBS -LIBS="-lmkl_em64t -lguide -liomp5 $LIBS" +LIBS="-lsgemm -lblas $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -7514,14 +7383,6 @@ namespace conftest { # endif int F77_DUMMY_MAIN() { return 1; } -#endif -#ifdef FC_DUMMY_MAIN -#ifndef FC_DUMMY_MAIN_EQ_F77 -# ifdef __cplusplus - extern "C" -# endif - int FC_DUMMY_MAIN() { return 1; } -#endif #endif int main (void) @@ -7546,79 +7407,30 @@ eval ac_res=\$$as_ac_Lib printf "%s\n" "$ac_res" >&6; } if eval test \"x\$"$as_ac_Lib"\" = x"yes" then : - acx_blas_ok=yes; acx_blas_libs="-lmkl_em64t -lguide -liomp5" + ax_blas_ok=yes; BLAS_LIBS="-lsgemm -ldgemm -lblas" fi fi -# check for older mkl -if test $acx_blas_ok = no; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: trying Intel MKL < 7:" >&5 -printf "%s\n" "$as_me: trying Intel MKL < 7:" >&6;} - unset ac_cv_lib_mkl_def_sgemm - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for lsame in -lmkl_lapack" >&5 -printf %s "checking for lsame in -lmkl_lapack... " >&6; } -if test ${ac_cv_lib_mkl_lapack_lsame+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS -LIBS="-lmkl_lapack $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -namespace conftest { - extern "C" int lsame (); -} -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } - -#endif -#ifdef FC_DUMMY_MAIN -#ifndef FC_DUMMY_MAIN_EQ_F77 -# ifdef __cplusplus - extern "C" -# endif - int FC_DUMMY_MAIN() { return 1; } -#endif -#endif -int -main (void) -{ -return conftest::lsame (); - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_link "$LINENO" -then : - ac_cv_lib_mkl_lapack_lsame=yes -else $as_nop - ac_cv_lib_mkl_lapack_lsame=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS + fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mkl_lapack_lsame" >&5 -printf "%s\n" "$ac_cv_lib_mkl_lapack_lsame" >&6; } -if test "x$ac_cv_lib_mkl_lapack_lsame" = xyes -then : - acx_lapack_ok=yes; - as_ac_Lib=`printf "%s\n" "ac_cv_lib_mkl_def_$sgemm" | $as_tr_sh` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $sgemm in -lmkl_def" >&5 -printf %s "checking for $sgemm in -lmkl_def... " >&6; } +# BLAS in Intel MKL library? +if test $ax_blas_ok = no; then + # MKL for gfortran + if test x"$ac_cv_fc_compiler_gnu" = xyes; then + # 64 bit + if test $host_cpu = x86_64; then + as_ac_Lib=`printf "%s\n" "ac_cv_lib_mkl_gf_lp64_$sgemm" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $sgemm in -lmkl_gf_lp64" >&5 +printf %s "checking for $sgemm in -lmkl_gf_lp64... " >&6; } if eval test \${$as_ac_Lib+y} then : printf %s "(cached) " >&6 else $as_nop ac_check_lib_save_LIBS=$LIBS -LIBS="-lmkl_def -lm -lpthread - $LIBS" +LIBS="-lmkl_gf_lp64 -lmkl_gf_lp64 -lmkl_sequential -lmkl_core -lpthread $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -7632,14 +7444,6 @@ namespace conftest { # endif int F77_DUMMY_MAIN() { return 1; } -#endif -#ifdef FC_DUMMY_MAIN -#ifndef FC_DUMMY_MAIN_EQ_F77 -# ifdef __cplusplus - extern "C" -# endif - int FC_DUMMY_MAIN() { return 1; } -#endif #endif int main (void) @@ -7664,28 +7468,20 @@ eval ac_res=\$$as_ac_Lib printf "%s\n" "$ac_res" >&6; } if eval test \"x\$"$as_ac_Lib"\" = x"yes" then : - acx_blas_ok=yes; - acx_blas_libs="-lmkl_def -lmkl_lapack -lm -lpthread" -fi - - -fi - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Intel MKL < 7... $acx_blas_ok" >&5 -printf "%s\n" "$as_me: Intel MKL < 7... $acx_blas_ok" >&6;} + ax_blas_ok=yes;BLAS_LIBS="-lmkl_gf_lp64 -lmkl_sequential -lmkl_core -lpthread" fi -# BLAS in ACML (pgi) -if test $acx_blas_ok = no; then - as_ac_Lib=`printf "%s\n" "ac_cv_lib_acml_$sgemm" | $as_tr_sh` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $sgemm in -lacml" >&5 -printf %s "checking for $sgemm in -lacml... " >&6; } + # 32 bit + elif test $host_cpu = i686; then + as_ac_Lib=`printf "%s\n" "ac_cv_lib_mkl_gf_$sgemm" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $sgemm in -lmkl_gf" >&5 +printf %s "checking for $sgemm in -lmkl_gf... " >&6; } if eval test \${$as_ac_Lib+y} then : printf %s "(cached) " >&6 else $as_nop ac_check_lib_save_LIBS=$LIBS -LIBS="-lacml $LIBS" +LIBS="-lmkl_gf -lmkl_gf -lmkl_sequential -lmkl_core -lpthread $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -7699,14 +7495,6 @@ namespace conftest { # endif int F77_DUMMY_MAIN() { return 1; } -#endif -#ifdef FC_DUMMY_MAIN -#ifndef FC_DUMMY_MAIN_EQ_F77 -# ifdef __cplusplus - extern "C" -# endif - int FC_DUMMY_MAIN() { return 1; } -#endif #endif int main (void) @@ -7731,22 +7519,23 @@ eval ac_res=\$$as_ac_Lib printf "%s\n" "$ac_res" >&6; } if eval test \"x\$"$as_ac_Lib"\" = x"yes" then : - acx_blas_ok=yes; acx_blas_libs="-lacml" -fi - + ax_blas_ok=yes;BLAS_LIBS="-lmkl_gf -lmkl_sequential -lmkl_core -lpthread" fi -# BLAS in ATLAS library? (http://math-atlas.sourceforge.net/) -if test $acx_blas_ok = no; then - as_ac_Lib=`printf "%s\n" "ac_cv_lib_f77blas_$sgemm" | $as_tr_sh` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $sgemm in -lf77blas" >&5 -printf %s "checking for $sgemm in -lf77blas... " >&6; } + fi + # MKL for other compilers (Intel, PGI, ...?) + else + # 64-bit + if test $host_cpu = x86_64; then + as_ac_Lib=`printf "%s\n" "ac_cv_lib_mkl_intel_lp64_$sgemm" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $sgemm in -lmkl_intel_lp64" >&5 +printf %s "checking for $sgemm in -lmkl_intel_lp64... " >&6; } if eval test \${$as_ac_Lib+y} then : printf %s "(cached) " >&6 else $as_nop ac_check_lib_save_LIBS=$LIBS -LIBS="-lf77blas -latlas $LIBS" +LIBS="-lmkl_intel_lp64 -lmkl_intel_lp64 -lmkl_sequential -lmkl_core -lpthread $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -7760,14 +7549,6 @@ namespace conftest { # endif int F77_DUMMY_MAIN() { return 1; } -#endif -#ifdef FC_DUMMY_MAIN -#ifndef FC_DUMMY_MAIN_EQ_F77 -# ifdef __cplusplus - extern "C" -# endif - int FC_DUMMY_MAIN() { return 1; } -#endif #endif int main (void) @@ -7792,22 +7573,20 @@ eval ac_res=\$$as_ac_Lib printf "%s\n" "$ac_res" >&6; } if eval test \"x\$"$as_ac_Lib"\" = x"yes" then : - acx_blas_ok=yes; acx_blas_libs="-lf77blas -latlas" -fi - + ax_blas_ok=yes;BLAS_LIBS="-lmkl_intel_lp64 -lmkl_sequential -lmkl_core -lpthread" fi -# ia64-hp-hpux11.22 BLAS library? -if test $acx_blas_ok = no; then - as_ac_Lib=`printf "%s\n" "ac_cv_lib_veclib_$sgemm" | $as_tr_sh` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $sgemm in -lveclib" >&5 -printf %s "checking for $sgemm in -lveclib... " >&6; } + # 32-bit + elif test $host_cpu = i686; then + as_ac_Lib=`printf "%s\n" "ac_cv_lib_mkl_intel_$sgemm" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $sgemm in -lmkl_intel" >&5 +printf %s "checking for $sgemm in -lmkl_intel... " >&6; } if eval test \${$as_ac_Lib+y} then : printf %s "(cached) " >&6 else $as_nop ac_check_lib_save_LIBS=$LIBS -LIBS="-lveclib $LIBS" +LIBS="-lmkl_intel -lmkl_intel -lmkl_sequential -lmkl_core -lpthread $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -7821,14 +7600,6 @@ namespace conftest { # endif int F77_DUMMY_MAIN() { return 1; } -#endif -#ifdef FC_DUMMY_MAIN -#ifndef FC_DUMMY_MAIN_EQ_F77 -# ifdef __cplusplus - extern "C" -# endif - int FC_DUMMY_MAIN() { return 1; } -#endif #endif int main (void) @@ -7853,24 +7624,23 @@ eval ac_res=\$$as_ac_Lib printf "%s\n" "$ac_res" >&6; } if eval test \"x\$"$as_ac_Lib"\" = x"yes" then : - acx_blas_ok=yes; acx_blas_libs="-lveclib8" + ax_blas_ok=yes;BLAS_LIBS="-lmkl_intel -lmkl_sequential -lmkl_core -lpthread" fi + fi + fi fi - -# BLAS in PhiPACK libraries? (requires generic BLAS lib, too) -if test $acx_blas_ok = no; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: trying PhiPACK:" >&5 -printf "%s\n" "$as_me: trying PhiPACK:" >&6;} - as_ac_Lib=`printf "%s\n" "ac_cv_lib_blas_$sgemm" | $as_tr_sh` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $sgemm in -lblas" >&5 -printf %s "checking for $sgemm in -lblas... " >&6; } +# Old versions of MKL +if test $ax_blas_ok = no; then + as_ac_Lib=`printf "%s\n" "ac_cv_lib_mkl_$sgemm" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $sgemm in -lmkl" >&5 +printf %s "checking for $sgemm in -lmkl... " >&6; } if eval test \${$as_ac_Lib+y} then : printf %s "(cached) " >&6 else $as_nop ac_check_lib_save_LIBS=$LIBS -LIBS="-lblas $LIBS" +LIBS="-lmkl -lguide -lpthread $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -7884,14 +7654,6 @@ namespace conftest { # endif int F77_DUMMY_MAIN() { return 1; } -#endif -#ifdef FC_DUMMY_MAIN -#ifndef FC_DUMMY_MAIN_EQ_F77 -# ifdef __cplusplus - extern "C" -# endif - int FC_DUMMY_MAIN() { return 1; } -#endif #endif int main (void) @@ -7916,68 +7678,17 @@ eval ac_res=\$$as_ac_Lib printf "%s\n" "$ac_res" >&6; } if eval test \"x\$"$as_ac_Lib"\" = x"yes" then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dgemm in -ldgemm" >&5 -printf %s "checking for dgemm in -ldgemm... " >&6; } -if test ${ac_cv_lib_dgemm_dgemm+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldgemm -lblas $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -namespace conftest { - extern "C" int dgemm (); -} -#ifdef F77_DUMMY_MAIN - -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } - -#endif -#ifdef FC_DUMMY_MAIN -#ifndef FC_DUMMY_MAIN_EQ_F77 -# ifdef __cplusplus - extern "C" -# endif - int FC_DUMMY_MAIN() { return 1; } -#endif -#endif -int -main (void) -{ -return conftest::dgemm (); - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_link "$LINENO" -then : - ac_cv_lib_dgemm_dgemm=yes -else $as_nop - ac_cv_lib_dgemm_dgemm=no + ax_blas_ok=yes;BLAS_LIBS="-lmkl -lguide -lpthread" fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS + fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dgemm_dgemm" >&5 -printf "%s\n" "$ac_cv_lib_dgemm_dgemm" >&6; } -if test "x$ac_cv_lib_dgemm_dgemm" = xyes -then : - as_ac_Lib=`printf "%s\n" "ac_cv_lib_sgemm_$sgemm" | $as_tr_sh` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $sgemm in -lsgemm" >&5 -printf %s "checking for $sgemm in -lsgemm... " >&6; } -if eval test \${$as_ac_Lib+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS -LIBS="-lsgemm -lblas $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext + +# BLAS in Apple vecLib library? +if test $ax_blas_ok = no; then + save_LIBS="$LIBS"; LIBS="-framework Accelerate $LIBS" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $sgemm in -framework Accelerate" >&5 +printf %s "checking for $sgemm in -framework Accelerate... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ namespace conftest { @@ -7990,14 +7701,6 @@ namespace conftest { # endif int F77_DUMMY_MAIN() { return 1; } -#endif -#ifdef FC_DUMMY_MAIN -#ifndef FC_DUMMY_MAIN_EQ_F77 -# ifdef __cplusplus - extern "C" -# endif - int FC_DUMMY_MAIN() { return 1; } -#endif #endif int main (void) @@ -8009,33 +7712,17 @@ return conftest::$sgemm (); _ACEOF if ac_fn_cxx_try_link "$LINENO" then : - eval "$as_ac_Lib=yes" -else $as_nop - eval "$as_ac_Lib=no" + ax_blas_ok=yes;BLAS_LIBS="-framework Accelerate" fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -eval ac_res=\$$as_ac_Lib - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } -if eval test \"x\$"$as_ac_Lib"\" = x"yes" -then : - acx_blas_ok=yes; acx_blas_libs="-lsgemm -ldgemm -lblas" -fi - -fi - - -fi - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: PhiPACK... $acx_blas_ok" >&5 -printf "%s\n" "$as_me: PhiPACK... $acx_blas_ok" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_blas_ok" >&5 +printf "%s\n" "$ax_blas_ok" >&6; } + LIBS="$save_LIBS" fi # BLAS in Alpha CXML library? -if test $acx_blas_ok = no; then +if test $ax_blas_ok = no; then as_ac_Lib=`printf "%s\n" "ac_cv_lib_cxml_$sgemm" | $as_tr_sh` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $sgemm in -lcxml" >&5 printf %s "checking for $sgemm in -lcxml... " >&6; } @@ -8058,14 +7745,6 @@ namespace conftest { # endif int F77_DUMMY_MAIN() { return 1; } -#endif -#ifdef FC_DUMMY_MAIN -#ifndef FC_DUMMY_MAIN_EQ_F77 -# ifdef __cplusplus - extern "C" -# endif - int FC_DUMMY_MAIN() { return 1; } -#endif #endif int main (void) @@ -8090,13 +7769,13 @@ eval ac_res=\$$as_ac_Lib printf "%s\n" "$ac_res" >&6; } if eval test \"x\$"$as_ac_Lib"\" = x"yes" then : - acx_blas_ok=yes;acx_blas_libs="-lcxml" + ax_blas_ok=yes;BLAS_LIBS="-lcxml" fi fi # BLAS in Alpha DXML library? (now called CXML, see above) -if test $acx_blas_ok = no; then +if test $ax_blas_ok = no; then as_ac_Lib=`printf "%s\n" "ac_cv_lib_dxml_$sgemm" | $as_tr_sh` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $sgemm in -ldxml" >&5 printf %s "checking for $sgemm in -ldxml... " >&6; } @@ -8119,14 +7798,6 @@ namespace conftest { # endif int F77_DUMMY_MAIN() { return 1; } -#endif -#ifdef FC_DUMMY_MAIN -#ifndef FC_DUMMY_MAIN_EQ_F77 -# ifdef __cplusplus - extern "C" -# endif - int FC_DUMMY_MAIN() { return 1; } -#endif #endif int main (void) @@ -8151,13 +7822,13 @@ eval ac_res=\$$as_ac_Lib printf "%s\n" "$ac_res" >&6; } if eval test \"x\$"$as_ac_Lib"\" = x"yes" then : - acx_blas_ok=yes;acx_blas_libs="-ldxml" + ax_blas_ok=yes;BLAS_LIBS="-ldxml" fi 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for acosp in -lsunmath" >&5 printf %s "checking for acosp in -lsunmath... " >&6; } @@ -8180,14 +7851,6 @@ namespace conftest { # endif int F77_DUMMY_MAIN() { return 1; } -#endif -#ifdef FC_DUMMY_MAIN -#ifndef FC_DUMMY_MAIN_EQ_F77 -# ifdef __cplusplus - extern "C" -# endif - int FC_DUMMY_MAIN() { return 1; } -#endif #endif int main (void) @@ -8233,14 +7896,6 @@ namespace conftest { # endif int F77_DUMMY_MAIN() { return 1; } -#endif -#ifdef FC_DUMMY_MAIN -#ifndef FC_DUMMY_MAIN_EQ_F77 -# ifdef __cplusplus - extern "C" -# endif - int FC_DUMMY_MAIN() { return 1; } -#endif #endif int main (void) @@ -8265,18 +7920,17 @@ eval ac_res=\$$as_ac_Lib printf "%s\n" "$ac_res" >&6; } if eval test \"x\$"$as_ac_Lib"\" = x"yes" then : - acx_blas_libs="-xlic_lib=sunperf -lsunmath" - acx_blas_ok=yes + BLAS_LIBS="-xlic_lib=sunperf -lsunmath" + ax_blas_ok=yes fi - fi fi fi # BLAS in SCSL library? (SGI/Cray Scientific Library) -if test $acx_blas_ok = no; then +if test $ax_blas_ok = no; then as_ac_Lib=`printf "%s\n" "ac_cv_lib_scs_$sgemm" | $as_tr_sh` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $sgemm in -lscs" >&5 printf %s "checking for $sgemm in -lscs... " >&6; } @@ -8299,14 +7953,6 @@ namespace conftest { # endif int F77_DUMMY_MAIN() { return 1; } -#endif -#ifdef FC_DUMMY_MAIN -#ifndef FC_DUMMY_MAIN_EQ_F77 -# ifdef __cplusplus - extern "C" -# endif - int FC_DUMMY_MAIN() { return 1; } -#endif #endif int main (void) @@ -8331,13 +7977,13 @@ eval ac_res=\$$as_ac_Lib printf "%s\n" "$ac_res" >&6; } if eval test \"x\$"$as_ac_Lib"\" = x"yes" then : - acx_blas_ok=yes; acx_blas_libs="-lscs" + ax_blas_ok=yes; BLAS_LIBS="-lscs" fi fi # BLAS in SGIMATH library? -if test $acx_blas_ok = no; then +if test $ax_blas_ok = no; then as_ac_Lib=`printf "%s\n" "ac_cv_lib_complib.sgimath_$sgemm" | $as_tr_sh` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $sgemm in -lcomplib.sgimath" >&5 printf %s "checking for $sgemm in -lcomplib.sgimath... " >&6; } @@ -8360,14 +8006,6 @@ namespace conftest { # endif int F77_DUMMY_MAIN() { return 1; } -#endif -#ifdef FC_DUMMY_MAIN -#ifndef FC_DUMMY_MAIN_EQ_F77 -# ifdef __cplusplus - extern "C" -# endif - int FC_DUMMY_MAIN() { return 1; } -#endif #endif int main (void) @@ -8392,16 +8030,13 @@ eval ac_res=\$$as_ac_Lib printf "%s\n" "$ac_res" >&6; } if eval test \"x\$"$as_ac_Lib"\" = x"yes" then : - acx_blas_ok=yes; acx_blas_libs="-lcomplib.sgimath" + ax_blas_ok=yes; BLAS_LIBS="-lcomplib.sgimath" fi fi # BLAS in IBM ESSL library? (requires generic BLAS lib, too) -if test $acx_blas_ok = no; then - unset ac_cv_lib_blas_sgemm - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: trying IBM ESSL:" >&5 -printf "%s\n" "$as_me: trying IBM ESSL:" >&6;} +if test $ax_blas_ok = no; then as_ac_Lib=`printf "%s\n" "ac_cv_lib_blas_$sgemm" | $as_tr_sh` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $sgemm in -lblas" >&5 printf %s "checking for $sgemm in -lblas... " >&6; } @@ -8424,14 +8059,6 @@ namespace conftest { # endif int F77_DUMMY_MAIN() { return 1; } -#endif -#ifdef FC_DUMMY_MAIN -#ifndef FC_DUMMY_MAIN_EQ_F77 -# ifdef __cplusplus - extern "C" -# endif - int FC_DUMMY_MAIN() { return 1; } -#endif #endif int main (void) @@ -8464,7 +8091,7 @@ then : printf %s "(cached) " >&6 else $as_nop ac_check_lib_save_LIBS=$LIBS -LIBS="-lessl -lblas $LIBS" +LIBS="-lessl -lblas $FLIBS $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -8478,14 +8105,6 @@ namespace conftest { # endif int F77_DUMMY_MAIN() { return 1; } -#endif -#ifdef FC_DUMMY_MAIN -#ifndef FC_DUMMY_MAIN_EQ_F77 -# ifdef __cplusplus - extern "C" -# endif - int FC_DUMMY_MAIN() { return 1; } -#endif #endif int main (void) @@ -8510,19 +8129,15 @@ eval ac_res=\$$as_ac_Lib printf "%s\n" "$ac_res" >&6; } if eval test \"x\$"$as_ac_Lib"\" = x"yes" then : - acx_blas_ok=yes; acx_blas_libs="-lessl -lblas" + ax_blas_ok=yes; BLAS_LIBS="-lessl -lblas" fi - fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: IBM ESSL... $acx_blas_ok" >&5 -printf "%s\n" "$as_me: IBM ESSL... $acx_blas_ok" >&6;} fi # Generic BLAS library? -if test $acx_blas_ok = no; then - unset ac_cv_lib_blas_sgemm +if test $ax_blas_ok = no; then as_ac_Lib=`printf "%s\n" "ac_cv_lib_blas_$sgemm" | $as_tr_sh` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $sgemm in -lblas" >&5 printf %s "checking for $sgemm in -lblas... " >&6; } @@ -8545,14 +8160,6 @@ namespace conftest { # endif int F77_DUMMY_MAIN() { return 1; } -#endif -#ifdef FC_DUMMY_MAIN -#ifndef FC_DUMMY_MAIN_EQ_F77 -# ifdef __cplusplus - extern "C" -# endif - int FC_DUMMY_MAIN() { return 1; } -#endif #endif int main (void) @@ -8577,28 +8184,41 @@ eval ac_res=\$$as_ac_Lib printf "%s\n" "$ac_res" >&6; } if eval test \"x\$"$as_ac_Lib"\" = x"yes" then : - acx_blas_ok=yes; acx_blas_libs="-lblas" + ax_blas_ok=yes; BLAS_LIBS="-lblas" fi fi -# blas on SGI/CRAY -if test $acx_blas_ok = no; then - unset ac_cv_lib_blas_sgemm - as_ac_Lib=`printf "%s\n" "ac_cv_lib_blas_$sgemm" | $as_tr_sh` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $sgemm in -lblas" >&5 -printf %s "checking for $sgemm in -lblas... " >&6; } -if eval test \${$as_ac_Lib+y} + + +LIBS="$ax_blas_save_LIBS" + +# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: +if test x"$ax_blas_ok" = xyes; then + found_blas="yes" + : +else + ax_blas_ok=no + found_blas="no" +fi + +elif test "$fcompiler" = "pgf90" + then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Appear to be using Portland Group compiler suite. Check if ACML is also available." >&5 +printf "%s\n" "$as_me: Appear to be using Portland Group compiler suite. Check if ACML is also available." >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dgesv in -lacml" >&5 +printf %s "checking for dgesv in -lacml... " >&6; } +if test ${ac_cv_lib_acml_dgesv+y} then : printf %s "(cached) " >&6 else $as_nop ac_check_lib_save_LIBS=$LIBS -LIBS="-lblas -lcraylibs $LIBS" +LIBS="-lacml $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ namespace conftest { - extern "C" int $sgemm (); + extern "C" int dgesv (); } #ifdef F77_DUMMY_MAIN @@ -8607,164 +8227,32 @@ namespace conftest { # endif int F77_DUMMY_MAIN() { return 1; } -#endif -#ifdef FC_DUMMY_MAIN -#ifndef FC_DUMMY_MAIN_EQ_F77 -# ifdef __cplusplus - extern "C" -# endif - int FC_DUMMY_MAIN() { return 1; } -#endif #endif int main (void) { -return conftest::$sgemm (); +return conftest::dgesv (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO" then : - eval "$as_ac_Lib=yes" + ac_cv_lib_acml_dgesv=yes else $as_nop - eval "$as_ac_Lib=no" + ac_cv_lib_acml_dgesv=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -eval ac_res=\$$as_ac_Lib - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } -if eval test \"x\$"$as_ac_Lib"\" = x"yes" +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_acml_dgesv" >&5 +printf "%s\n" "$ac_cv_lib_acml_dgesv" >&6; } +if test "x$ac_cv_lib_acml_dgesv" = xyes then : - acx_blas_ok=yes; acx_blas_libs="-lblas -lcraylibs" -fi - -fi - -# Check for vecLib framework (Darwin) -if test $acx_blas_ok = no; then - save_LIBS="$LIBS"; LIBS="-framework vecLib $LIBS" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $sgemm in vecLib" >&5 -printf %s "checking for $sgemm in vecLib... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -namespace conftest { - extern "C" int $sgemm (); -} -#ifdef F77_DUMMY_MAIN - -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } - -#endif -#ifdef FC_DUMMY_MAIN -#ifndef FC_DUMMY_MAIN_EQ_F77 -# ifdef __cplusplus - extern "C" -# endif - int FC_DUMMY_MAIN() { return 1; } -#endif -#endif -int -main (void) -{ -return conftest::$sgemm (); - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_link "$LINENO" -then : - acx_blas_ok=yes; acx_blas_libs="-framework vecLib" -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $acx_blas_ok" >&5 -printf "%s\n" "$acx_blas_ok" >&6; } - LIBS="$save_LIBS" -fi - -BLAS_LIBS="$acx_blas_libs" - - -LIBS="$acx_blas_save_LIBS" -LDFLAGS="$acx_blas_save_LDFLAGS $acx_blas_dir" - -test x"$acx_blas_ok" = xspecific && acx_blas_ok=yes -# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: -if test x"$acx_blas_ok" = xyes; then - found_blas="yes" - : -else - acx_blas_ok=no - found_blas="no" -fi - -elif test "$fcompiler" = "pgf90" - then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Appear to be using Portland Group compiler suite. Check if ACML is also available." >&5 -printf "%s\n" "$as_me: Appear to be using Portland Group compiler suite. Check if ACML is also available." >&6;} - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dgesv in -lacml" >&5 -printf %s "checking for dgesv in -lacml... " >&6; } -if test ${ac_cv_lib_acml_dgesv+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS -LIBS="-lacml $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -namespace conftest { - extern "C" int dgesv (); -} -#ifdef F77_DUMMY_MAIN - -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } - -#endif -#ifdef FC_DUMMY_MAIN -#ifndef FC_DUMMY_MAIN_EQ_F77 -# ifdef __cplusplus - extern "C" -# endif - int FC_DUMMY_MAIN() { return 1; } -#endif -#endif -int -main (void) -{ -return conftest::dgesv (); - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_link "$LINENO" -then : - ac_cv_lib_acml_dgesv=yes -else $as_nop - ac_cv_lib_acml_dgesv=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_acml_dgesv" >&5 -printf "%s\n" "$ac_cv_lib_acml_dgesv" >&6; } -if test "x$ac_cv_lib_acml_dgesv" = xyes -then : - found_blas=yes -else $as_nop - found_blas=no + found_blas=yes +else $as_nop + found_blas=no fi @@ -8794,14 +8282,6 @@ namespace conftest { # endif int F77_DUMMY_MAIN() { return 1; } -#endif -#ifdef FC_DUMMY_MAIN -#ifndef FC_DUMMY_MAIN_EQ_F77 -# ifdef __cplusplus - extern "C" -# endif - int FC_DUMMY_MAIN() { return 1; } -#endif #endif int main (void) @@ -8834,22 +8314,19 @@ fi if test "$found_blas" = "no" then - ac_ext=f -ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' -ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_f77_compiler_gnu + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking the position of the stars to help find a versions of BLAS" >&5 printf "%s\n" "$as_me: checking the position of the stars to help find a versions of BLAS" >&6;} -acx_blas_ok=no -acx_blas_save_LIBS="$LIBS" -acx_blas_save_LDFLAGS="$LDFLAGS" -acx_blas_save_FFLAGS="$FFLAGS" -acx_blas_libs="" -acx_blas_dir="" + +ax_blas_ok=no # Check whether --with-blas was given. @@ -8858,142 +8335,176 @@ then : withval=$with_blas; fi - case $with_blas in yes | "") ;; - no) acx_blas_ok=disable ;; - -l* | */* | *.a | *.so | *.so.* | *.o) acx_blas_libs="$with_blas" ;; - *) acx_blas_libs="-l$with_blas" ;; -esac - - -# Check whether --with-blas_dir was given. -if test ${with_blas_dir+y} -then : - withval=$with_blas_dir; -fi - - -case $with_blas_dir in - yes | no | "") ;; - -L*) LDFLAGS="$LDFLAGS $with_blas_dir" - acx_blas_dir="$with_blas_dir" ;; - *) LDFLAGS="$LDFLAGS -L$with_blas_dir" - acx_blas_dir="-L$with_blas_dir" ;; + no) ax_blas_ok=disable ;; + -* | */* | *.a | *.so | *.so.* | *.dylib | *.dylib.* | *.o) + BLAS_LIBS="$with_blas" + ;; + *) BLAS_LIBS="-l$with_blas" ;; esac -# Are we linking from C? -case "$ac_ext" in - f*|F*) sgemm="sgemm" ;; - *) - ac_ext=${ac_fc_srcext-f} -ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5' -ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_fc_compiler_gnu -case $ac_cv_fc_mangling in +# Get fortran linker names of BLAS functions to check for. +ac_ext=f +ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' +ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_f77_compiler_gnu +case $ac_cv_f77_mangling in upper*) ac_val="SGEMM" ;; lower*) ac_val="sgemm" ;; *) ac_val="unknown" ;; esac -case $ac_cv_fc_mangling in *," underscore"*) ac_val="$ac_val"_ ;; esac +case $ac_cv_f77_mangling in *," underscore"*) ac_val="$ac_val"_ ;; esac sgemm="$ac_val" +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + ac_ext=f ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_f77_compiler_gnu - - LIBS="$LIBS $FCLIBS" - ;; +case $ac_cv_f77_mangling in + upper*) ac_val="DGEMM" ;; + lower*) ac_val="dgemm" ;; + *) ac_val="unknown" ;; esac +case $ac_cv_f77_mangling in *," underscore"*) ac_val="$ac_val"_ ;; esac -# If --with-blas is defined, then look for THIS AND ONLY THIS blas lib -if test $acx_blas_ok = no; then -case $with_blas in - ""|yes) ;; - *) save_LIBS="$LIBS"; LIBS="$acx_blas_libs $LIBS" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $sgemm in $acx_blas_libs" >&5 -printf %s "checking for $sgemm in $acx_blas_libs... " >&6; } - cat > conftest.$ac_ext <<_ACEOF - program main - call $sgemm - end -_ACEOF -if ac_fn_f77_try_link "$LINENO" -then : - acx_blas_ok=yes -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $acx_blas_ok" >&5 -printf "%s\n" "$acx_blas_ok" >&6; } - LIBS="$save_LIBS" - acx_blas_ok=specific - ;; -esac -fi +dgemm="$ac_val" + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +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" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $sgemm in $BLAS_LIBS" >&5 printf %s "checking for $sgemm in $BLAS_LIBS... " >&6; } - cat > conftest.$ac_ext <<_ACEOF - program main - call $sgemm - end + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char $sgemm (); +#ifdef F77_DUMMY_MAIN + +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } + +#endif +int +main (void) +{ +return $sgemm (); + ; + return 0; +} _ACEOF -if ac_fn_f77_try_link "$LINENO" +if ac_fn_c_try_link "$LINENO" then : - acx_blas_ok=yes; acx_blas_libs=$BLAS_LIBS + ax_blas_ok=yes +else $as_nop + BLAS_LIBS="" fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $acx_blas_ok" >&5 -printf "%s\n" "$acx_blas_ok" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_blas_ok" >&5 +printf "%s\n" "$ax_blas_ok" >&6; } LIBS="$save_LIBS" fi fi # BLAS linked to by default? (happens on some supercomputers) -if test $acx_blas_ok = no; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for builtin $sgemm" >&5 -printf %s "checking for builtin $sgemm... " >&6; } - cat > conftest.$ac_ext <<_ACEOF - program main - call $sgemm - end +if test $ax_blas_ok = no; then + save_LIBS="$LIBS"; LIBS="$LIBS" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $sgemm is being linked in already" >&5 +printf %s "checking if $sgemm is being linked in already... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char $sgemm (); +#ifdef F77_DUMMY_MAIN + +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } + +#endif +int +main (void) +{ +return $sgemm (); + ; + return 0; +} _ACEOF -if ac_fn_f77_try_link "$LINENO" +if ac_fn_c_try_link "$LINENO" then : - acx_blas_ok=yes + ax_blas_ok=yes fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $acx_blas_ok" >&5 -printf "%s\n" "$acx_blas_ok" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_blas_ok" >&5 +printf "%s\n" "$ax_blas_ok" >&6; } + LIBS="$save_LIBS" fi -# Intel mkl BLAS. Unfortunately some of Intel's blas routines are -# in their lapack library... -if test $acx_blas_ok = no; then - as_ac_Lib=`printf "%s\n" "ac_cv_lib_mkl_def_$sgemm" | $as_tr_sh` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $sgemm in -lmkl_def" >&5 -printf %s "checking for $sgemm in -lmkl_def... " >&6; } +# BLAS linked to by flexiblas? (Default on FC33+ and RHEL9+) + +if test $ax_blas_ok = no; then + as_ac_Lib=`printf "%s\n" "ac_cv_lib_flexiblas_$sgemm" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $sgemm in -lflexiblas" >&5 +printf %s "checking for $sgemm in -lflexiblas... " >&6; } if eval test \${$as_ac_Lib+y} then : printf %s "(cached) " >&6 else $as_nop ac_check_lib_save_LIBS=$LIBS -LIBS="-lmkl_def -lm $LIBS" -cat > conftest.$ac_ext <<_ACEOF - program main - call $sgemm - end +LIBS="-lflexiblas $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char $sgemm (); +#ifdef F77_DUMMY_MAIN + +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } + +#endif +int +main (void) +{ +return $sgemm (); + ; + return 0; +} _ACEOF -if ac_fn_f77_try_link "$LINENO" +if ac_fn_c_try_link "$LINENO" then : eval "$as_ac_Lib=yes" else $as_nop @@ -9008,26 +8519,47 @@ eval ac_res=\$$as_ac_Lib printf "%s\n" "$ac_res" >&6; } if eval test \"x\$"$as_ac_Lib"\" = x"yes" then : - acx_blas_ok=yes; acx_blas_libs="-lmkl_def -lm" + ax_blas_ok=yes + BLAS_LIBS="-lflexiblas" fi fi -if test $acx_blas_ok = no; then - as_ac_Lib=`printf "%s\n" "ac_cv_lib_mkl_ipf_$sgemm" | $as_tr_sh` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $sgemm in -lmkl_ipf" >&5 -printf %s "checking for $sgemm in -lmkl_ipf... " >&6; } + +# BLAS in OpenBLAS library? (http://xianyi.github.com/OpenBLAS/) +if test $ax_blas_ok = no; then + as_ac_Lib=`printf "%s\n" "ac_cv_lib_openblas_$sgemm" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $sgemm in -lopenblas" >&5 +printf %s "checking for $sgemm in -lopenblas... " >&6; } if eval test \${$as_ac_Lib+y} then : printf %s "(cached) " >&6 else $as_nop ac_check_lib_save_LIBS=$LIBS -LIBS="-lmkl_ipf -lguide -lm $LIBS" -cat > conftest.$ac_ext <<_ACEOF - program main - call $sgemm - end +LIBS="-lopenblas $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char $sgemm (); +#ifdef F77_DUMMY_MAIN + +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } + +#endif +int +main (void) +{ +return $sgemm (); + ; + return 0; +} _ACEOF -if ac_fn_f77_try_link "$LINENO" +if ac_fn_c_try_link "$LINENO" then : eval "$as_ac_Lib=yes" else $as_nop @@ -9042,26 +8574,92 @@ eval ac_res=\$$as_ac_Lib printf "%s\n" "$ac_res" >&6; } if eval test \"x\$"$as_ac_Lib"\" = x"yes" then : - acx_blas_ok=yes; acx_blas_libs="-lmkl_ipf -lguide -lm" + ax_blas_ok=yes + BLAS_LIBS="-lopenblas" fi fi -if test $acx_blas_ok = no; then - as_ac_Lib=`printf "%s\n" "ac_cv_lib_mkl_em64t_$sgemm" | $as_tr_sh` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $sgemm in -lmkl_em64t" >&5 -printf %s "checking for $sgemm in -lmkl_em64t... " >&6; } -if eval test \${$as_ac_Lib+y} -then : + +# BLAS in ATLAS library? (http://math-atlas.sourceforge.net/) +if test $ax_blas_ok = no; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ATL_xerbla in -latlas" >&5 +printf %s "checking for ATL_xerbla in -latlas... " >&6; } +if test ${ac_cv_lib_atlas_ATL_xerbla+y} +then : printf %s "(cached) " >&6 else $as_nop ac_check_lib_save_LIBS=$LIBS -LIBS="-lmkl_em64t -lguide -liomp5 $LIBS" -cat > conftest.$ac_ext <<_ACEOF - program main - call $sgemm - end +LIBS="-latlas $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char ATL_xerbla (); +#ifdef F77_DUMMY_MAIN + +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } + +#endif +int +main (void) +{ +return ATL_xerbla (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_atlas_ATL_xerbla=yes +else $as_nop + ac_cv_lib_atlas_ATL_xerbla=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_atlas_ATL_xerbla" >&5 +printf "%s\n" "$ac_cv_lib_atlas_ATL_xerbla" >&6; } +if test "x$ac_cv_lib_atlas_ATL_xerbla" = xyes +then : + as_ac_Lib=`printf "%s\n" "ac_cv_lib_f77blas_$sgemm" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $sgemm in -lf77blas" >&5 +printf %s "checking for $sgemm in -lf77blas... " >&6; } +if eval test \${$as_ac_Lib+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-lf77blas -latlas $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char $sgemm (); +#ifdef F77_DUMMY_MAIN + +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } + +#endif +int +main (void) +{ +return $sgemm (); + ; + return 0; +} _ACEOF -if ac_fn_f77_try_link "$LINENO" +if ac_fn_c_try_link "$LINENO" then : eval "$as_ac_Lib=yes" else $as_nop @@ -9076,60 +8674,96 @@ eval ac_res=\$$as_ac_Lib printf "%s\n" "$ac_res" >&6; } if eval test \"x\$"$as_ac_Lib"\" = x"yes" then : - acx_blas_ok=yes; acx_blas_libs="-lmkl_em64t -lguide -liomp5" -fi - -fi -# check for older mkl -if test $acx_blas_ok = no; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: trying Intel MKL < 7:" >&5 -printf "%s\n" "$as_me: trying Intel MKL < 7:" >&6;} - unset ac_cv_lib_mkl_def_sgemm - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for lsame in -lmkl_lapack" >&5 -printf %s "checking for lsame in -lmkl_lapack... " >&6; } -if test ${ac_cv_lib_mkl_lapack_lsame+y} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for cblas_dgemm in -lcblas" >&5 +printf %s "checking for cblas_dgemm in -lcblas... " >&6; } +if test ${ac_cv_lib_cblas_cblas_dgemm+y} then : printf %s "(cached) " >&6 else $as_nop ac_check_lib_save_LIBS=$LIBS -LIBS="-lmkl_lapack $LIBS" -cat > conftest.$ac_ext <<_ACEOF - program main - call lsame - end +LIBS="-lcblas -lf77blas -latlas $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char cblas_dgemm (); +#ifdef F77_DUMMY_MAIN + +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } + +#endif +int +main (void) +{ +return cblas_dgemm (); + ; + return 0; +} _ACEOF -if ac_fn_f77_try_link "$LINENO" +if ac_fn_c_try_link "$LINENO" then : - ac_cv_lib_mkl_lapack_lsame=yes + ac_cv_lib_cblas_cblas_dgemm=yes else $as_nop - ac_cv_lib_mkl_lapack_lsame=no + ac_cv_lib_cblas_cblas_dgemm=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mkl_lapack_lsame" >&5 -printf "%s\n" "$ac_cv_lib_mkl_lapack_lsame" >&6; } -if test "x$ac_cv_lib_mkl_lapack_lsame" = xyes +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cblas_cblas_dgemm" >&5 +printf "%s\n" "$ac_cv_lib_cblas_cblas_dgemm" >&6; } +if test "x$ac_cv_lib_cblas_cblas_dgemm" = xyes then : + ax_blas_ok=yes + BLAS_LIBS="-lcblas -lf77blas -latlas" +fi + +fi + +fi + +fi - acx_lapack_ok=yes; - as_ac_Lib=`printf "%s\n" "ac_cv_lib_mkl_def_$sgemm" | $as_tr_sh` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $sgemm in -lmkl_def" >&5 -printf %s "checking for $sgemm in -lmkl_def... " >&6; } +# BLAS in PhiPACK libraries? (requires generic BLAS lib, too) +if test $ax_blas_ok = no; then + as_ac_Lib=`printf "%s\n" "ac_cv_lib_blas_$sgemm" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $sgemm in -lblas" >&5 +printf %s "checking for $sgemm in -lblas... " >&6; } if eval test \${$as_ac_Lib+y} then : printf %s "(cached) " >&6 else $as_nop ac_check_lib_save_LIBS=$LIBS -LIBS="-lmkl_def -lm -lpthread - $LIBS" -cat > conftest.$ac_ext <<_ACEOF - program main - call $sgemm - end +LIBS="-lblas $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char $sgemm (); +#ifdef F77_DUMMY_MAIN + +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } + +#endif +int +main (void) +{ +return $sgemm (); + ; + return 0; +} _ACEOF -if ac_fn_f77_try_link "$LINENO" +if ac_fn_c_try_link "$LINENO" then : eval "$as_ac_Lib=yes" else $as_nop @@ -9144,34 +8778,39 @@ eval ac_res=\$$as_ac_Lib printf "%s\n" "$ac_res" >&6; } if eval test \"x\$"$as_ac_Lib"\" = x"yes" then : - acx_blas_ok=yes; - acx_blas_libs="-lmkl_def -lmkl_lapack -lm -lpthread" -fi - - -fi - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Intel MKL < 7... $acx_blas_ok" >&5 -printf "%s\n" "$as_me: Intel MKL < 7... $acx_blas_ok" >&6;} -fi - -# BLAS in ACML (pgi) -if test $acx_blas_ok = no; then - as_ac_Lib=`printf "%s\n" "ac_cv_lib_acml_$sgemm" | $as_tr_sh` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $sgemm in -lacml" >&5 -printf %s "checking for $sgemm in -lacml... " >&6; } + as_ac_Lib=`printf "%s\n" "ac_cv_lib_dgemm_$dgemm" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $dgemm in -ldgemm" >&5 +printf %s "checking for $dgemm in -ldgemm... " >&6; } if eval test \${$as_ac_Lib+y} then : printf %s "(cached) " >&6 else $as_nop ac_check_lib_save_LIBS=$LIBS -LIBS="-lacml $LIBS" -cat > conftest.$ac_ext <<_ACEOF - program main - call $sgemm - end +LIBS="-ldgemm -lblas $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char $dgemm (); +#ifdef F77_DUMMY_MAIN + +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } + +#endif +int +main (void) +{ +return $dgemm (); + ; + return 0; +} _ACEOF -if ac_fn_f77_try_link "$LINENO" +if ac_fn_c_try_link "$LINENO" then : eval "$as_ac_Lib=yes" else $as_nop @@ -9186,28 +8825,39 @@ eval ac_res=\$$as_ac_Lib printf "%s\n" "$ac_res" >&6; } if eval test \"x\$"$as_ac_Lib"\" = x"yes" then : - acx_blas_ok=yes; acx_blas_libs="-lacml" -fi - -fi - -# BLAS in ATLAS library? (http://math-atlas.sourceforge.net/) -if test $acx_blas_ok = no; then - as_ac_Lib=`printf "%s\n" "ac_cv_lib_f77blas_$sgemm" | $as_tr_sh` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $sgemm in -lf77blas" >&5 -printf %s "checking for $sgemm in -lf77blas... " >&6; } + as_ac_Lib=`printf "%s\n" "ac_cv_lib_sgemm_$sgemm" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $sgemm in -lsgemm" >&5 +printf %s "checking for $sgemm in -lsgemm... " >&6; } if eval test \${$as_ac_Lib+y} then : printf %s "(cached) " >&6 else $as_nop ac_check_lib_save_LIBS=$LIBS -LIBS="-lf77blas -latlas $LIBS" -cat > conftest.$ac_ext <<_ACEOF - program main - call $sgemm - end +LIBS="-lsgemm -lblas $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char $sgemm (); +#ifdef F77_DUMMY_MAIN + +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } + +#endif +int +main (void) +{ +return $sgemm (); + ; + return 0; +} _ACEOF -if ac_fn_f77_try_link "$LINENO" +if ac_fn_c_try_link "$LINENO" then : eval "$as_ac_Lib=yes" else $as_nop @@ -9222,28 +8872,54 @@ eval ac_res=\$$as_ac_Lib printf "%s\n" "$ac_res" >&6; } if eval test \"x\$"$as_ac_Lib"\" = x"yes" then : - acx_blas_ok=yes; acx_blas_libs="-lf77blas -latlas" + ax_blas_ok=yes; BLAS_LIBS="-lsgemm -ldgemm -lblas" +fi + +fi + fi fi -# ia64-hp-hpux11.22 BLAS library? -if test $acx_blas_ok = no; then - as_ac_Lib=`printf "%s\n" "ac_cv_lib_veclib_$sgemm" | $as_tr_sh` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $sgemm in -lveclib" >&5 -printf %s "checking for $sgemm in -lveclib... " >&6; } +# BLAS in Intel MKL library? +if test $ax_blas_ok = no; then + # MKL for gfortran + if test x"$ac_cv_fc_compiler_gnu" = xyes; then + # 64 bit + if test $host_cpu = x86_64; then + as_ac_Lib=`printf "%s\n" "ac_cv_lib_mkl_gf_lp64_$sgemm" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $sgemm in -lmkl_gf_lp64" >&5 +printf %s "checking for $sgemm in -lmkl_gf_lp64... " >&6; } if eval test \${$as_ac_Lib+y} then : printf %s "(cached) " >&6 else $as_nop ac_check_lib_save_LIBS=$LIBS -LIBS="-lveclib $LIBS" -cat > conftest.$ac_ext <<_ACEOF - program main - call $sgemm - end +LIBS="-lmkl_gf_lp64 -lmkl_gf_lp64 -lmkl_sequential -lmkl_core -lpthread $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char $sgemm (); +#ifdef F77_DUMMY_MAIN + +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } + +#endif +int +main (void) +{ +return $sgemm (); + ; + return 0; +} _ACEOF -if ac_fn_f77_try_link "$LINENO" +if ac_fn_c_try_link "$LINENO" then : eval "$as_ac_Lib=yes" else $as_nop @@ -9258,30 +8934,44 @@ eval ac_res=\$$as_ac_Lib printf "%s\n" "$ac_res" >&6; } if eval test \"x\$"$as_ac_Lib"\" = x"yes" then : - acx_blas_ok=yes; acx_blas_libs="-lveclib8" -fi - + ax_blas_ok=yes;BLAS_LIBS="-lmkl_gf_lp64 -lmkl_sequential -lmkl_core -lpthread" fi -# BLAS in PhiPACK libraries? (requires generic BLAS lib, too) -if test $acx_blas_ok = no; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: trying PhiPACK:" >&5 -printf "%s\n" "$as_me: trying PhiPACK:" >&6;} - as_ac_Lib=`printf "%s\n" "ac_cv_lib_blas_$sgemm" | $as_tr_sh` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $sgemm in -lblas" >&5 -printf %s "checking for $sgemm in -lblas... " >&6; } + # 32 bit + elif test $host_cpu = i686; then + as_ac_Lib=`printf "%s\n" "ac_cv_lib_mkl_gf_$sgemm" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $sgemm in -lmkl_gf" >&5 +printf %s "checking for $sgemm in -lmkl_gf... " >&6; } if eval test \${$as_ac_Lib+y} then : printf %s "(cached) " >&6 else $as_nop ac_check_lib_save_LIBS=$LIBS -LIBS="-lblas $LIBS" -cat > conftest.$ac_ext <<_ACEOF - program main - call $sgemm - end +LIBS="-lmkl_gf -lmkl_gf -lmkl_sequential -lmkl_core -lpthread $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char $sgemm (); +#ifdef F77_DUMMY_MAIN + +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } + +#endif +int +main (void) +{ +return $sgemm (); + ; + return 0; +} _ACEOF -if ac_fn_f77_try_link "$LINENO" +if ac_fn_c_try_link "$LINENO" then : eval "$as_ac_Lib=yes" else $as_nop @@ -9296,48 +8986,99 @@ eval ac_res=\$$as_ac_Lib printf "%s\n" "$ac_res" >&6; } if eval test \"x\$"$as_ac_Lib"\" = x"yes" then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dgemm in -ldgemm" >&5 -printf %s "checking for dgemm in -ldgemm... " >&6; } -if test ${ac_cv_lib_dgemm_dgemm+y} + ax_blas_ok=yes;BLAS_LIBS="-lmkl_gf -lmkl_sequential -lmkl_core -lpthread" +fi + + fi + # MKL for other compilers (Intel, PGI, ...?) + else + # 64-bit + if test $host_cpu = x86_64; then + as_ac_Lib=`printf "%s\n" "ac_cv_lib_mkl_intel_lp64_$sgemm" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $sgemm in -lmkl_intel_lp64" >&5 +printf %s "checking for $sgemm in -lmkl_intel_lp64... " >&6; } +if eval test \${$as_ac_Lib+y} then : printf %s "(cached) " >&6 else $as_nop ac_check_lib_save_LIBS=$LIBS -LIBS="-ldgemm -lblas $LIBS" -cat > conftest.$ac_ext <<_ACEOF - program main - call dgemm - end +LIBS="-lmkl_intel_lp64 -lmkl_intel_lp64 -lmkl_sequential -lmkl_core -lpthread $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char $sgemm (); +#ifdef F77_DUMMY_MAIN + +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } + +#endif +int +main (void) +{ +return $sgemm (); + ; + return 0; +} _ACEOF -if ac_fn_f77_try_link "$LINENO" +if ac_fn_c_try_link "$LINENO" then : - ac_cv_lib_dgemm_dgemm=yes + eval "$as_ac_Lib=yes" else $as_nop - ac_cv_lib_dgemm_dgemm=no + eval "$as_ac_Lib=no" fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dgemm_dgemm" >&5 -printf "%s\n" "$ac_cv_lib_dgemm_dgemm" >&6; } -if test "x$ac_cv_lib_dgemm_dgemm" = xyes +eval ac_res=\$$as_ac_Lib + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_ac_Lib"\" = x"yes" then : - as_ac_Lib=`printf "%s\n" "ac_cv_lib_sgemm_$sgemm" | $as_tr_sh` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $sgemm in -lsgemm" >&5 -printf %s "checking for $sgemm in -lsgemm... " >&6; } + ax_blas_ok=yes;BLAS_LIBS="-lmkl_intel_lp64 -lmkl_sequential -lmkl_core -lpthread" +fi + + # 32-bit + elif test $host_cpu = i686; then + as_ac_Lib=`printf "%s\n" "ac_cv_lib_mkl_intel_$sgemm" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $sgemm in -lmkl_intel" >&5 +printf %s "checking for $sgemm in -lmkl_intel... " >&6; } if eval test \${$as_ac_Lib+y} then : printf %s "(cached) " >&6 else $as_nop ac_check_lib_save_LIBS=$LIBS -LIBS="-lsgemm -lblas $LIBS" -cat > conftest.$ac_ext <<_ACEOF - program main - call $sgemm - end +LIBS="-lmkl_intel -lmkl_intel -lmkl_sequential -lmkl_core -lpthread $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char $sgemm (); +#ifdef F77_DUMMY_MAIN + +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } + +#endif +int +main (void) +{ +return $sgemm (); + ; + return 0; +} _ACEOF -if ac_fn_f77_try_link "$LINENO" +if ac_fn_c_try_link "$LINENO" then : eval "$as_ac_Lib=yes" else $as_nop @@ -9352,20 +9093,107 @@ eval ac_res=\$$as_ac_Lib printf "%s\n" "$ac_res" >&6; } if eval test \"x\$"$as_ac_Lib"\" = x"yes" then : - acx_blas_ok=yes; acx_blas_libs="-lsgemm -ldgemm -lblas" + ax_blas_ok=yes;BLAS_LIBS="-lmkl_intel -lmkl_sequential -lmkl_core -lpthread" fi + fi + fi fi +# Old versions of MKL +if test $ax_blas_ok = no; then + as_ac_Lib=`printf "%s\n" "ac_cv_lib_mkl_$sgemm" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $sgemm in -lmkl" >&5 +printf %s "checking for $sgemm in -lmkl... " >&6; } +if eval test \${$as_ac_Lib+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-lmkl -lguide -lpthread $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char $sgemm (); +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main (void) +{ +return $sgemm (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + eval "$as_ac_Lib=yes" +else $as_nop + eval "$as_ac_Lib=no" fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +eval ac_res=\$$as_ac_Lib + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_ac_Lib"\" = x"yes" +then : + ax_blas_ok=yes;BLAS_LIBS="-lmkl -lguide -lpthread" +fi + +fi + +# BLAS in Apple vecLib library? +if test $ax_blas_ok = no; then + save_LIBS="$LIBS"; LIBS="-framework Accelerate $LIBS" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $sgemm in -framework Accelerate" >&5 +printf %s "checking for $sgemm in -framework Accelerate... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: PhiPACK... $acx_blas_ok" >&5 -printf "%s\n" "$as_me: PhiPACK... $acx_blas_ok" >&6;} +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char $sgemm (); +#ifdef F77_DUMMY_MAIN + +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } + +#endif +int +main (void) +{ +return $sgemm (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ax_blas_ok=yes;BLAS_LIBS="-framework Accelerate" +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_blas_ok" >&5 +printf "%s\n" "$ax_blas_ok" >&6; } + LIBS="$save_LIBS" fi # BLAS in Alpha CXML library? -if test $acx_blas_ok = no; then +if test $ax_blas_ok = no; then as_ac_Lib=`printf "%s\n" "ac_cv_lib_cxml_$sgemm" | $as_tr_sh` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $sgemm in -lcxml" >&5 printf %s "checking for $sgemm in -lcxml... " >&6; } @@ -9375,12 +9203,30 @@ then : else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcxml $LIBS" -cat > conftest.$ac_ext <<_ACEOF - program main - call $sgemm - end +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char $sgemm (); +#ifdef F77_DUMMY_MAIN + +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } + +#endif +int +main (void) +{ +return $sgemm (); + ; + return 0; +} _ACEOF -if ac_fn_f77_try_link "$LINENO" +if ac_fn_c_try_link "$LINENO" then : eval "$as_ac_Lib=yes" else $as_nop @@ -9395,13 +9241,13 @@ eval ac_res=\$$as_ac_Lib printf "%s\n" "$ac_res" >&6; } if eval test \"x\$"$as_ac_Lib"\" = x"yes" then : - acx_blas_ok=yes;acx_blas_libs="-lcxml" + ax_blas_ok=yes;BLAS_LIBS="-lcxml" fi fi # BLAS in Alpha DXML library? (now called CXML, see above) -if test $acx_blas_ok = no; then +if test $ax_blas_ok = no; then as_ac_Lib=`printf "%s\n" "ac_cv_lib_dxml_$sgemm" | $as_tr_sh` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $sgemm in -ldxml" >&5 printf %s "checking for $sgemm in -ldxml... " >&6; } @@ -9411,12 +9257,30 @@ then : else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-ldxml $LIBS" -cat > conftest.$ac_ext <<_ACEOF - program main - call $sgemm - end +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char $sgemm (); +#ifdef F77_DUMMY_MAIN + +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } + +#endif +int +main (void) +{ +return $sgemm (); + ; + return 0; +} _ACEOF -if ac_fn_f77_try_link "$LINENO" +if ac_fn_c_try_link "$LINENO" then : eval "$as_ac_Lib=yes" else $as_nop @@ -9431,13 +9295,13 @@ eval ac_res=\$$as_ac_Lib printf "%s\n" "$ac_res" >&6; } if eval test \"x\$"$as_ac_Lib"\" = x"yes" then : - acx_blas_ok=yes;acx_blas_libs="-ldxml" + ax_blas_ok=yes;BLAS_LIBS="-ldxml" fi 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for acosp in -lsunmath" >&5 printf %s "checking for acosp in -lsunmath... " >&6; } @@ -9447,12 +9311,30 @@ then : else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lsunmath $LIBS" -cat > conftest.$ac_ext <<_ACEOF - program main - call acosp - end +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char acosp (); +#ifdef F77_DUMMY_MAIN + +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } + +#endif +int +main (void) +{ +return acosp (); + ; + return 0; +} _ACEOF -if ac_fn_f77_try_link "$LINENO" +if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_sunmath_acosp=yes else $as_nop @@ -9475,12 +9357,30 @@ then : else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lsunperf -lsunmath $LIBS" -cat > conftest.$ac_ext <<_ACEOF - program main - call $sgemm - end +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char $sgemm (); +#ifdef F77_DUMMY_MAIN + +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } + +#endif +int +main (void) +{ +return $sgemm (); + ; + return 0; +} _ACEOF -if ac_fn_f77_try_link "$LINENO" +if ac_fn_c_try_link "$LINENO" then : eval "$as_ac_Lib=yes" else $as_nop @@ -9495,18 +9395,17 @@ eval ac_res=\$$as_ac_Lib printf "%s\n" "$ac_res" >&6; } if eval test \"x\$"$as_ac_Lib"\" = x"yes" then : - acx_blas_libs="-xlic_lib=sunperf -lsunmath" - acx_blas_ok=yes + BLAS_LIBS="-xlic_lib=sunperf -lsunmath" + ax_blas_ok=yes fi - fi fi fi # BLAS in SCSL library? (SGI/Cray Scientific Library) -if test $acx_blas_ok = no; then +if test $ax_blas_ok = no; then as_ac_Lib=`printf "%s\n" "ac_cv_lib_scs_$sgemm" | $as_tr_sh` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $sgemm in -lscs" >&5 printf %s "checking for $sgemm in -lscs... " >&6; } @@ -9516,12 +9415,30 @@ then : else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lscs $LIBS" -cat > conftest.$ac_ext <<_ACEOF - program main - call $sgemm - end +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char $sgemm (); +#ifdef F77_DUMMY_MAIN + +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } + +#endif +int +main (void) +{ +return $sgemm (); + ; + return 0; +} _ACEOF -if ac_fn_f77_try_link "$LINENO" +if ac_fn_c_try_link "$LINENO" then : eval "$as_ac_Lib=yes" else $as_nop @@ -9536,13 +9453,13 @@ eval ac_res=\$$as_ac_Lib printf "%s\n" "$ac_res" >&6; } if eval test \"x\$"$as_ac_Lib"\" = x"yes" then : - acx_blas_ok=yes; acx_blas_libs="-lscs" + ax_blas_ok=yes; BLAS_LIBS="-lscs" fi fi # BLAS in SGIMATH library? -if test $acx_blas_ok = no; then +if test $ax_blas_ok = no; then as_ac_Lib=`printf "%s\n" "ac_cv_lib_complib.sgimath_$sgemm" | $as_tr_sh` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $sgemm in -lcomplib.sgimath" >&5 printf %s "checking for $sgemm in -lcomplib.sgimath... " >&6; } @@ -9552,12 +9469,30 @@ then : else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcomplib.sgimath $LIBS" -cat > conftest.$ac_ext <<_ACEOF - program main - call $sgemm - end +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char $sgemm (); +#ifdef F77_DUMMY_MAIN + +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } + +#endif +int +main (void) +{ +return $sgemm (); + ; + return 0; +} _ACEOF -if ac_fn_f77_try_link "$LINENO" +if ac_fn_c_try_link "$LINENO" then : eval "$as_ac_Lib=yes" else $as_nop @@ -9572,16 +9507,13 @@ eval ac_res=\$$as_ac_Lib printf "%s\n" "$ac_res" >&6; } if eval test \"x\$"$as_ac_Lib"\" = x"yes" then : - acx_blas_ok=yes; acx_blas_libs="-lcomplib.sgimath" + ax_blas_ok=yes; BLAS_LIBS="-lcomplib.sgimath" fi fi # BLAS in IBM ESSL library? (requires generic BLAS lib, too) -if test $acx_blas_ok = no; then - unset ac_cv_lib_blas_sgemm - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: trying IBM ESSL:" >&5 -printf "%s\n" "$as_me: trying IBM ESSL:" >&6;} +if test $ax_blas_ok = no; then as_ac_Lib=`printf "%s\n" "ac_cv_lib_blas_$sgemm" | $as_tr_sh` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $sgemm in -lblas" >&5 printf %s "checking for $sgemm in -lblas... " >&6; } @@ -9591,83 +9523,30 @@ then : else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lblas $LIBS" -cat > conftest.$ac_ext <<_ACEOF - program main - call $sgemm - end -_ACEOF -if ac_fn_f77_try_link "$LINENO" -then : - eval "$as_ac_Lib=yes" -else $as_nop - eval "$as_ac_Lib=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -eval ac_res=\$$as_ac_Lib - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } -if eval test \"x\$"$as_ac_Lib"\" = x"yes" -then : - as_ac_Lib=`printf "%s\n" "ac_cv_lib_essl_$sgemm" | $as_tr_sh` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $sgemm in -lessl" >&5 -printf %s "checking for $sgemm in -lessl... " >&6; } -if eval test \${$as_ac_Lib+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS -LIBS="-lessl -lblas $LIBS" -cat > conftest.$ac_ext <<_ACEOF - program main - call $sgemm - end -_ACEOF -if ac_fn_f77_try_link "$LINENO" -then : - eval "$as_ac_Lib=yes" -else $as_nop - eval "$as_ac_Lib=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -eval ac_res=\$$as_ac_Lib - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } -if eval test \"x\$"$as_ac_Lib"\" = x"yes" -then : - acx_blas_ok=yes; acx_blas_libs="-lessl -lblas" -fi - +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -fi +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char $sgemm (); +#ifdef F77_DUMMY_MAIN - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: IBM ESSL... $acx_blas_ok" >&5 -printf "%s\n" "$as_me: IBM ESSL... $acx_blas_ok" >&6;} -fi +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } -# Generic BLAS library? -if test $acx_blas_ok = no; then - unset ac_cv_lib_blas_sgemm - as_ac_Lib=`printf "%s\n" "ac_cv_lib_blas_$sgemm" | $as_tr_sh` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $sgemm in -lblas" >&5 -printf %s "checking for $sgemm in -lblas... " >&6; } -if eval test \${$as_ac_Lib+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS -LIBS="-lblas $LIBS" -cat > conftest.$ac_ext <<_ACEOF - program main - call $sgemm - end +#endif +int +main (void) +{ +return $sgemm (); + ; + return 0; +} _ACEOF -if ac_fn_f77_try_link "$LINENO" +if ac_fn_c_try_link "$LINENO" then : eval "$as_ac_Lib=yes" else $as_nop @@ -9682,234 +9561,39 @@ eval ac_res=\$$as_ac_Lib printf "%s\n" "$ac_res" >&6; } if eval test \"x\$"$as_ac_Lib"\" = x"yes" then : - acx_blas_ok=yes; acx_blas_libs="-lblas" -fi - -fi - -# blas on SGI/CRAY -if test $acx_blas_ok = no; then - unset ac_cv_lib_blas_sgemm - as_ac_Lib=`printf "%s\n" "ac_cv_lib_blas_$sgemm" | $as_tr_sh` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $sgemm in -lblas" >&5 -printf %s "checking for $sgemm in -lblas... " >&6; } + as_ac_Lib=`printf "%s\n" "ac_cv_lib_essl_$sgemm" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $sgemm in -lessl" >&5 +printf %s "checking for $sgemm in -lessl... " >&6; } if eval test \${$as_ac_Lib+y} then : printf %s "(cached) " >&6 else $as_nop ac_check_lib_save_LIBS=$LIBS -LIBS="-lblas -lcraylibs $LIBS" -cat > conftest.$ac_ext <<_ACEOF - program main - call $sgemm - end -_ACEOF -if ac_fn_f77_try_link "$LINENO" -then : - eval "$as_ac_Lib=yes" -else $as_nop - eval "$as_ac_Lib=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -eval ac_res=\$$as_ac_Lib - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } -if eval test \"x\$"$as_ac_Lib"\" = x"yes" -then : - acx_blas_ok=yes; acx_blas_libs="-lblas -lcraylibs" -fi - -fi - -# Check for vecLib framework (Darwin) -if test $acx_blas_ok = no; then - save_LIBS="$LIBS"; LIBS="-framework vecLib $LIBS" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $sgemm in vecLib" >&5 -printf %s "checking for $sgemm in vecLib... " >&6; } - cat > conftest.$ac_ext <<_ACEOF - program main - call $sgemm - end -_ACEOF -if ac_fn_f77_try_link "$LINENO" -then : - acx_blas_ok=yes; acx_blas_libs="-framework vecLib" -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $acx_blas_ok" >&5 -printf "%s\n" "$acx_blas_ok" >&6; } - LIBS="$save_LIBS" -fi - -BLAS_LIBS="$acx_blas_libs" - - -LIBS="$acx_blas_save_LIBS" -LDFLAGS="$acx_blas_save_LDFLAGS $acx_blas_dir" - -test x"$acx_blas_ok" = xspecific && acx_blas_ok=yes -# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: -if test x"$acx_blas_ok" = xyes; then - -printf "%s\n" "#define HAVE_BLAS 1" >>confdefs.h - - : -else - acx_blas_ok=no - as_fn_error $? "\"Cannot identify BLAS. Check that it is installed.\"" "$LINENO" 5 -fi - -fi -ac_ext=f -ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' -ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_f77_compiler_gnu - - - -acx_lapack_ok=no -acx_lapack_save_LIBS="$LIBS" -acx_lapack_save_LDFLAGS="$LDFLAGS" -acx_lapack_save_FFLAGS="$FFLAGS" -acx_lapack_libs="" -acx_lapack_dir="" - - -# Check whether --with-lapack was given. -if test ${with_lapack+y} -then : - withval=$with_lapack; -fi - - -case $with_lapack in - yes | "") ;; - no) acx_lapack_ok=disable ;; - -l* | */* | *.a | *.so | *.so.* | *.o) acx_lapack_libs="$with_lapack" ;; - *) acx_lapack_libs="-l$with_lapack" ;; -esac - - -# Check whether --with-lapack_dir was given. -if test ${with_lapack_dir+y} -then : - withval=$with_lapack_dir; -fi - - -case $with_lapack_dir in - yes | no | "") ;; - -L*) LDFLAGS="$LDFLAGS $with_lapack_dir" - acx_lapack_dir="$with_lapack_dir" ;; - *) LDFLAGS="$LDFLAGS -L$with_lapack_dir" - acx_lapack_dir="-L$with_lapack_dir" ;; -esac - -# We cannot use LAPACK if BLAS is not found -if test "x$acx_blas_ok" != xyes; then - acx_lapack_ok=noblas -fi - -# add BLAS to libs -LIBS="$BLAS_LIBS $LIBS" - -# Are we linking from C? -case "$ac_ext" in - f*|F*) dsyev="dsyev" ;; - *) - ac_ext=${ac_fc_srcext-f} -ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5' -ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_fc_compiler_gnu -case $ac_cv_fc_mangling in - upper*) ac_val="DSYEV" ;; - lower*) ac_val="dsyev" ;; - *) ac_val="unknown" ;; -esac -case $ac_cv_fc_mangling in *," underscore"*) ac_val="$ac_val"_ ;; esac - -dsyev="$ac_val" - -ac_ext=f -ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' -ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_f77_compiler_gnu - - LIBS="$LIBS $FCLIBS" - ;; -esac +LIBS="-lessl -lblas $FLIBS $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -# If --with-lapack is defined, then look for THIS AND ONLY THIS lapack lib -if test $acx_lapack_ok = no; then -case $with_lapack in - ""|yes) ;; - *) save_LIBS="$LIBS"; LIBS="$acx_lapack_libs $LIBS" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $dsyev in $acx_lapack_libs" >&5 -printf %s "checking for $dsyev in $acx_lapack_libs... " >&6; } - cat > conftest.$ac_ext <<_ACEOF - program main - call $dsyev - end -_ACEOF -if ac_fn_f77_try_link "$LINENO" -then : - acx_lapack_ok=yes -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $acx_lapack_ok" >&5 -printf "%s\n" "$acx_lapack_ok" >&6; } - LIBS="$save_LIBS" - acx_lapack_ok=yes - ;; -esac -fi +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char $sgemm (); +#ifdef F77_DUMMY_MAIN -# First, check LAPACK_LIBS environment variable -if test $acx_lapack_ok = no; then -if test "x$LAPACK_LIBS" != x; then - save_LIBS="$LIBS"; LIBS="$LAPACK_LIBS $LIBS" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $dsyev in $LAPACK_LIBS" >&5 -printf %s "checking for $dsyev in $LAPACK_LIBS... " >&6; } - cat > conftest.$ac_ext <<_ACEOF - program main - call $dsyev - end -_ACEOF -if ac_fn_f77_try_link "$LINENO" -then : - acx_lapack_ok=yes; - acx_lapack_libs=$LAPACK_LIBS -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $acx_lapack_ok" >&5 -printf "%s\n" "$acx_lapack_ok" >&6; } - LIBS="$save_LIBS" -fi -fi +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } -# Intel MKL LAPACK? -if test $acx_lapack_ok = no; then - as_ac_Lib=`printf "%s\n" "ac_cv_lib_mkl_lapack_$dsyev" | $as_tr_sh` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $dsyev in -lmkl_lapack" >&5 -printf %s "checking for $dsyev in -lmkl_lapack... " >&6; } -if eval test \${$as_ac_Lib+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS -LIBS="-lmkl_lapack $LIBS" -cat > conftest.$ac_ext <<_ACEOF - program main - call $dsyev - end +#endif +int +main (void) +{ +return $sgemm (); + ; + return 0; +} _ACEOF -if ac_fn_f77_try_link "$LINENO" +if ac_fn_c_try_link "$LINENO" then : eval "$as_ac_Lib=yes" else $as_nop @@ -9924,28 +9608,48 @@ eval ac_res=\$$as_ac_Lib printf "%s\n" "$ac_res" >&6; } if eval test \"x\$"$as_ac_Lib"\" = x"yes" then : - acx_lapack_ok=yes; acx_lapack_libs="-lmkl_lapack -lguide" + ax_blas_ok=yes; BLAS_LIBS="-lessl -lblas" +fi + fi fi -# Sun sunperf? -if test $acx_lapack_ok = no; then - as_ac_Lib=`printf "%s\n" "ac_cv_lib_sunperf_$dsyev" | $as_tr_sh` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $dsyev in -lsunperf" >&5 -printf %s "checking for $dsyev in -lsunperf... " >&6; } +# Generic BLAS library? +if test $ax_blas_ok = no; then + as_ac_Lib=`printf "%s\n" "ac_cv_lib_blas_$sgemm" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $sgemm in -lblas" >&5 +printf %s "checking for $sgemm in -lblas... " >&6; } if eval test \${$as_ac_Lib+y} then : printf %s "(cached) " >&6 else $as_nop ac_check_lib_save_LIBS=$LIBS -LIBS="-lsunperf $LIBS" -cat > conftest.$ac_ext <<_ACEOF - program main - call $dsyev - end +LIBS="-lblas $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char $sgemm (); +#ifdef F77_DUMMY_MAIN + +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } + +#endif +int +main (void) +{ +return $sgemm (); + ; + return 0; +} _ACEOF -if ac_fn_f77_try_link "$LINENO" +if ac_fn_c_try_link "$LINENO" then : eval "$as_ac_Lib=yes" else $as_nop @@ -9960,47 +9664,180 @@ eval ac_res=\$$as_ac_Lib printf "%s\n" "$ac_res" >&6; } if eval test \"x\$"$as_ac_Lib"\" = x"yes" then : - acx_lapack_ok=yes; acx_lapack_libs="-lsunperf" + ax_blas_ok=yes; BLAS_LIBS="-lblas" fi fi -# LAPACK linked to by default? (is sometimes included in BLAS lib) -if test $acx_lapack_ok = no; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $dsyev in BLAS library" >&5 -printf %s "checking for $dsyev in BLAS library... " >&6; } - cat > conftest.$ac_ext <<_ACEOF - program main - call $dsyev - end + + +LIBS="$ax_blas_save_LIBS" + +# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: +if test x"$ax_blas_ok" = xyes; then + +printf "%s\n" "#define HAVE_BLAS 1" >>confdefs.h + + : +else + ax_blas_ok=no + as_fn_error $? "\"Cannot identify BLAS. Check that it is installed.\"" "$LINENO" 5 +fi + + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + +ax_lapack_ok=no + + +# Check whether --with-lapack was given. +if test ${with_lapack+y} +then : + withval=$with_lapack; +fi + +case $with_lapack in + yes | "") ;; + no) ax_lapack_ok=disable ;; + -* | */* | *.a | *.so | *.so.* | *.dylib | *.dylib.* | *.o) + LAPACK_LIBS="$with_lapack" + ;; + *) LAPACK_LIBS="-l$with_lapack" ;; +esac + +# Get fortran linker name of LAPACK function to check for. +ac_ext=f +ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' +ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_f77_compiler_gnu +case $ac_cv_f77_mangling in + upper*) ac_val="CHEEV" ;; + lower*) ac_val="cheev" ;; + *) ac_val="unknown" ;; +esac +case $ac_cv_f77_mangling in *," underscore"*) ac_val="$ac_val"_ ;; esac + +cheev="$ac_val" + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +# We cannot use LAPACK if BLAS is not found +if test "x$ax_blas_ok" != xyes; then + ax_lapack_ok=noblas + LAPACK_LIBS="" +fi + +# First, check LAPACK_LIBS environment variable +if test "x$LAPACK_LIBS" != x; then + save_LIBS="$LIBS"; LIBS="$LAPACK_LIBS $BLAS_LIBS $LIBS $FLIBS" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $cheev in $LAPACK_LIBS" >&5 +printf %s "checking for $cheev in $LAPACK_LIBS... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char $cheev (); +#ifdef F77_DUMMY_MAIN + +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } + +#endif +int +main (void) +{ +return $cheev (); + ; + return 0; +} _ACEOF -if ac_fn_f77_try_link "$LINENO" +if ac_fn_c_try_link "$LINENO" then : - acx_lapack_ok=yes; acx_lapack_libs="" + ax_lapack_ok=yes +else $as_nop + LAPACK_LIBS="" fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $acx_lapack_ok" >&5 -printf "%s\n" "$acx_lapack_ok" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_lapack_ok" >&5 +printf "%s\n" "$ax_lapack_ok" >&6; } + LIBS="$save_LIBS" + if test $ax_lapack_ok = no; then + LAPACK_LIBS="" + fi +fi + +# LAPACK linked to by default? (is sometimes included in BLAS lib) +if test $ax_lapack_ok = no; then + save_LIBS="$LIBS"; LIBS="$LIBS $BLAS_LIBS $FLIBS" + as_ac_var=`printf "%s\n" "ac_cv_func_$cheev" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$cheev" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes" +then : + ax_lapack_ok=yes +fi + + LIBS="$save_LIBS" fi # Generic LAPACK library? -if test $acx_lapack_ok = no; then - as_ac_Lib=`printf "%s\n" "ac_cv_lib_lapack_$dsyev" | $as_tr_sh` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $dsyev in -llapack" >&5 -printf %s "checking for $dsyev in -llapack... " >&6; } +for lapack in lapack lapack_rs6k; do + if test $ax_lapack_ok = no; then + save_LIBS="$LIBS"; LIBS="$BLAS_LIBS $LIBS" + as_ac_Lib=`printf "%s\n" "ac_cv_lib_$lapack""_$cheev" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $cheev in -l$lapack" >&5 +printf %s "checking for $cheev in -l$lapack... " >&6; } if eval test \${$as_ac_Lib+y} then : printf %s "(cached) " >&6 else $as_nop ac_check_lib_save_LIBS=$LIBS -LIBS="-llapack $LIBS" -cat > conftest.$ac_ext <<_ACEOF - program main - call $dsyev - end +LIBS="-l$lapack $FLIBS $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char $cheev (); +#ifdef F77_DUMMY_MAIN + +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } + +#endif +int +main (void) +{ +return $cheev (); + ; + return 0; +} _ACEOF -if ac_fn_f77_try_link "$LINENO" +if ac_fn_c_try_link "$LINENO" then : eval "$as_ac_Lib=yes" else $as_nop @@ -10015,28 +9852,32 @@ eval ac_res=\$$as_ac_Lib printf "%s\n" "$ac_res" >&6; } if eval test \"x\$"$as_ac_Lib"\" = x"yes" then : - acx_lapack_ok=yes; acx_lapack_libs="-llapack" -fi - + ax_lapack_ok=yes; LAPACK_LIBS="-l$lapack" fi -LAPACK_LIBS="$LAPACK_LIBS $acx_lapack_libs" -LIBS="$acx_lapack_save_LIBS" -LDFLAGS="$acx_lapack_save_LDFLAGS $acx_lapack_dir" + LIBS="$save_LIBS" + fi +done # 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 printf "%s\n" "#define HAVE_LAPACK 1" >>confdefs.h : else - acx_lapack_ok=no + ax_lapack_ok=no as_fn_error $? "\"Cannot identify LAPACK. Check that it is installed.\"" "$LINENO" 5 fi +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + FLIBS=`echo $FLIBS | sed 's/)//g'` @@ -10068,14 +9909,6 @@ namespace conftest { # endif int F77_DUMMY_MAIN() { return 1; } -#endif -#ifdef FC_DUMMY_MAIN -#ifndef FC_DUMMY_MAIN_EQ_F77 -# ifdef __cplusplus - extern "C" -# endif - int FC_DUMMY_MAIN() { return 1; } -#endif #endif int main (void) @@ -10126,14 +9959,6 @@ namespace conftest { # endif int F77_DUMMY_MAIN() { return 1; } -#endif -#ifdef FC_DUMMY_MAIN -#ifndef FC_DUMMY_MAIN_EQ_F77 -# ifdef __cplusplus - extern "C" -# endif - int FC_DUMMY_MAIN() { return 1; } -#endif #endif int main (void) @@ -10184,14 +10009,6 @@ namespace conftest { # endif int F77_DUMMY_MAIN() { return 1; } -#endif -#ifdef FC_DUMMY_MAIN -#ifndef FC_DUMMY_MAIN_EQ_F77 -# ifdef __cplusplus - extern "C" -# endif - int FC_DUMMY_MAIN() { return 1; } -#endif #endif int main (void) @@ -10324,14 +10141,6 @@ namespace conftest { # endif int F77_DUMMY_MAIN() { return 1; } -#endif -#ifdef FC_DUMMY_MAIN -#ifndef FC_DUMMY_MAIN_EQ_F77 -# ifdef __cplusplus - extern "C" -# endif - int FC_DUMMY_MAIN() { return 1; } -#endif #endif int main (void) @@ -10382,14 +10191,6 @@ namespace conftest { # endif int F77_DUMMY_MAIN() { return 1; } -#endif -#ifdef FC_DUMMY_MAIN -#ifndef FC_DUMMY_MAIN_EQ_F77 -# ifdef __cplusplus - extern "C" -# endif - int FC_DUMMY_MAIN() { return 1; } -#endif #endif int main (void) @@ -10442,14 +10243,6 @@ namespace conftest { # endif int F77_DUMMY_MAIN() { return 1; } -#endif -#ifdef FC_DUMMY_MAIN -#ifndef FC_DUMMY_MAIN_EQ_F77 -# ifdef __cplusplus - extern "C" -# endif - int FC_DUMMY_MAIN() { return 1; } -#endif #endif int main (void) @@ -10512,14 +10305,6 @@ namespace conftest { # endif int F77_DUMMY_MAIN() { return 1; } -#endif -#ifdef FC_DUMMY_MAIN -#ifndef FC_DUMMY_MAIN_EQ_F77 -# ifdef __cplusplus - extern "C" -# endif - int FC_DUMMY_MAIN() { return 1; } -#endif #endif int main (void) @@ -10570,14 +10355,6 @@ namespace conftest { # endif int F77_DUMMY_MAIN() { return 1; } -#endif -#ifdef FC_DUMMY_MAIN -#ifndef FC_DUMMY_MAIN_EQ_F77 -# ifdef __cplusplus - extern "C" -# endif - int FC_DUMMY_MAIN() { return 1; } -#endif #endif int main (void) @@ -10628,14 +10405,6 @@ namespace conftest { # endif int F77_DUMMY_MAIN() { return 1; } -#endif -#ifdef FC_DUMMY_MAIN -#ifndef FC_DUMMY_MAIN_EQ_F77 -# ifdef __cplusplus - extern "C" -# endif - int FC_DUMMY_MAIN() { return 1; } -#endif #endif int main (void) @@ -10686,14 +10455,6 @@ namespace conftest { # endif int F77_DUMMY_MAIN() { return 1; } -#endif -#ifdef FC_DUMMY_MAIN -#ifndef FC_DUMMY_MAIN_EQ_F77 -# ifdef __cplusplus - extern "C" -# endif - int FC_DUMMY_MAIN() { return 1; } -#endif #endif int main (void) @@ -10744,14 +10505,6 @@ namespace conftest { # endif int F77_DUMMY_MAIN() { return 1; } -#endif -#ifdef FC_DUMMY_MAIN -#ifndef FC_DUMMY_MAIN_EQ_F77 -# ifdef __cplusplus - extern "C" -# endif - int FC_DUMMY_MAIN() { return 1; } -#endif #endif int main (void) @@ -10837,14 +10590,6 @@ namespace conftest { # endif int F77_DUMMY_MAIN() { return 1; } -#endif -#ifdef FC_DUMMY_MAIN -#ifndef FC_DUMMY_MAIN_EQ_F77 -# ifdef __cplusplus - extern "C" -# endif - int FC_DUMMY_MAIN() { return 1; } -#endif #endif int main (void) @@ -10897,14 +10642,6 @@ namespace conftest { # endif int F77_DUMMY_MAIN() { return 1; } -#endif -#ifdef FC_DUMMY_MAIN -#ifndef FC_DUMMY_MAIN_EQ_F77 -# ifdef __cplusplus - extern "C" -# endif - int FC_DUMMY_MAIN() { return 1; } -#endif #endif int main (void) @@ -10967,14 +10704,6 @@ namespace conftest { # endif int F77_DUMMY_MAIN() { return 1; } -#endif -#ifdef FC_DUMMY_MAIN -#ifndef FC_DUMMY_MAIN_EQ_F77 -# ifdef __cplusplus - extern "C" -# endif - int FC_DUMMY_MAIN() { return 1; } -#endif #endif int main (void) @@ -11025,14 +10754,6 @@ namespace conftest { # endif int F77_DUMMY_MAIN() { return 1; } -#endif -#ifdef FC_DUMMY_MAIN -#ifndef FC_DUMMY_MAIN_EQ_F77 -# ifdef __cplusplus - extern "C" -# endif - int FC_DUMMY_MAIN() { return 1; } -#endif #endif int main (void) @@ -11083,14 +10804,6 @@ namespace conftest { # endif int F77_DUMMY_MAIN() { return 1; } -#endif -#ifdef FC_DUMMY_MAIN -#ifndef FC_DUMMY_MAIN_EQ_F77 -# ifdef __cplusplus - extern "C" -# endif - int FC_DUMMY_MAIN() { return 1; } -#endif #endif int main (void) @@ -11141,14 +10854,6 @@ namespace conftest { # endif int F77_DUMMY_MAIN() { return 1; } -#endif -#ifdef FC_DUMMY_MAIN -#ifndef FC_DUMMY_MAIN_EQ_F77 -# ifdef __cplusplus - extern "C" -# endif - int FC_DUMMY_MAIN() { return 1; } -#endif #endif int main (void) @@ -12154,14 +11859,6 @@ printf %s "checking if we can compile and link without using -lmpi... " >&6; } # endif int F77_DUMMY_MAIN() { return 1; } -#endif -#ifdef FC_DUMMY_MAIN -#ifndef FC_DUMMY_MAIN_EQ_F77 -# ifdef __cplusplus - extern "C" -# endif - int FC_DUMMY_MAIN() { return 1; } -#endif #endif int main (void) @@ -12218,14 +11915,6 @@ printf %s "checking if we can compile and link using -lmpi... " >&6; } # endif int F77_DUMMY_MAIN() { return 1; } -#endif -#ifdef FC_DUMMY_MAIN -#ifndef FC_DUMMY_MAIN_EQ_F77 -# ifdef __cplusplus - extern "C" -# endif - int FC_DUMMY_MAIN() { return 1; } -#endif #endif int main (void) @@ -12279,14 +11968,6 @@ printf %s "checking if we can compile and link using mpich libs... " >&6; } # endif int F77_DUMMY_MAIN() { return 1; } -#endif -#ifdef FC_DUMMY_MAIN -#ifndef FC_DUMMY_MAIN_EQ_F77 -# ifdef __cplusplus - extern "C" -# endif - int FC_DUMMY_MAIN() { return 1; } -#endif #endif int main (void) diff --git a/libadaptivity/configure.in b/libadaptivity/configure.in index f27884a295..e05a231d8e 100644 --- a/libadaptivity/configure.in +++ b/libadaptivity/configure.in @@ -131,12 +131,14 @@ fi if test "$found_blas" = "no" then - AC_LANG_PUSH([Fortran 77]) + AC_LANG_PUSH([C]) AC_MSG_NOTICE([checking the position of the stars to help find a versions of BLAS]) ACX_BLAS([],[AC_MSG_ERROR("Cannot identify BLAS. Check that it is installed.")]) + AC_LANG_POP([C]) fi -AC_LANG_PUSH([Fortran 77]) +AC_LANG_PUSH([C]) ACX_LAPACK([],[AC_MSG_ERROR("Cannot identify LAPACK. Check that it is installed.")]) +AC_LANG_POP([C]) FLIBS=`echo $FLIBS | sed 's/)//g'`