Honor explicit specification of BLAS/LAPACK libraries

Only probe for libraries on system if no library is specified. If there
is an error with the library that is specified as an argument, then
raise an error instead of continuing to look for other libraries with a
simple warning buried deep in the configuration log.
This commit is contained in:
Roland Kaufmann 2012-10-14 12:14:15 +02:00
parent 279fbb8267
commit c8a52177bf
2 changed files with 16 additions and 0 deletions

View File

@ -98,6 +98,11 @@ if test "x$BLAS_LIBS" != x; then
fi fi
fi fi
# don't probe if explicitly defined; by bailing out here if the
# argument is set, we guard against typo, incompatible libs. etc.
# being inadvertedly overrided by another (random) implementation
if test "x$with_blas" == x; then
# BLAS linked to by default? (happens on some supercomputers) # BLAS linked to by default? (happens on some supercomputers)
if test $ax_blas_ok = no; then if test $ax_blas_ok = no; then
save_LIBS="$LIBS"; LIBS="$LIBS" save_LIBS="$LIBS"; LIBS="$LIBS"
@ -186,6 +191,9 @@ if test $ax_blas_ok = no; then
AC_CHECK_LIB(blas, $sgemm, [ax_blas_ok=yes; BLAS_LIBS="-lblas"]) AC_CHECK_LIB(blas, $sgemm, [ax_blas_ok=yes; BLAS_LIBS="-lblas"])
fi fi
# end of guard against automatic overriding explicit definitions
fi
AC_SUBST(BLAS_LIBS) AC_SUBST(BLAS_LIBS)
LIBS="$ax_blas_save_LIBS" LIBS="$ax_blas_save_LIBS"

View File

@ -101,6 +101,11 @@ if test "x$LAPACK_LIBS" != x; then
fi fi
fi fi
# don't probe if explicitly defined; by bailing out here if the
# argument is set, we guard against typo, incompatible libs. etc.
# being inadvertedly overrided by another (random) implementation
if test "x$with_lapack" == x; then
# LAPACK linked to by default? (is sometimes included in BLAS lib) # LAPACK linked to by default? (is sometimes included in BLAS lib)
if test $ax_lapack_ok = no; then if test $ax_lapack_ok = no; then
save_LIBS="$LIBS"; LIBS="$LIBS $BLAS_LIBS $FLIBS" save_LIBS="$LIBS"; LIBS="$LIBS $BLAS_LIBS $FLIBS"
@ -118,6 +123,9 @@ for lapack in lapack lapack_rs6k; do
fi fi
done done
# end of guard against automatic overriding explicit definitions
fi
AC_SUBST(LAPACK_LIBS) AC_SUBST(LAPACK_LIBS)
# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: