Opened 3 years ago

Closed 15 months ago

#29088 closed defect (invalid)

Fix BLAS-related installation errors on various systems

Reported by: Matthias Köppe Owned by:
Priority: major Milestone: sage-duplicate/invalid/wontfix
Component: packages: standard Keywords:
Cc: Dima Pasechnik, François Bissey, Markus Wageringel, Michael Orlitzky Merged in:
Authors: Reviewers: Marc Mezzarobba
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: #29051, #29071 Stopgaps:

Status badges

Description (last modified by Matthias Köppe)

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

  * 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.

builds openblas from source, then installing R from source fails with openblas-related errors

configure fails to detect openblas, error building openblas from source

Change History (24)

comment:1 Changed 3 years ago by Dima Pasechnik

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.

comment:2 Changed 3 years ago by Matthias Köppe

Description: modified (diff)

comment:3 in reply to:  1 Changed 3 years ago by Matthias Köppe

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.

comment:4 Changed 3 years ago by Matthias Köppe

Description: modified (diff)

comment:5 Changed 3 years ago by Dima Pasechnik

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.

comment:6 Changed 3 years ago by François Bissey

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

comment:7 Changed 3 years ago by François Bissey

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).

comment:8 Changed 3 years ago by Dima Pasechnik

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

comment:9 in reply to:  8 ; Changed 3 years ago by François Bissey

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 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.

Version 0, edited 3 years ago by François Bissey (next)

comment:10 Changed 3 years ago by Dima Pasechnik

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.

comment:11 Changed 3 years ago by Dima Pasechnik

Dependencies: #29071

comment:12 Changed 3 years ago by Dima Pasechnik

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.

comment:13 in reply to:  9 Changed 3 years ago by Dima Pasechnik

Replying to fbissey:

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

comment:14 Changed 3 years ago by Matthias Köppe

Dependencies: #29071#29051, #29071

comment:15 Changed 3 years ago by Dima Pasechnik

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.

comment:16 Changed 3 years ago by Matthias Köppe

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.

comment:17 Changed 3 years ago by Matthias Köppe

Cc: Michael Orlitzky added

comment:18 Changed 3 years ago by Dima Pasechnik

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

comment:19 Changed 3 years ago by Dima Pasechnik

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.

Last edited 3 years ago by Dima Pasechnik (previous) (diff)

comment:20 Changed 3 years ago by Dima Pasechnik

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

comment:21 in reply to:  19 Changed 3 years ago by Matthias Köppe

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

comment:22 Changed 3 years ago by Matthias Köppe

Milestone: sage-9.1sage-duplicate/invalid/wontfix
Status: newneeds_review

I think we can close this one as outdated

comment:23 Changed 15 months ago by Marc Mezzarobba

Reviewers: Marc Mezzarobba
Status: needs_reviewpositive_review

comment:24 Changed 15 months ago by Matthias Köppe

Resolution: invalid
Status: positive_reviewclosed
Note: See TracTickets for help on using tickets.