-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
py-numpy: rework blas/lapack #2365
Conversation
7d215e7
to
290deb4
Compare
290deb4
to
86444bc
Compare
there appears to be a bug in |
@tgamblin @alalazo @adamjstewart ping. |
This does not work for MKL so the 'ready' label should be removed. |
Here is a snippet from the build log:
|
I fixed the error you reported, but numpy still does not pick up mkl properly. Frankly, i am not intended to fix it within this PR as I believe it is a problem with numpy's config system. It already fails to work properly even with a single Atlas lib, see numpy/numpy#8294. The authors are considering re-implementing the config:
Thereby, the PR will stay with |
@davydden If you do not intend to have MKL working with this PR then you should raise an error if ^mkl is in the spec. |
I have to say that I disagree with the way MKL is being handled in Spack. Building numpy with MKL is possible using the mkl_rt library and this is documented by Intel, see PR #2361. One could make an argument that a lot of config/build systems are broken upstream. I thought one of the tenets of Spack was to work with build systems as they are and have spack provide convenience but not impose structure. The path here will have Spack without an MKL linked numpy/scipy for an indefinite amount of time. |
FWIW, testing get with |
I think I removed There's one thing that is not clear to me from the discussion above: is using |
@alalazo: thanks!
I actually don't know the answer to this -- @glennpj do you? |
@glennpj :
yes, it is possible, but as @alalazo pointed out
I don't feel like Spack should give away the security of using one-blas-lapack-everywhere only to make
it does not, MKL was not working, and still does not work.
i would not add it to MKL anyhow. I think it is dangerous and should be avoided by all means. The fact that some packages are broken (clearly p.s. either way, i do not plan to do anything with this PR, so feel free to merge it and then someone can take it further with numpy+mkl business. |
I don't mean to change the current default behavior. The changes in #1875 allow to say something like: mkl_rt = spec['mkl:rt'].libs and you'll get the Now: I would do it only if necessary to compile |
Sound good to me! Ps. Just to expand my answer why mkl_rt should be avoided by all means: imagine you build a DAG of packages where (I) one package need 32bit integers in Blas/Lapack (ii) another needs 64 (iii) yet another needs threading (iv) yet another needs serial version. As soon as you use mkl_rt, Spack would happily conferize the whole graph, whereas users of packages may get hard-to-debug segmentation faults. I think one of the key advantage of Spack is that it guarantees that one and only one version of a package is used in DAG (be it complex/real valued, 32/64 bit, threaded or not, etc) and everything is RPATH'ed. |
'^atlas' in spec): | ||
f.write('libraries=%s\n' % names) | ||
f.write('library_dirs=%s\n' % dirs) | ||
|
||
if not ((platform.system() == "Darwin") and | ||
(platform.mac_ver()[0] == '10.12')): | ||
f.write('rpath=%s\n' % ':'.join(lapackblas.directories)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
His the rpath properly taken into account if it is in the section [all/default] when you use openblas, mkl or atlas.
Or should it be placed in all the sections separately ? It was added for #719 so should be easy to check.
If it works fine in the [all/default] section you can also factorize the library_dirs that is the same for all of them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
library_dirs
do NOT work in ALL
(although it's advertised it should), i checked that. I will check if rpath
needs to be in each section separately...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@davydden: Sorry for the delay -- can you rebase? |
a382ac1
to
2d412e0
Compare
including a workaround for MKL due to limited config system of numpy
2d412e0
to
5845905
Compare
@tgamblin i rebased, hopefully the tester will be happy. |
@tgamblin the tester is happy with |
* py-numpy: fix blas/lapack section title * py-numpy: rework BLAS/LAPACK including a workaround for MKL due to limited config system of numpy
* py-numpy: fix blas/lapack section title * py-numpy: rework BLAS/LAPACK including a workaround for MKL due to limited config system of numpy
* py-numpy: fix blas/lapack section title * py-numpy: rework BLAS/LAPACK including a workaround for MKL due to limited config system of numpy
another part of #2361 plus a lots of extras.
tested
py-numpy@1.11.2
by callingfollowed by (see https://github.com/Homebrew/homebrew-python/blob/master/numpy.rb#L123-L126)
on...
macOS Sierra + clang:
spack install py-numpy+blas+lapack ^openblas
Ubuntu 16.04 + GCC5.4:
spack install py-numpy+blas+lapack ^openblas
spack install py-numpy+blas+lapack ^atlas
(mix threaded and non-threaded libs due to upstream)spack install py-numpy+blas+lapack ^mkl
(not working due to upstream)@glennpj ping.