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

Repair use of system BLAS broken by #29025: remove numpy site.cfg [DEFAULT/ALL] sections #29051

Closed
mkoeppe opened this issue Jan 20, 2020 · 34 comments

Comments

@mkoeppe
Copy link
Contributor

mkoeppe commented Jan 20, 2020

This ticket fixes what was broken by #29025.

Previous related tickets:


References:

scipy/setup.py at master · scipy/scipy
https://github.com/scipy/scipy/blob/master/scipy/setup.py

numpy/system_info.py at master · numpy/numpy
https://github.com/numpy/numpy/blob/master/numpy/distutils/system_info.py

python - How to check BLAS/LAPACK linkage in NumPy and SciPy? - Stack Overflow
https://stackoverflow.com/questions/9000164/how-to-check-blas-lapack-linkage-in-numpy-and-scipy

CC: @kiwifb @dimpase @mwageringel @vbraun

Component: packages: standard

Author: Dima Pasechnik

Branch/Commit: dba7aef

Reviewer: Matthias Koeppe

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

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

dimpase commented Jan 24, 2020

comment:2

I now see this on Arch on #29071 (with openblas from the system)

@dimpase
Copy link
Member

dimpase commented Jan 25, 2020

comment:3

#29025 broke buidling scipy with system's OpenBLAS. I'm now looking into how to tweak
numpy/distutils/site.cfg to make it work, but it is not obvious. Probably there are more bugs there (in numpy).

@kiwifb
Copy link
Member

kiwifb commented Jan 25, 2020

comment:4

Something that weirded me a bit in #29025. Why keep the [ALL] section at all? I cannot be sure that's the root cause but I would start by cleaning that.

@dimpase
Copy link
Member

dimpase commented Jan 25, 2020

comment:5

it's a bloody mess, if you read the numpy issue linked at #29025 - some numpy config functions use [ALL] section.

Removing [DEFAULT] section allows the build with system OpenBLAS to work again,
so there is clearly something amiss. I messed up while testing #29025 and so it went through.

@dimpase
Copy link
Member

dimpase commented Jan 25, 2020

comment:6

Should we just revert #29025 ?
(at the moment it's not needed anywhere expect in not yet ready tickers)

I don't see an easy fix for it, without digging into numpy mess.

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Jan 25, 2020

comment:7

After reverting, is [ALL] needed?

@dimpase
Copy link
Member

dimpase commented Jan 25, 2020

comment:8

No, [ALL] with just paths in it has no effect, according to numpy people.
So it should be removed.

What was the orginal need for [DEFAULT] in #29025 ?

@dimpase
Copy link
Member

dimpase commented Jan 25, 2020

comment:9
[blas]
libraries  = openblas
[lapack]
libraries  = openblas

seems to work just as well.

@kiwifb
Copy link
Member

kiwifb commented Jan 25, 2020

comment:10

If we did the work properly with the like of CPATH and LIBRARY_PATH we should be able to drop [ALL]/[DEFAULT] completely. These section just define additional default paths for headers and libraries to be used in numpy.

@dimpase
Copy link
Member

dimpase commented Jan 26, 2020

New commits:

9d1770arevert #29025, remove useless [ALL] section

@dimpase
Copy link
Member

dimpase commented Jan 26, 2020

Author: Dima Pasechnik

@dimpase
Copy link
Member

dimpase commented Jan 26, 2020

Commit: 9d1770a

@dimpase
Copy link
Member

dimpase commented Jan 26, 2020

@dimpase
Copy link
Member

dimpase commented Jan 26, 2020

comment:12

Replying to @kiwifb:

If we did the work properly with the like of CPATH and LIBRARY_PATH we should be able to drop [ALL]/[DEFAULT] completely. These section just define additional default paths for headers and libraries to be used in numpy.

IMHO all these paths are better set up per library-specific section ([blas] etc.)
than via "globals" like LIBRARY_PATH.

@videlec
Copy link
Contributor

videlec commented Jan 26, 2020

Attachment: vdelecroix-config.log

@videlec
Copy link
Contributor

videlec commented Jan 26, 2020

comment:13

Attachment: vdelecroix-numpy-1.16.1.log

Thanks to Dima (and #29071 and the branch here), I got Sage compile up to numpy. It ends up with some linking trouble. See

@dimpase
Copy link
Member

dimpase commented Jan 26, 2020

comment:14

Replying to @videlec:

Thanks to Dima (and #29071 and the branch here), I got Sage compile up to numpy. It ends up with some linking trouble. See

thanks, it's the same Arch-specific issue again - more precisely, numpy does not know about cblas. Testing on Debian wasn't enough.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jan 26, 2020

Branch pushed to git repo; I updated commit sha1. New commits:

dba7aefrevert from "libraries=" back to section-specific "BLAH_libs="

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jan 26, 2020

Changed commit from 9d1770a to dba7aef

@dimpase
Copy link
Member

dimpase commented Jan 26, 2020

comment:16

the commit at comment:15 fixes the latest problem.
I've also left a comment on this here: numpy/numpy#15338 (comment)

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Jan 26, 2020

@videlec
Copy link
Contributor

videlec commented Jan 26, 2020

comment:18

At ​dba7aef, success for me!

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Jan 27, 2020

comment:19

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:
    configure finds system openblas, then installing R from source fails with openblas-related errors

  • ubuntu-bionic-minimal
    builds openblas from source, then installing R from source fails with openblas-related errors

  • fedora-32-standard
    configure fails to detect openblas, error building openblas from source

@kiwifb
Copy link
Member

kiwifb commented Jan 27, 2020

comment:20

Replying to @mkoeppe:

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:
    configure finds system openblas, then installing R from source fails with openblas-related errors

  • ubuntu-bionic-minimal
    builds openblas from source, then installing R from source fails with openblas-related errors

  • fedora-32-standard
    configure fails to detect openblas, error building openblas from source

I'll be honest. None of these failures can be a result of this ticket. May be the git branch needs rebasing to include some fix for those separate issues.

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Jan 27, 2020

Reviewer: Matthias Koeppe

@mkoeppe

This comment has been minimized.

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Jan 27, 2020

comment:21

Yes, this fix should definitely go into the next beta.

@mkoeppe mkoeppe changed the title Paths configured in installed numpy site.cfg [DEFAULT/ALL] do not affect scipy Repair use of system BLAS broken by #29025: remove numpy site.cfg [DEFAULT/ALL] sections Jan 27, 2020
@mkoeppe
Copy link
Contributor Author

mkoeppe commented Jan 27, 2020

comment:22

Follow-up for the other build issues related to BLAS at #29088.

@kiwifb
Copy link
Member

kiwifb commented Jan 27, 2020

comment:23

Replying to @mkoeppe:

Yes, this fix should definitely go into the next beta.

Note that Volker silently released 9.1.beta2 yesterday. Should ping him to make a proper announcement.

@jhpalmieri
Copy link
Member

comment:24

I just downloaded the 9.1.beta2 tarball today, and on an Ubuntu virtual machine it fails on scipy, complaining about blas:

    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-req-build-7agkks4g/setup.py", line 492, in <module>
        setup_package()
      File "/tmp/pip-req-build-7agkks4g/setup.py", line 488, in setup_package
        setup(**metadata)
      File "/home/john/Sage/sage-9.1.beta2/local/lib/python3.7/site-packages/numpy/distutils/core.py", line 137, in setup
        config = configuration()
      File "/tmp/pip-req-build-7agkks4g/setup.py", line 395, in configuration
        raise NotFoundError(msg)
    numpy.distutils.system_info.NotFoundError: No lapack/blas resources found.

The main Sage config.log file says

configure:22549: result:     openblas-0.3.6.p0 will not be installed (configure check)

Am I doing something wrong?

@kiwifb
Copy link
Member

kiwifb commented Jan 27, 2020

comment:25

Replying to @jhpalmieri:

Am I doing something wrong?

No you are not. This ticket is supposed to deal with the stuff you just experienced. But this ticket is not included in 9.1.beta2, so it is effectively broken for external openblas.

@jhpalmieri
Copy link
Member

comment:26

Replying to @kiwifb:

Replying to @jhpalmieri:

Am I doing something wrong?

No you are not. This ticket is supposed to deal with the stuff you just experienced. But this ticket is not included in 9.1.beta2, so it is effectively broken for external openblas.

I just realized that, too. When I merge this, acipy builds.

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Jan 28, 2020

comment:27

Follow-up = #29071.

@vbraun
Copy link
Member

vbraun commented Jan 31, 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

6 participants