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

Fix BLAS-related installation errors on various systems #29088

Closed
mkoeppe opened this issue Jan 27, 2020 · 22 comments
Closed

Fix BLAS-related installation errors on various systems #29088

mkoeppe opened this issue Jan 27, 2020 · 22 comments

Comments

@mkoeppe
Copy link
Contributor

mkoeppe commented Jan 27, 2020

Errors on various platforms tested at https://github.com/mkoeppe/sage/actions/runs/31716135. Examples:

  • archlinux-latest-standard at https://github.com/mkoeppe/sage/runs/410329835:

      * package: fflas_ffpack-2.4.3
      log file: /sage/logs/pkgs/fflas_ffpack-2.4.3.log
      build directory: /sage/local/var/tmp/sage/build/fflas_ffpack-2.4.3
    
    * package: iml-1.0.4p1.p2
      log file: /sage/logs/pkgs/iml-1.0.4p1.p2.log
      build directory: /sage/local/var/tmp/sage/build/iml-1.0.4p1.p2
    
    * package: r-3.6.2
      log file: /sage/logs/pkgs/r-3.6.2.log
      build directory: /sage/local/var/tmp/sage/build/r-3.6.2
    
    * package: suitesparse-5.6.0
      log file: /sage/logs/pkgs/suitesparse-5.6.0.log
      build directory: /sage/local/var/tmp/sage/build/suitesparse-5.6.0
    

    Of these, at least the fflas_ffpack error comes from openblas.

  • ubuntu-bionic-minimal (https://github.com/mkoeppe/sage/runs/410329574)
    builds openblas from source, then installing R from source fails with openblas-related errors

  • fedora-32-standard (https://github.com/mkoeppe/sage/runs/410329823)
    configure fails to detect openblas, error building openblas from source

Depends on #29051
Depends on #29071

CC: @dimpase @kiwifb @mwageringel @orlitzky

Component: packages: standard

Reviewer: Marc Mezzarobba

Issue created by migration from https://trac.sagemath.org/ticket/29088

@mkoeppe mkoeppe added this to the sage-9.1 milestone Jan 27, 2020
@dimpase
Copy link
Member

dimpase commented Jan 27, 2020

comment:1

I don't see how the R error on archlinux-latest-standard:

2020-01-27T09:05:30.3588775Z byte-compiling package 'graphics'
2020-01-27T09:05:30.3589064Z Error : .onLoad failed in loadNamespace() for 'utils', details:
2020-01-27T09:05:30.3589172Z   call: system(paste(which, shQuote(names[i])), intern = TRUE, ignore.stderr = TRUE)
2020-01-27T09:05:30.3589286Z   error: error in running command
2020-01-27T09:05:30.3589557Z Error: unable to load R code in package 'graphics'
2020-01-27T09:05:30.3589663Z Execution halted
2020-01-27T09:05:30.3589762Z make[6]: *** [../../../share/make/lazycomp.mk:9: ../../../library/graphics/R/graphics.rdb] Error 1
2020-01-27T09:05:30.3590303Z make[6]: Target 'mklazycomp' not remade because of errors.
2020-01-27T09:05:30.3590634Z make[6]: Leaving directory '/sage/local/var/tmp/sage/build/r-3.6.2/src/src/library/graphics'
2020-01-27T09:05:30.3590756Z make[5]: *** [Makefile:27: all] Error 2
2020-01-27T09:05:30.3591062Z make[5]: Leaving directory '/sage/local/var/tmp/sage/build/r-3.6.2/src/src/library/graphics'
2020-01-27T09:05:30.3591191Z make[4]: *** [Makefile:39: R] Error 1
2020-01-27T09:05:30.3591507Z make[4]: Leaving directory '/sage/local/var/tmp/sage/build/r-3.6.2/src/src/library'
2020-01-27T09:05:30.3591627Z make[3]: *** [Makefile:28: R] Error 1
2020-01-27T09:05:30.3591927Z make[3]: Leaving directory '/sage/local/var/tmp/sage/build/r-3.6.2/src/src'
2020-01-27T09:05:30.3592029Z make[2]: *** [Makefile:61: R] Error 1
2020-01-27T09:05:30.3592328Z make[2]: Leaving directory '/sage/local/var/tmp/sage/build/r-3.6.2/src'
2020-01-27T09:05:30.3592443Z Error building R.
2020-01-27T09:05:30.3592496Z 
2020-01-27T09:05:30.3592594Z real	2m31.753s
2020-01-27T09:05:30.3592692Z user	3m18.995s
2020-01-27T09:05:30.3592773Z sys	0m19.046s
2020-01-27T09:05:30.3592876Z ************************************************************************
2020-01-27T09:05:30.3593142Z Error installing package r-3.6.2

has anything to do with openblas.

@mkoeppe

This comment has been minimized.

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Jan 27, 2020

comment:3

Replying to @dimpase:

I don't see how the R error on archlinux-latest-standard [...]
has anything to do with openblas.

You are right, I mixed it up. In this run it is fflas_ffpack that has the openblas problems.
I've updated the ticket description.

@mkoeppe

This comment has been minimized.

@dimpase
Copy link
Member

dimpase commented Jan 27, 2020

comment:5

I think it might be #27444 in the case of fflas_ffpack; not sure about suitesparse, which seem to miss liblapack linked for some reason.

@kiwifb
Copy link
Member

kiwifb commented Jan 27, 2020

comment:6

For suitesparse that's because the correct linking options is -llapack -lopenblas. That's because Arch's openblas is not integrated with lapack but provided separately. R spots it correctly

  Interfaces supported:        X11
  External libraries:          readline, BLAS(OpenBLAS), LAPACK(generic), curl
  Additional capabilities:     PNG, JPEG, TIFF, NLS, ICU
  Options enabled:             shared R library, R profiling

@kiwifb
Copy link
Member

kiwifb commented Jan 28, 2020

comment:7

We need more details on the openblas package in arch. The problem in iml is bound to happen if libopenblas doesn't contain cblas symbols (which would be real weird since openblas is primarily a cblas implementation with an optional fortran interface).

@dimpase
Copy link
Member

dimpase commented Jan 28, 2020

comment:8

on arch cblas symbols are not in libopenblas. and lapack symbols are not there either, as we found on #29071

@kiwifb
Copy link
Member

kiwifb commented Jan 28, 2020

comment:9

Replying to @dimpase:

on arch cblas symbols are not in libopenblas. and lapack symbols are not there either, as we found on #29071

OK that's two issues explained on arch (iml and suitesparse). You are correct in your assessment about fflas-ffpack - which may be due to some function name change in openblas between versions, that would need to be checked.

That leaves R which is mysterious but could be down to blas/lapack issue. graphics is the first R package to be built, the failure comes when the build system check that the package can be loaded by R. If R is not functional then of course the package will fail to load. Which would mean that it being graphics is just incidental.

@dimpase
Copy link
Member

dimpase commented Jan 28, 2020

comment:10

everything that is related to problems with using system OpenBLAS on ARch should be fixed by #29071 - at least with the latter on Arch I am able to build Sage's R with system's OpenBLAS.

@dimpase
Copy link
Member

dimpase commented Jan 28, 2020

Dependencies: #29071

@dimpase
Copy link
Member

dimpase commented Jan 28, 2020

comment:12

One fedora-32, I don't quite know what kind of openblas configuration one

2020-01-27T08:33:14.3793913Z (220/459): openblas-0.3.7-2.fc32.x86_64.rpm     332 kB/s |  29 kB     00:00    
2020-01-27T08:33:14.3970448Z (221/459): openblas-devel-0.3.7-2.fc32.x86_64.r 735 kB/s |  73 kB     00:00    
2020-01-27T08:33:14.5942412Z (222/459): openblas-openmp-0.3.7-2.fc32.x86_64.  16 MB/s | 4.4 MB     00:00    
2020-01-27T08:33:14.6190047Z (223/459): openblas-openmp64-0.3.7-2.fc32.x86_6  18 MB/s | 4.3 MB     00:00    
2020-01-27T08:33:14.6564200Z (224/459): openblas-openmp64_-0.3.7-2.fc32.x86_  17 MB/s | 4.3 MB     00:00    
2020-01-27T08:33:14.8431058Z (225/459): openblas-serial64-0.3.7-2.fc32.x86_6  19 MB/s | 4.2 MB     00:00    
2020-01-27T08:33:14.8613987Z (226/459): openblas-serial-0.3.7-2.fc32.x86_64.  16 MB/s | 4.3 MB     00:00    
2020-01-27T08:33:14.9043436Z (227/459): openblas-serial64_-0.3.7-2.fc32.x86_  17 MB/s | 4.1 MB     00:00    
2020-01-27T08:33:14.9262666Z (228/459): openblas-srpm-macros-2-6.fc31.noarch  88 kB/s | 7.3 kB     00:00    
2020-01-27T08:33:15.1461271Z (229/459): openblas-threads64-0.3.7-2.fc32.x86_  18 MB/s | 4.3 MB     00:00    
2020-01-27T08:33:15.1608599Z (230/459): openblas-threads-0.3.7-2.fc32.x86_64  15 MB/s | 4.4 MB     00:00    
2020-01-27T08:33:15.1782235Z (231/459): openblas-threads64_-0.3.7-2.fc32.x86  17 MB/s | 4.3 MB     00:00    

I guess one ends up with the last one, openblas-threads64_ - which I don't know and certainly never tested with. (the difference with ``openblas-threads64` is a symbol name suffix, whatever it means) - Is it a script bug, can we control a bit better what's getting installed on the runner?

I guess it's got a different pkg-config "name".


It's not surprise that openblas 0.3.6 doesn't build, it might be just too old for Fedora 32.

@dimpase
Copy link
Member

dimpase commented Jan 28, 2020

comment:13

Replying to @kiwifb:

Replying to @dimpase:

on arch cblas symbols are not in libopenblas. and lapack symbols are not there either, as we found on #29071

OK that's two issues explained on arch (iml and suitesparse). You are correct in your assessment about fflas-ffpack - which may be due to some function name change in openblas between versions, that would need to be checked.

That leaves R which is mysterious but could be down to blas/lapack issue. graphics is the first R package to be built, the failure comes when the build system check that the package can be loaded by R. If R is not functional then of course the package will fail to load. Which would mean that it being graphics is just incidental.

also #29084 might be relevant - it looks that there are more packages, apart from fflas_ffpack where one
might be calling pkg-config --libs cblas blas in spkg-install, not just pkg-config --libs cblas

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Jan 28, 2020

Changed dependencies from #29071 to #29051, #29071

@dimpase
Copy link
Member

dimpase commented Jan 28, 2020

comment:15

Fedora 31 (and, I guess, 32 too) has no *.pc files for its multiple openblas. (As the reason, they give that they cannot choose the default, that's why)

They do have reference implememtations of BLAS, CBLAS, and LAPACK, with *.pc files

Meanwhile, libR on Fedora comes with its own BLAS, so it's quite a mess.

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Mar 16, 2020

comment:16

An update on the fedora-32-standard configuration (see https://github.com/mkoeppe/sage/runs/509834243): openblas-0.3.9-1.fc32.x86_64 and related packages are installed, but openblas/spkg-configure.m4 does not recognize it:

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... no
configure: no suitable system package found for SPKG openblas

Then Sage installs openblas-0.3.6.p0 successfully, but various BLAS-using packages (numpy, iml, gsl) fail to build.

@dimpase
Copy link
Member

dimpase commented Mar 16, 2020

comment:18

gsl problems are different here:

2020-03-16T00:53:19.3875570Z   [gsl-2.5] error installing, exit status 1. End of log file:
2020-03-16T00:53:19.3920355Z   [gsl-2.5]   checking for a BSD-compatible install... /usr/bin/install -c
2020-03-16T00:53:19.3920646Z   [gsl-2.5]   checking whether build environment is sane... yes
2020-03-16T00:53:19.3920901Z   [gsl-2.5]   checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
2020-03-16T00:53:19.3921129Z   [gsl-2.5]   checking for gawk... gawk
2020-03-16T00:53:19.3921367Z   [gsl-2.5]   checking whether make sets $(MAKE)... yes
2020-03-16T00:53:19.3921615Z   [gsl-2.5]   checking whether make supports nested variables... yes
2020-03-16T00:53:19.3921909Z   [gsl-2.5]   checking whether to enable maintainer-specific portions of Makefiles... no
2020-03-16T00:53:19.3922177Z   [gsl-2.5]   checking for a sed that does not truncate output... /usr/bin/sed
2020-03-16T00:53:19.3922428Z   [gsl-2.5]   checking whether make sets $(MAKE)... (cached) yes
2020-03-16T00:53:19.3922679Z   [gsl-2.5]   checking build system type... x86_64-unknown-linux-gnu
2020-03-16T00:53:19.3923079Z   [gsl-2.5]   checking host system type... x86_64-unknown-linux-gnu
2020-03-16T00:53:19.3923302Z   [gsl-2.5]   checking for gcc... gcc
2020-03-16T00:53:19.3923539Z   [gsl-2.5]   checking whether the C compiler works... no
2020-03-16T00:53:19.3923803Z   [gsl-2.5]   configure: error: in `/sage/local/var/tmp/sage/build/gsl-2.5/src':
2020-03-16T00:53:19.3924057Z   [gsl-2.5]   configure: error: C compiler cannot create executables
2020-03-16T00:53:19.3924294Z   [gsl-2.5]   See `config.log' for more details

@dimpase
Copy link
Member

dimpase commented Mar 16, 2020

comment:19

iml does not find cblas

2020-03-16T00:53:23.6337896Z   [iml-1.0.4p1.p2]   checking for CBLAS... configure: WARNING: CBLAS not found!
2020-03-16T00:53:23.6338470Z   [iml-1.0.4p1.p2]   Please make sure that --with-cblas=<linker flags> and optional --with-cblas-include=<path> and --with-cblas-lib=<path> are correctly set.
2020-03-16T00:53:23.6338910Z   [iml-1.0.4p1.p2]   Trying legacy ATLAS configuration.
2020-03-16T00:53:23.6339385Z   [iml-1.0.4p1.p2]   checking for ATLAS >= 3.0... configure: error: ATLAS not found!

not sure why.Could it be that re-worked installation of *.pc files is broken?
If so, this should be seen on the other platforms which install Sage's openblas, though.

And the same with numpy, I think - an error saying that cblas cannot be found.

Could be a too old openblas - the current upstream is 0.3.9.

@dimpase
Copy link
Member

dimpase commented Mar 16, 2020

comment:20

perhaps we need to update gsl too, GSL 2.6 was released in Aug 2019.

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Mar 17, 2020

comment:21

Replying to @dimpase:

iml does not find cblas

2020-03-16T00:53:23.6337896Z   [iml-1.0.4p1.p2]   checking for CBLAS... configure: WARNING: CBLAS not found!
2020-03-16T00:53:23.6338470Z   [iml-1.0.4p1.p2]   Please make sure that --with-cblas=<linker flags> and optional --with-cblas-include=<path> and --with-cblas-lib=<path> are correctly set.
2020-03-16T00:53:23.6338910Z   [iml-1.0.4p1.p2]   Trying legacy ATLAS configuration.
2020-03-16T00:53:23.6339385Z   [iml-1.0.4p1.p2]   checking for ATLAS >= 3.0... configure: error: ATLAS not found!

not sure why.Could it be that re-worked installation of *.pc files is broken?

Quite possible - please help with reviewing #29082

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Apr 25, 2020

comment:22

I think we can close this one as outdated

@mkoeppe mkoeppe removed this from the sage-9.1 milestone Apr 25, 2020
@mezzarobba
Copy link
Member

Reviewer: Marc Mezzarobba

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