openblas spkg-configure.m4: Fix the check for lapack/cblas functions
mkoeppe opened this issue · 17 comments
This line (introduced in #29071):
AC_FC_FREEFORM([AC_FC_FUNC([dgeqrf])])
is not executed at all because AC_FC_FREEFORM is AC_DEFUN_ONCE and is called already in gfortran/spkg-configure.m4
As a result:
Checking whether SageMath should install SPKG openblas...
checking BLAS library... openblas
checking whether any of gfortran is installed or will be installed as SPKG... no
checking for openblas >= 0.2.20... yes
checking for cblas_dgemm... yes
checking for ... no
checking for lapack... no
configure: no suitable system package found for SPKG openblas
In this ticket, we fix the check by avoiding AC_FC_FUNC altogether, which is not suitable to be used in a configure that must work if no Fortran compiler is available.
(Factored out from #29104.)
CC: @dimpase
Component: build: configure
Author: Matthias Koeppe
Branch/Commit: 71ac6a5
Reviewer: Dima Pasechnik
Issue created by migration from https://trac.sagemath.org/ticket/29361
Author: Matthias Koeppe
good, it works.
Reviewer: Dima Pasechnik
Thanks.
Again, with Fedora there is a subsequent problem installing cblas.pc, but it is fixed by #29082
This does not seem to work for me with Homebrew. I still get
Checking whether SageMath should install SPKG openblas...
checking BLAS library... openblas
checking whether any of gfortran is installed or will be installed as SPKG... no
checking for OPENBLAS... yes
checking for library containing cblas_dgemm... -lopenblas
checking for library containing ... no
checking for LAPACK... no
configure: no suitable system package found for SPKG openblas
after a distclean and running
./configure \
LDFLAGS="-L/usr/local/opt/readline/lib -L/usr/local/opt/openblas/lib" \
CPPFLAGS="-I/usr/local/opt/readline/include -I/usr/local/opt/openblas/include" \
PKG_CONFIG_PATH="/usr/local/opt/readline/lib/pkgconfig:/usr/local/opt/openblas/lib/pkgconfig"
Did you run bootstrap?
Ok, running bootstrap solves this. My bad.
I do get an error running bootstrap though, but probably not from this ticket.
build/pkgs/iconv/spkg-configure.m4:2: warning: macro 'AM_ICONV' not found in library
...
configure:18231: error: possibly undefined macro: AM_ICONV
If this token and others are legitimate, please use m4_pattern_allow.
See the Autoconf documentation.
I thought I had done that, but must have messed it up. All good now. Thank you.
I still see problems with finding openblas on fedora-32-standard at https://github.com/mkoeppe/sage/runs/524868616 (which has #29082): Does not find openblas, installs its own openblas, then openblas-dependent packages such as iml, gsl fail to compile. This is in contrast to fedora-32-minimal (which has no system openblas) - where iml builds successfully
it cannot find openblas, as Fedora does not install openblas.pc
it is out of scope of this ticket.
It is possible to get around this by either shipping or generating one, though.
Changed branch from u/mkoeppe/openblas_spkg_configure_m4__fix_the_check_for_lapack_cblas_functions to 71ac6a5