Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
build/pkgs/openblas/spkg-configure.m4: Use OPENBLAS_{LIBS,CFLAGS} whi…
Browse files Browse the repository at this point in the history
…le checking for cblas/lapack functions
  • Loading branch information
mkoeppe committed Mar 18, 2020
1 parent 6db1a26 commit bb89447
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions build/pkgs/openblas/spkg-configure.m4
@@ -1,25 +1,31 @@
SAGE_SPKG_CONFIGURE([openblas], [
SAGE_SPKG_DEPCHECK([gfortran], [
PKG_CHECK_MODULES([OPENBLAS], [openblas >= 0.2.20], [
SAVE_LIBS="$LIBS"
LIBS="$OPENBLAS_LIBS $LIBS"
SAVE_CFLAGS="$CFLAGS"
CFLAGS="$OPENBLAS_CFLAGS $CFLAGS"
PKG_CHECK_VAR([OPENBLASPCDIR], [openblas], [pcfiledir], [
sage_install_blas_pc=yes
AC_SEARCH_LIBS([cblas_dgemm], [openblas], [dnl openblas works as cblas
AC_CHECK_FUNC([cblas_dgemm], [dnl openblas works as cblas
sage_install_cblas_pc=yes
], [
dnl openblas does not work as cblas; try to use system's cblas as is
dnl openblas does not work as cblas; try to use system cblas as is
PKG_CHECK_MODULES([CBLAS], [cblas], [], [sage_spkg_install_openblas=yes])
])
AC_FC_FREEFORM([AC_FC_FUNC([dgeqrf])])
AC_SEARCH_LIBS([$dgeqrf], [openblas], [dnl openblas works as lapack
AC_SEARCH_LIBS([$dgeqrf], [], [dnl openblas works as lapack
sage_install_lapack_pc=yes
], [
dnl openblas does not work as lapack; try to use system's lapack as is
dnl openblas does not work as lapack; try to use system lapack as is
PKG_CHECK_MODULES([LAPACK], [lapack], [], [sage_spkg_install_openblas=yes])
])
], [
AC_MSG_WARN([Unable to locate the directory of openblas.pc. This should not happen!])
sage_spkg_install_openblas=yes
])
LIBS="$SAVE_LIBS"
CFLAGS="$SAVE_CFLAGS"
], [sage_spkg_install_openblas=yes])
AS_IF([test x$sage_spkg_install_openblas != xyes], [
m4_foreach([blaslibnam], [blas, cblas, lapack], [
Expand Down

0 comments on commit bb89447

Please sign in to comment.