Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

openblas spkg-configure.m4: Fix the check for lapack/cblas functions #29361

Closed
mkoeppe opened this issue Mar 18, 2020 · 17 comments
Closed

openblas spkg-configure.m4: Fix the check for lapack/cblas functions #29361

mkoeppe opened this issue Mar 18, 2020 · 17 comments

Comments

@mkoeppe
Copy link
Contributor

mkoeppe commented Mar 18, 2020

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

@mkoeppe mkoeppe added this to the sage-9.1 milestone Mar 18, 2020
@mkoeppe
Copy link
Contributor Author

mkoeppe commented Mar 18, 2020

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Mar 18, 2020

Author: Matthias Koeppe

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Mar 18, 2020

Commit: 71ac6a5

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Mar 18, 2020

New commits:

bb89447build/pkgs/openblas/spkg-configure.m4: Use OPENBLAS_{LIBS,CFLAGS} while checking for cblas/lapack functions
71ac6a5build/pkgs/openblas/spkg-configure.m4: Do not use AC_FC_FUNC.

@dimpase
Copy link
Member

dimpase commented Mar 19, 2020

comment:3

good, it works.

@dimpase
Copy link
Member

dimpase commented Mar 19, 2020

Reviewer: Dima Pasechnik

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Mar 19, 2020

comment:4

Thanks.

@dimpase
Copy link
Member

dimpase commented Mar 19, 2020

comment:5

Again, with Fedora there is a subsequent problem installing cblas.pc, but it is fixed by #29082

@mwageringel
Copy link
Contributor

comment:6

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"

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Mar 20, 2020

comment:7

Did you run bootstrap?

@mwageringel
Copy link
Contributor

comment:8

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.

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Mar 20, 2020

comment:9

Need to add to ACLOCAL_PATH.
See .homebrew-build-env in #29104

@mwageringel
Copy link
Contributor

comment:10

I thought I had done that, but must have messed it up. All good now. Thank you.

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Mar 22, 2020

comment:11

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

@dimpase
Copy link
Member

dimpase commented Mar 22, 2020

comment:12

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.

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Mar 22, 2020

comment:13

OK I have created #29393 for the Fedora issue.

@vbraun
Copy link
Member

vbraun commented Mar 25, 2020

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants