-
-
Notifications
You must be signed in to change notification settings - Fork 481
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
spkg-configure.m4 for $(BLAS) (i.e. atlas and openblas) #27870
Comments
comment:1
Yes, we should probably get rid of some of the ATLAS-specific stuff (or re-appropriate it). The thing about a lot of the ATLAS stuff is that it doesn't actually care that much about having ATLAS BLAS; the way much of it is written it will work if it can find some BLAS anywhere. That's why on Cygwin it works when you install the lapack package, because it comes with a built-in netlib BLAS. It has nothing to do with ATLAS. It would make sense to have an option to look for openblas if it exists, or else fall back on a generic BLAS if one can be found via various sources (pkg-config, some autoconf tests, etc.). |
comment:2
As the Sage-8.8 release milestone is pending, we should delete the sage-8.8 milestone for tickets that are not actively being worked on or that still require significant work to move forward. If you feel that this ticket should be included in the next Sage release at the soonest please set its milestone to the next release milestone (sage-8.9). |
Commit: |
comment:5
Debian has all the needed .pc files, so there it appears to work. New commits:
|
comment:7
That's certainly better than nothing. There should probably also be a check in |
comment:8
One can only check for But I don't know how to look for |
comment:9
One can fill in templates for |
comment:10
OK, in fact one get the location of
(this works), and the corresponding autoconf macro (not tested yet):
|
comment:12
this is a minimal fix for the use of system's openblas, identifiable from pkg-config. I have not touched Atlas installation procedure. |
Author: Dima Pasechnik |
comment:13
Well... I did I guess that testing your patch involves either |
comment:14
Replying to @EmmanuelCharpentier:
Not only this :-)
on OSX for some reason I also needed to
One naturally is interested in testing against system's openblas: e.g. on debian and derived systems one needs On OSX's Homebrew one would need |
comment:15
There is a larger mess to deal with here, but TBH I'm fine with solving it one piece at a time. It looks like a few packages (R, numpy,... ?) do use pkg-config to discover information about the blas/lapack being used. And our pkg-config is hacked (build/pkgs/pkgconf/patches/pkg-config.in) to look in a custom directory for .pc files if they aren't found on the system. So I think the idea was that if pkg-config couldn't find e.g. lapack.pc, that it would then look in SAGE_LOCAL to find it. This only raises more questions. If openblas is installed on the system, can we count on the system pkg-config to know that the system blas/lapack are just the system openblas? If so, then we shouldn't need to create "fallback" symlinks. If not, would linking to some other blas/lapack cause problems? Why don't those packages check for openblas or atlas directly instead of "blas" and "lapack", in that case? And so on. Your approach looks better the deeper I go. |
comment:16
I more or less copy the logic of openblas/dpkg-install - which does install openblas.pc under 3 different names - openblas, blas, and lapack. |
comment:17
I tried this (meaning
but
There are also various warnings in the |
comment:18
scipy depends on numpy to supply blas interface, so something goes wrong with numpy installation (it is weird that it foes not fail). it works for me on Debian 10. numpy has its own extermely convoluted configure routine, which emits a lot of noise about not finding this or that. Could you try building numpy with SAGE_CHECK ? |
comment:19
Replying to @dimpase:
Yeah I agree with that. Maybe two years from now, no one is using atlas any more and this is easy to clean up by dropping support for it and by having those other packages call |
comment:20
Replying to @jhpalmieri:
FWIW numpy is one of those packages that uses pkg-config to find these libraries; see build/pkgs/numpy/lapack_conf.py. |
comment:21
Apart from Atlas and openblas there are other perfectly ok implementations of blas and lapack, which may be used. |
comment:22
e.g. there are highly optimised by hardware vendors blas and lapacks (e.g. MKL) |
Changed branch from |
Commit: |
Branch pushed to git repo; I updated commit sha1 and set ticket back to needs_review. This was a forced push. New commits:
|
comment:70
trivial rebase over updated #28883 |
comment:72
Currently doesn't detect system openblas on Cygwin (which just gets installed as the generic libblas when you install it). Not sure why yet. I won't hold up this ticket over it but if I can find a quick fix I might like to do that. |
comment:73
what does |
comment:74
Replying to @embray:
I see; it's simply that Cygwin does not install an openblas.pc. That's annoying. I'll see if I can get that fixed upstream. In the meantime we can just leave this as-is. I think as a broader improvement to the current situation it's worth recognizing that the spkg-install for "atlas" actually does two things:
These two cases seem to be quite at odds with each-other, and the naming of I think what we should do is this (in a separate ticket):
|
comment:75
iirc, SAGE_ATLAS_LIB is used for two rather different purposes. So there is some cleaning up due. |
comment:76
Replying to @dimpase:
The only use of it I could find was in |
Changed branch from u/dimpase/packages/openblas/openblasconf to |
comment:78
Apparently my rather old Ubuntu lacks a
(I don't know why it complains first about I'm going to look into it. |
Changed commit from |
comment:79
you must have a past-EOL Ubuntu, I gather. |
comment:80
Replying to @embray:
Perhaps the idea of a "generic package" is overcomplicated for now. Although it's something I've wanted to try to do in the past (#23465) but as a first pass detection of a "generic blas" can live in the spkg-configure.m4 for openblas (sort of as we do with gmp/mpir). |
comment:81
On the third-hand, because of the way the Sage build uses .pc files for cblas and lapack, and the fact that both the openblas and atlas SPKGs install these .pc files into SAGE_LOCAL, I understand now that even when we detect a system openblas, this ticket uses I don't really like this, because part of my long-term goals has been to make it so that running I'm going to see if I can come up with an alternative solution to this... |
one needs to understand the existing design first.
(as far as I can see) currently Sage generates *.pc files for pkg-config, for blas, cblas, and lapack. This is done for Atlas (and for external blas/lapack fed in by
SAGE_ATLAS_LIB
?). For openblas these *.pc files are basically all point to the same library.how are they used? Are they all used?
is the description of
SAGE_ATLAS_LIB
outdated? I cannot imagine any need for f77 libraries in 2019...Depends on #28883
CC: @embray @vbraun @sagetrac-tmonteil @mezzarobba @orlitzky @EmmanuelCharpentier @kiwifb @isuruf @mkoeppe
Component: build: configure
Author: Dima Pasechnik
Branch:
81bf522
Reviewer: Isuru Fernando
Issue created by migration from https://trac.sagemath.org/ticket/27870
The text was updated successfully, but these errors were encountered: