diff --git a/m4/ax_blas.m4 b/m4/ax_blas.m4 index e4f96cbe..7e6fd549 100644 --- a/m4/ax_blas.m4 +++ b/m4/ax_blas.m4 @@ -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" diff --git a/m4/ax_lapack.m4 b/m4/ax_lapack.m4 index 6aa16aaf..ad188f9e 100644 --- a/m4/ax_lapack.m4 +++ b/m4/ax_lapack.m4 @@ -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: