Merge pull request #70 from rolk/expl-blas

Make it harder to select wrong BLAS/LAPACK libraries
This commit is contained in:
Bård Skaflestad 2012-10-14 14:25:16 -07:00
commit fde3565f63
3 changed files with 19 additions and 0 deletions

View File

@ -98,6 +98,11 @@ if test "x$BLAS_LIBS" != x; then
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)
if test $ax_blas_ok = no; then
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"])
fi
# end of guard against automatic overriding explicit definitions
fi
AC_SUBST(BLAS_LIBS)
LIBS="$ax_blas_save_LIBS"

View File

@ -101,6 +101,11 @@ if test "x$LAPACK_LIBS" != x; then
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)
if test $ax_lapack_ok = no; then
save_LIBS="$LIBS"; LIBS="$LIBS $BLAS_LIBS $FLIBS"
@ -118,6 +123,9 @@ for lapack in lapack lapack_rs6k; do
fi
done
# end of guard against automatic overriding explicit definitions
fi
AC_SUBST(LAPACK_LIBS)
# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:

View File

@ -1,4 +1,7 @@
AC_DEFUN([OPM_LAPACK],
[AC_REQUIRE([AC_F77_WRAPPERS])dnl
AC_REQUIRE([AX_LAPACK])dnl
if test x"$ax_lapack_ok" != xyes; then
AC_MSG_ERROR([BLAS/LAPACK required, but not found.])
fi
])[]dnl