From 0ad268f991f6f3191e9fdeeb65d9731b7c542a80 Mon Sep 17 00:00:00 2001 From: ddelange <14880945+ddelange@users.noreply.github.com> Date: Tue, 18 Apr 2023 10:57:53 +0200 Subject: [PATCH 1/3] Add support for OpenBLAS --- m4/ax_cblas.m4 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/m4/ax_cblas.m4 b/m4/ax_cblas.m4 index 0c87c29f..4acda990 100644 --- a/m4/ax_cblas.m4 +++ b/m4/ax_cblas.m4 @@ -157,6 +157,11 @@ if test $ax_cblas_ok = no; then AC_CHECK_LIB(cblas, cblas_dgemm, [ax_cblas_ok=yes; CBLAS_LIBS="-lcblas"]) fi +# Generic BLAS library? (for instance OpenBLAS) +if test $ax_cblas_ok = no; then + AC_CHECK_LIB(cblas, cblas_dgemm, [ax_cblas_ok=yes; CBLAS_LIBS="-lblas"]) +fi + AC_SUBST(CBLAS_LIBS) LIBS="$ax_cblas_save_LIBS" From 8eb721f6a1bfc358e2ad7763921756af866ebb91 Mon Sep 17 00:00:00 2001 From: ddelange <14880945+ddelange@users.noreply.github.com> Date: Tue, 18 Apr 2023 11:19:31 +0200 Subject: [PATCH 2/3] Fix typo --- m4/ax_cblas.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/m4/ax_cblas.m4 b/m4/ax_cblas.m4 index 4acda990..0e0d68d3 100644 --- a/m4/ax_cblas.m4 +++ b/m4/ax_cblas.m4 @@ -159,7 +159,7 @@ fi # Generic BLAS library? (for instance OpenBLAS) if test $ax_cblas_ok = no; then - AC_CHECK_LIB(cblas, cblas_dgemm, [ax_cblas_ok=yes; CBLAS_LIBS="-lblas"]) + AC_CHECK_LIB(blas, cblas_dgemm, [ax_cblas_ok=yes; CBLAS_LIBS="-lblas"]) fi AC_SUBST(CBLAS_LIBS) From 6f9567742711dbd929ab6df7eb2caf01ab6325e0 Mon Sep 17 00:00:00 2001 From: ddelange <14880945+ddelange@users.noreply.github.com> Date: Tue, 18 Apr 2023 12:00:10 +0200 Subject: [PATCH 3/3] Explicit -lopenblas --- m4/ax_cblas.m4 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/m4/ax_cblas.m4 b/m4/ax_cblas.m4 index 0e0d68d3..da89cab9 100644 --- a/m4/ax_cblas.m4 +++ b/m4/ax_cblas.m4 @@ -152,12 +152,17 @@ if test $ax_cblas_ok = no; then [], [-lblas])]) fi +# BLAS in OpenBLAS library? +if test $ax_cblas_ok = no; then + AC_CHECK_LIB(openblas, cblas_dgemm, [ax_cblas_ok=yes; CBLAS_LIBS="-lopenblas"]) +fi + # Generic CBLAS library? if test $ax_cblas_ok = no; then AC_CHECK_LIB(cblas, cblas_dgemm, [ax_cblas_ok=yes; CBLAS_LIBS="-lcblas"]) fi -# Generic BLAS library? (for instance OpenBLAS) +# Generic BLAS library? if test $ax_cblas_ok = no; then AC_CHECK_LIB(blas, cblas_dgemm, [ax_cblas_ok=yes; CBLAS_LIBS="-lblas"]) fi