Skip to content

Overhaul numpy package#12170

Merged
adamjstewart merged 15 commits intospack:developfrom
adamjstewart:packages/py-numpy
Aug 6, 2019
Merged

Overhaul numpy package#12170
adamjstewart merged 15 commits intospack:developfrom
adamjstewart:packages/py-numpy

Conversation

@adamjstewart
Copy link
Copy Markdown
Member

@adamjstewart adamjstewart commented Jul 28, 2019

Fixes #3204
Fixes #5327
Fixes #6634
Fixes #7687
Fixes #8616
Closes #8817
Fixes #10361
Fixes #12237

This PR makes the following changes:

Obviously, any big change to the numpy package, which has already gone through a lot of turmoil, will require extensive testing. Here are the platforms and configurations I would like to test before merging this:

macOS 10.14.5, Clang 10.0.1

  • +blas+lapack ^intel-mkl
$ cat ./lib/python3.7/site-packages/numpy/distutils/site.cfg
[mkl]
libraries = mkl_rt
library_dirs = /opt/intel/compilers_and_libraries_2019.4.233/mac/mkl/lib:/usr/lib
rpath = /opt/intel/compilers_and_libraries_2019.4.233/mac/mkl/lib:/usr/lib
include_dirs = /opt/intel/compilers_and_libraries_2019.4.233/mac/mkl/include
$ otool -l $(find . -name '*.so') | sort | uniq
...
         name /usr/lib/libSystem.B.dylib (offset 24)
         name @rpath/libmkl_rt.dylib (offset 24)
         path /Users/Adam/spack/opt/spack/darwin-mojave-x86_64/clang-10.0.1-apple/bzip2-1.0.8-llnc6sqphf7yp4drig6njzzkxctjwfse/lib (offset 12)
         path /Users/Adam/spack/opt/spack/darwin-mojave-x86_64/clang-10.0.1-apple/expat-2.2.5-ivx3l77irr7xnft6v2xduzqier7zlct3/lib (offset 12)
         path /Users/Adam/spack/opt/spack/darwin-mojave-x86_64/clang-10.0.1-apple/gdbm-1.18.1-pvjwideh43qybd2ifi65gjxq2dd6p4nj/lib (offset 12)
         path /Users/Adam/spack/opt/spack/darwin-mojave-x86_64/clang-10.0.1-apple/libffi-3.2.1-rmioaofogfk7efvt3cpb3d433sevjnaf/lib (offset 12)
         path /Users/Adam/spack/opt/spack/darwin-mojave-x86_64/clang-10.0.1-apple/ncurses-6.1-nhodl3ckldkmn6nfzgtymzlsn7mm3htq/lib (offset 12)
         path /Users/Adam/spack/opt/spack/darwin-mojave-x86_64/clang-10.0.1-apple/openssl-1.1.1b-z6erpibfcvzxo5chnvovu3qmet4dzuuv/lib (offset 12)
         path /Users/Adam/spack/opt/spack/darwin-mojave-x86_64/clang-10.0.1-apple/py-numpy-1.17.0-pwyhmfnrnpg264vfofzhyizizwyamjvu/lib (offset 12)
         path /Users/Adam/spack/opt/spack/darwin-mojave-x86_64/clang-10.0.1-apple/py-numpy-1.17.0-pwyhmfnrnpg264vfofzhyizizwyamjvu/lib64 (offset 12)
         path /Users/Adam/spack/opt/spack/darwin-mojave-x86_64/clang-10.0.1-apple/python-3.7.4-jqlxzxpwzdhmrirodxanluofnce5o3ab/lib (offset 12)
         path /Users/Adam/spack/opt/spack/darwin-mojave-x86_64/clang-10.0.1-apple/readline-7.0-kn3u3qhqwktlvjpr47ism2uqqgstvvf2/lib (offset 12)
         path /Users/Adam/spack/opt/spack/darwin-mojave-x86_64/clang-10.0.1-apple/sqlite-3.28.0-mijtevf42dqzctgyaizz44skbyqwxgol/lib (offset 12)
         path /Users/Adam/spack/opt/spack/darwin-mojave-x86_64/clang-10.0.1-apple/xz-5.2.4-snwzcouby3x3ztkutupqzmqwbbxh2tur/lib (offset 12)
         path /Users/Adam/spack/opt/spack/darwin-mojave-x86_64/clang-10.0.1-apple/zlib-1.2.11-nqnlnxddpa4qfz5cnf4grnct57ds25ks/lib (offset 12)
         path /opt/intel/compilers_and_libraries_2019.4.233/mac/mkl/lib (offset 12)
         path /opt/intel/lib (offset 12)
$ cat site.cfg
[blis]
libraries = blis
library_dirs = /Users/Adam/spack/opt/spack/darwin-mojave-x86_64/clang-10.0.1-apple/blis-0.6.0-5adedbjl73c76sqq3izc7d3qxyzksr3t/lib
rpath = /Users/Adam/spack/opt/spack/darwin-mojave-x86_64/clang-10.0.1-apple/blis-0.6.0-5adedbjl73c76sqq3izc7d3qxyzksr3t/lib
include_dirs = /Users/Adam/spack/opt/spack/darwin-mojave-x86_64/clang-10.0.1-apple/blis-0.6.0-5adedbjl73c76sqq3izc7d3qxyzksr3t/include
  • +blas+lapack ^openblas
$ cat ./lib/python3.7/site-packages/numpy/distutils/site.cfg
[openblas]
libraries = openblas
library_dirs = /Users/Adam/spack/opt/spack/darwin-mojave-x86_64/clang-10.0.1-apple/openblas-0.3.6-3yts3o25cqf437oxaa4qzfhiw3swc7j2/lib
rpath = /Users/Adam/spack/opt/spack/darwin-mojave-x86_64/clang-10.0.1-apple/openblas-0.3.6-3yts3o25cqf437oxaa4qzfhiw3swc7j2/lib
include_dirs = /Users/Adam/spack/opt/spack/darwin-mojave-x86_64/clang-10.0.1-apple/openblas-0.3.6-3yts3o25cqf437oxaa4qzfhiw3swc7j2/include
$ otool -l $(find . -name '*.so') | sort | uniq
...
         name /Users/Adam/spack/opt/spack/darwin-mojave-x86_64/clang-10.0.1-apple/openblas-0.3.6-3yts3o25cqf437oxaa4qzfhiw3swc7j2/lib/libopenblas_sandybridge-r0.3.6.dylib (offset 24)
         name /usr/lib/libSystem.B.dylib (offset 24)
         path /Users/Adam/spack/opt/spack/darwin-mojave-x86_64/clang-10.0.1-apple/bzip2-1.0.8-llnc6sqphf7yp4drig6njzzkxctjwfse/lib (offset 12)
         path /Users/Adam/spack/opt/spack/darwin-mojave-x86_64/clang-10.0.1-apple/expat-2.2.5-ivx3l77irr7xnft6v2xduzqier7zlct3/lib (offset 12)
         path /Users/Adam/spack/opt/spack/darwin-mojave-x86_64/clang-10.0.1-apple/gdbm-1.18.1-pvjwideh43qybd2ifi65gjxq2dd6p4nj/lib (offset 12)
         path /Users/Adam/spack/opt/spack/darwin-mojave-x86_64/clang-10.0.1-apple/libffi-3.2.1-rmioaofogfk7efvt3cpb3d433sevjnaf/lib (offset 12)
         path /Users/Adam/spack/opt/spack/darwin-mojave-x86_64/clang-10.0.1-apple/ncurses-6.1-nhodl3ckldkmn6nfzgtymzlsn7mm3htq/lib (offset 12)
         path /Users/Adam/spack/opt/spack/darwin-mojave-x86_64/clang-10.0.1-apple/openblas-0.3.6-3yts3o25cqf437oxaa4qzfhiw3swc7j2/lib (offset 12)
         path /Users/Adam/spack/opt/spack/darwin-mojave-x86_64/clang-10.0.1-apple/openssl-1.1.1b-z6erpibfcvzxo5chnvovu3qmet4dzuuv/lib (offset 12)
         path /Users/Adam/spack/opt/spack/darwin-mojave-x86_64/clang-10.0.1-apple/py-numpy-1.17.0-tt562t4vqgt2jc6j4gkk5rdj6mbakig2/lib (offset 12)
         path /Users/Adam/spack/opt/spack/darwin-mojave-x86_64/clang-10.0.1-apple/py-numpy-1.17.0-tt562t4vqgt2jc6j4gkk5rdj6mbakig2/lib64 (offset 12)
         path /Users/Adam/spack/opt/spack/darwin-mojave-x86_64/clang-10.0.1-apple/python-3.7.4-jqlxzxpwzdhmrirodxanluofnce5o3ab/lib (offset 12)
         path /Users/Adam/spack/opt/spack/darwin-mojave-x86_64/clang-10.0.1-apple/readline-7.0-kn3u3qhqwktlvjpr47ism2uqqgstvvf2/lib (offset 12)
         path /Users/Adam/spack/opt/spack/darwin-mojave-x86_64/clang-10.0.1-apple/sqlite-3.28.0-mijtevf42dqzctgyaizz44skbyqwxgol/lib (offset 12)
         path /Users/Adam/spack/opt/spack/darwin-mojave-x86_64/clang-10.0.1-apple/xz-5.2.4-snwzcouby3x3ztkutupqzmqwbbxh2tur/lib (offset 12)
         path /Users/Adam/spack/opt/spack/darwin-mojave-x86_64/clang-10.0.1-apple/zlib-1.2.11-nqnlnxddpa4qfz5cnf4grnct57ds25ks/lib (offset 12)
$ cat site.cfg
[atlas]
libraries = satlas
library_dirs = /Users/Adam/spack/opt/spack/darwin-mojave-x86_64/clang-10.0.1-apple/atlas-3.10.3-j53o6sg7cswtaak6duqdofi7emddfg6z/lib
rpath = /Users/Adam/spack/opt/spack/darwin-mojave-x86_64/clang-10.0.1-apple/atlas-3.10.3-j53o6sg7cswtaak6duqdofi7emddfg6z/lib
include_dirs = /Users/Adam/spack/opt/spack/darwin-mojave-x86_64/clang-10.0.1-apple/atlas-3.10.3-j53o6sg7cswtaak6duqdofi7emddfg6z/include
  • +blas+lapack ^veclibfort (I think veclib is enough, veclibfort is not required)
$ cat ./lib/python3.7/site-packages/numpy/distutils/site.cfg
[accelerate]
libraries = vecLibFort
library_dirs = /Users/Adam/spack/opt/spack/darwin-mojave-x86_64/clang-10.0.1-apple/veclibfort-0.4.2-ucgnmbinqkiftt2h2roihqbxezvbiwpv/lib
rpath = /Users/Adam/spack/opt/spack/darwin-mojave-x86_64/clang-10.0.1-apple/veclibfort-0.4.2-ucgnmbinqkiftt2h2roihqbxezvbiwpv/lib
$ otool -l $(find . -name '*.so') | sort | uniq
...
         name /usr/lib/libSystem.B.dylib (offset 24)
         path /Users/Adam/spack/opt/spack/darwin-mojave-x86_64/clang-10.0.1-apple/bzip2-1.0.8-llnc6sqphf7yp4drig6njzzkxctjwfse/lib (offset 12)
         path /Users/Adam/spack/opt/spack/darwin-mojave-x86_64/clang-10.0.1-apple/expat-2.2.5-ivx3l77irr7xnft6v2xduzqier7zlct3/lib (offset 12)
         path /Users/Adam/spack/opt/spack/darwin-mojave-x86_64/clang-10.0.1-apple/gdbm-1.18.1-pvjwideh43qybd2ifi65gjxq2dd6p4nj/lib (offset 12)
         path /Users/Adam/spack/opt/spack/darwin-mojave-x86_64/clang-10.0.1-apple/libffi-3.2.1-rmioaofogfk7efvt3cpb3d433sevjnaf/lib (offset 12)
         path /Users/Adam/spack/opt/spack/darwin-mojave-x86_64/clang-10.0.1-apple/ncurses-6.1-nhodl3ckldkmn6nfzgtymzlsn7mm3htq/lib (offset 12)
         path /Users/Adam/spack/opt/spack/darwin-mojave-x86_64/clang-10.0.1-apple/openssl-1.1.1b-z6erpibfcvzxo5chnvovu3qmet4dzuuv/lib (offset 12)
         path /Users/Adam/spack/opt/spack/darwin-mojave-x86_64/clang-10.0.1-apple/py-numpy-1.17.0-bvtdp3tqpak7snvkhnfsutkshtrjk2ri/lib (offset 12)
         path /Users/Adam/spack/opt/spack/darwin-mojave-x86_64/clang-10.0.1-apple/py-numpy-1.17.0-bvtdp3tqpak7snvkhnfsutkshtrjk2ri/lib64 (offset 12)
         path /Users/Adam/spack/opt/spack/darwin-mojave-x86_64/clang-10.0.1-apple/python-3.7.4-jqlxzxpwzdhmrirodxanluofnce5o3ab/lib (offset 12)
         path /Users/Adam/spack/opt/spack/darwin-mojave-x86_64/clang-10.0.1-apple/readline-7.0-kn3u3qhqwktlvjpr47ism2uqqgstvvf2/lib (offset 12)
         path /Users/Adam/spack/opt/spack/darwin-mojave-x86_64/clang-10.0.1-apple/sqlite-3.28.0-mijtevf42dqzctgyaizz44skbyqwxgol/lib (offset 12)
         path /Users/Adam/spack/opt/spack/darwin-mojave-x86_64/clang-10.0.1-apple/veclibfort-0.4.2-ucgnmbinqkiftt2h2roihqbxezvbiwpv/lib (offset 12)
         path /Users/Adam/spack/opt/spack/darwin-mojave-x86_64/clang-10.0.1-apple/xz-5.2.4-snwzcouby3x3ztkutupqzmqwbbxh2tur/lib (offset 12)
         path /Users/Adam/spack/opt/spack/darwin-mojave-x86_64/clang-10.0.1-apple/zlib-1.2.11-nqnlnxddpa4qfz5cnf4grnct57ds25ks/lib (offset 12)
  • +blas+lapack ^netlib-lapack
$ cat ./lib/python3.7/site-packages/numpy/distutils/site.cfg
[blas]
libraries = blas
library_dirs = /Users/Adam/spack/opt/spack/darwin-mojave-x86_64/clang-10.0.1-apple/netlib-lapack-3.8.0-r242vagzpssq7r5za4wfnfha5hrtcj7d/lib
rpath = /Users/Adam/spack/opt/spack/darwin-mojave-x86_64/clang-10.0.1-apple/netlib-lapack-3.8.0-r242vagzpssq7r5za4wfnfha5hrtcj7d/lib
include_dirs = /Users/Adam/spack/opt/spack/darwin-mojave-x86_64/clang-10.0.1-apple/netlib-lapack-3.8.0-r242vagzpssq7r5za4wfnfha5hrtcj7d/include
[lapack]
libraries = lapack
library_dirs = /Users/Adam/spack/opt/spack/darwin-mojave-x86_64/clang-10.0.1-apple/netlib-lapack-3.8.0-r242vagzpssq7r5za4wfnfha5hrtcj7d/lib
rpath = /Users/Adam/spack/opt/spack/darwin-mojave-x86_64/clang-10.0.1-apple/netlib-lapack-3.8.0-r242vagzpssq7r5za4wfnfha5hrtcj7d/lib
include_dirs = /Users/Adam/spack/opt/spack/darwin-mojave-x86_64/clang-10.0.1-apple/netlib-lapack-3.8.0-r242vagzpssq7r5za4wfnfha5hrtcj7d/include
$ otool -l $(find . -name '*.so') | sort | uniq
...
         name /usr/lib/libSystem.B.dylib (offset 24)
         name @rpath/libblas.3.dylib (offset 24)
         name @rpath/libcblas.3.dylib (offset 24)
         name @rpath/liblapack.3.dylib (offset 24)
         path /Users/Adam/spack/opt/spack/darwin-mojave-x86_64/clang-10.0.1-apple/bzip2-1.0.8-llnc6sqphf7yp4drig6njzzkxctjwfse/lib (offset 12)
         path /Users/Adam/spack/opt/spack/darwin-mojave-x86_64/clang-10.0.1-apple/expat-2.2.5-ivx3l77irr7xnft6v2xduzqier7zlct3/lib (offset 12)
         path /Users/Adam/spack/opt/spack/darwin-mojave-x86_64/clang-10.0.1-apple/gdbm-1.18.1-pvjwideh43qybd2ifi65gjxq2dd6p4nj/lib (offset 12)
         path /Users/Adam/spack/opt/spack/darwin-mojave-x86_64/clang-10.0.1-apple/libffi-3.2.1-rmioaofogfk7efvt3cpb3d433sevjnaf/lib (offset 12)
         path /Users/Adam/spack/opt/spack/darwin-mojave-x86_64/clang-10.0.1-apple/ncurses-6.1-nhodl3ckldkmn6nfzgtymzlsn7mm3htq/lib (offset 12)
         path /Users/Adam/spack/opt/spack/darwin-mojave-x86_64/clang-10.0.1-apple/netlib-lapack-3.8.0-r242vagzpssq7r5za4wfnfha5hrtcj7d/lib (offset 12)
         path /Users/Adam/spack/opt/spack/darwin-mojave-x86_64/clang-10.0.1-apple/openssl-1.1.1b-z6erpibfcvzxo5chnvovu3qmet4dzuuv/lib (offset 12)
         path /Users/Adam/spack/opt/spack/darwin-mojave-x86_64/clang-10.0.1-apple/py-numpy-1.17.0-z6fmbjnxdegdbxzavacnimooqg3obs6n/lib (offset 12)
         path /Users/Adam/spack/opt/spack/darwin-mojave-x86_64/clang-10.0.1-apple/py-numpy-1.17.0-z6fmbjnxdegdbxzavacnimooqg3obs6n/lib64 (offset 12)
         path /Users/Adam/spack/opt/spack/darwin-mojave-x86_64/clang-10.0.1-apple/python-3.7.4-jqlxzxpwzdhmrirodxanluofnce5o3ab/lib (offset 12)
         path /Users/Adam/spack/opt/spack/darwin-mojave-x86_64/clang-10.0.1-apple/readline-7.0-kn3u3qhqwktlvjpr47ism2uqqgstvvf2/lib (offset 12)
         path /Users/Adam/spack/opt/spack/darwin-mojave-x86_64/clang-10.0.1-apple/sqlite-3.28.0-mijtevf42dqzctgyaizz44skbyqwxgol/lib (offset 12)
         path /Users/Adam/spack/opt/spack/darwin-mojave-x86_64/clang-10.0.1-apple/xz-5.2.4-snwzcouby3x3ztkutupqzmqwbbxh2tur/lib (offset 12)
         path /Users/Adam/spack/opt/spack/darwin-mojave-x86_64/clang-10.0.1-apple/zlib-1.2.11-nqnlnxddpa4qfz5cnf4grnct57ds25ks/lib (offset 12)
  • ~blas~lapack
$ cat ./lib/python3.7/site-packages/numpy/distutils/site.cfg
cat: ./lib/python3.7/site-packages/numpy/distutils/site.cfg: No such file or directory
$ otool -l $(find . -name '*.so') | sort | uniq
...
         name /usr/lib/libSystem.B.dylib (offset 24)
         path /Users/Adam/spack/opt/spack/darwin-mojave-x86_64/clang-10.0.1-apple/bzip2-1.0.8-llnc6sqphf7yp4drig6njzzkxctjwfse/lib (offset 12)
         path /Users/Adam/spack/opt/spack/darwin-mojave-x86_64/clang-10.0.1-apple/expat-2.2.5-ivx3l77irr7xnft6v2xduzqier7zlct3/lib (offset 12)
         path /Users/Adam/spack/opt/spack/darwin-mojave-x86_64/clang-10.0.1-apple/gdbm-1.18.1-pvjwideh43qybd2ifi65gjxq2dd6p4nj/lib (offset 12)
         path /Users/Adam/spack/opt/spack/darwin-mojave-x86_64/clang-10.0.1-apple/libffi-3.2.1-rmioaofogfk7efvt3cpb3d433sevjnaf/lib (offset 12)
         path /Users/Adam/spack/opt/spack/darwin-mojave-x86_64/clang-10.0.1-apple/ncurses-6.1-nhodl3ckldkmn6nfzgtymzlsn7mm3htq/lib (offset 12)
         path /Users/Adam/spack/opt/spack/darwin-mojave-x86_64/clang-10.0.1-apple/openssl-1.1.1b-z6erpibfcvzxo5chnvovu3qmet4dzuuv/lib (offset 12)
         path /Users/Adam/spack/opt/spack/darwin-mojave-x86_64/clang-10.0.1-apple/py-numpy-1.17.0-gkuufd4mljdukrciubhmvpxuiflny22x/lib (offset 12)
         path /Users/Adam/spack/opt/spack/darwin-mojave-x86_64/clang-10.0.1-apple/py-numpy-1.17.0-gkuufd4mljdukrciubhmvpxuiflny22x/lib64 (offset 12)
         path /Users/Adam/spack/opt/spack/darwin-mojave-x86_64/clang-10.0.1-apple/python-3.7.4-jqlxzxpwzdhmrirodxanluofnce5o3ab/lib (offset 12)
         path /Users/Adam/spack/opt/spack/darwin-mojave-x86_64/clang-10.0.1-apple/readline-7.0-kn3u3qhqwktlvjpr47ism2uqqgstvvf2/lib (offset 12)
         path /Users/Adam/spack/opt/spack/darwin-mojave-x86_64/clang-10.0.1-apple/sqlite-3.28.0-mijtevf42dqzctgyaizz44skbyqwxgol/lib (offset 12)
         path /Users/Adam/spack/opt/spack/darwin-mojave-x86_64/clang-10.0.1-apple/xz-5.2.4-snwzcouby3x3ztkutupqzmqwbbxh2tur/lib (offset 12)
         path /Users/Adam/spack/opt/spack/darwin-mojave-x86_64/clang-10.0.1-apple/zlib-1.2.11-nqnlnxddpa4qfz5cnf4grnct57ds25ks/lib (offset 12)

Linux CentOS 7, GCC 4.8.5

  • +blas+lapack ^intel-mkl
$ cat ./lib/python3.7/site-packages/numpy/distutils/site.cfg
[mkl]
libraries = mkl_rt
library_dirs = /home/adamjs5/spack/opt/spack/linux-centos7-x86_64/gcc-4.8.5/intel-mkl-2019.3.199-dwmyyb66bsnoisor6fmvcx4j6akq7cgg/compilers_and_libraries_2019.3.199/linux/mkl/lib/intel64:/lib64
rpath = /home/adamjs5/spack/opt/spack/linux-centos7-x86_64/gcc-4.8.5/intel-mkl-2019.3.199-dwmyyb66bsnoisor6fmvcx4j6akq7cgg/compilers_and_libraries_2019.3.199/linux/mkl/lib/intel64:/lib64
include_dirs = /home/adamjs5/spack/opt/spack/linux-centos7-x86_64/gcc-4.8.5/intel-mkl-2019.3.199-dwmyyb66bsnoisor6fmvcx4j6akq7cgg/compilers_and_libraries_2019.3.199/linux/mkl/include
$ ldd -r $(find . -name '*.so') | sort | uniq
...
	libmkl_rt.so => /home/adamjs5/spack/opt/spack/linux-centos7-x86_64/gcc-4.8.5/intel-mkl-2019.3.199-dwmyyb66bsnoisor6fmvcx4j6akq7cgg/compilers_and_libraries_2019.3.199/linux/mkl/lib/intel64/libmkl_rt.so (0x00007f516259e000)
$ cat site.cfg
[blis]
libraries = blis
library_dirs = /home/adamjs5/spack/opt/spack/linux-centos7-x86_64/gcc-4.8.5/blis-0.6.0-k46gjp3oke6i2z2c3jmhgnfexc3jpkqw/lib
rpath = /home/adamjs5/spack/opt/spack/linux-centos7-x86_64/gcc-4.8.5/blis-0.6.0-k46gjp3oke6i2z2c3jmhgnfexc3jpkqw/lib
include_dirs = /home/adamjs5/spack/opt/spack/linux-centos7-x86_64/gcc-4.8.5/blis-0.6.0-k46gjp3oke6i2z2c3jmhgnfexc3jpkqw/include
  • +blas+lapack ^openblas
$ cat ./lib/python3.7/site-packages/numpy/distutils/site.cfg
[openblas]
libraries = openblas
library_dirs = /home/adamjs5/spack/opt/spack/linux-centos7-x86_64/gcc-4.8.5/openblas-0.3.6-2wdlwxcbb44em2a2eukduuaqxteko3of/lib
rpath = /home/adamjs5/spack/opt/spack/linux-centos7-x86_64/gcc-4.8.5/openblas-0.3.6-2wdlwxcbb44em2a2eukduuaqxteko3of/lib
include_dirs = /home/adamjs5/spack/opt/spack/linux-centos7-x86_64/gcc-4.8.5/openblas-0.3.6-2wdlwxcbb44em2a2eukduuaqxteko3of/include
$ ldd -r $(find . -name "*.so") | sort | uniq
...
	libopenblas.so.0 => /home/adamjs5/spack/opt/spack/linux-centos7-x86_64/gcc-4.8.5/openblas-0.3.6-2wdlwxcbb44em2a2eukduuaqxteko3of/lib/libopenblas.so.0 (0x00007f1a7769f000)
$ cat ./lib/python3.7/site-packages/numpy/distutils/site.cfg
[flame]
libraries = flame
library_dirs = /home/adamjs5/spack/opt/spack/linux-centos7-x86_64/gcc-4.8.5/libflame-master-xmo2dhpugpfgb4zetev2lcccvdgybjog/lib
rpath = /home/adamjs5/spack/opt/spack/linux-centos7-x86_64/gcc-4.8.5/libflame-master-xmo2dhpugpfgb4zetev2lcccvdgybjog/lib
include_dirs = /home/adamjs5/spack/opt/spack/linux-centos7-x86_64/gcc-4.8.5/libflame-master-xmo2dhpugpfgb4zetev2lcccvdgybjog/include
  • +blas+lapack ^atlas
$ cat ./lib/python3.7/site-packages/numpy/distutils/site.cfg
[atlas]
libraries = satlas
library_dirs = /home/adamjs5/spack/opt/spack/linux-centos7-x86_64/gcc-4.8.5/atlas-3.10.2-a32yghlhsmlartth4vxyrn2cswzbotlu/lib
rpath = /home/adamjs5/spack/opt/spack/linux-centos7-x86_64/gcc-4.8.5/atlas-3.10.2-a32yghlhsmlartth4vxyrn2cswzbotlu/lib
include_dirs = /home/adamjs5/spack/opt/spack/linux-centos7-x86_64/gcc-4.8.5/atlas-3.10.2-a32yghlhsmlartth4vxyrn2cswzbotlu/include
$ ldd -r $(find . -name "*.so") | sort | uniq
...
	/home/adamjs5/spack/opt/spack/linux-centos7-x86_64/gcc-4.8.5/atlas-3.10.2-a32yghlhsmlartth4vxyrn2cswzbotlu/lib/libsatlas.so (0x00007f4ebaf1e000)
  • +blas+lapack ^netlib-lapack
$ cat ./lib/python3.7/site-packages/numpy/distutils/site.cfg
[blas]
libraries = blas
library_dirs = /home/adamjs5/spack/opt/spack/linux-centos7-x86_64/gcc-4.8.5/netlib-lapack-3.8.0-c5uo7hykg6txcixdohlsmixphc5ikf4b/lib64
rpath = /home/adamjs5/spack/opt/spack/linux-centos7-x86_64/gcc-4.8.5/netlib-lapack-3.8.0-c5uo7hykg6txcixdohlsmixphc5ikf4b/lib64
include_dirs = /home/adamjs5/spack/opt/spack/linux-centos7-x86_64/gcc-4.8.5/netlib-lapack-3.8.0-c5uo7hykg6txcixdohlsmixphc5ikf4b/include
[lapack]
libraries = lapack
library_dirs = /home/adamjs5/spack/opt/spack/linux-centos7-x86_64/gcc-4.8.5/netlib-lapack-3.8.0-c5uo7hykg6txcixdohlsmixphc5ikf4b/lib64
rpath = /home/adamjs5/spack/opt/spack/linux-centos7-x86_64/gcc-4.8.5/netlib-lapack-3.8.0-c5uo7hykg6txcixdohlsmixphc5ikf4b/lib64
include_dirs = /home/adamjs5/spack/opt/spack/linux-centos7-x86_64/gcc-4.8.5/netlib-lapack-3.8.0-c5uo7hykg6txcixdohlsmixphc5ikf4b/include
$ ldd -r $(find . -name "*.so") | sort | uniq
...
	libblas.so.3 => /home/adamjs5/spack/opt/spack/linux-centos7-x86_64/gcc-4.8.5/netlib-lapack-3.8.0-c5uo7hykg6txcixdohlsmixphc5ikf4b/lib64/libblas.so.3 (0x00007f0034177000)
	libcblas.so.3 => /home/adamjs5/spack/opt/spack/linux-centos7-x86_64/gcc-4.8.5/netlib-lapack-3.8.0-c5uo7hykg6txcixdohlsmixphc5ikf4b/lib64/libcblas.so.3 (0x00007f00343cf000)
	liblapack.so.3 => /home/adamjs5/spack/opt/spack/linux-centos7-x86_64/gcc-4.8.5/netlib-lapack-3.8.0-c5uo7hykg6txcixdohlsmixphc5ikf4b/lib64/liblapack.so.3 (0x00007f726f796000)
  • ~blas~lapack
$ cat ./lib/python3.7/site-packages/numpy/distutils/site.cfg
cat: ./lib/python3.7/site-packages/numpy/distutils/site.cfg: No such file or directory
$ ldd -r $(find . -name '*.so') | sort | uniq
...
no linkage to blas/lapack

Caveats

  • I only plan on testing the latest version of numpy, this PR may break older versions
  • I only plan on testing Python 3, as numpy no longer supports Python 2
  • I only plan on testing supported BLAS/LAPACK configurations, not BLAS providers like essl or netlib-xblas
  • I don't plan on testing mixed BLAS/LAPACK configurations, like ^blis ^libflame, but they should work
  • This PR does not try to tackle the many build problems that Intel users face. That can be saved for another PR

@scheibelp @huqy @robbmcleod @scottwittenburg @s-sajid-ali

@s-sajid-ali
Copy link
Copy Markdown
Contributor

@adamjstewart : Could numpy+libflame be added to verify the functionality ?

@scheibelp
Copy link
Copy Markdown
Member

As I mention in #10383 (comment), it is likely worthwhile to:

@adamjstewart
Copy link
Copy Markdown
Member Author

As I mention in #10383 (comment), it is likely worthwhile to:

I'm hesitant to add this back as it greatly increases the complexity of the package and has never been recommended by the developers. I'm afraid it might break more things than we realized, not just in 1.17.0 and not just numexpr. I would rather:

  1. tell users to upgrade to a newer version of numpy, or
  2. tell users they can try to backport BLD: Allow users to specify BLAS and LAPACK library link order numpy/numpy#13132 to older versions of numpy

@adamjstewart
Copy link
Copy Markdown
Member Author

Can someone test another platform/compiler for me? Spack is broken on Blue Waters (#12187) and I'm unable to build even a basic py-numpy~blas~lapack on the other system I have access to (numpy/numpy#14182). I'm also fine with just merging this at this point. I think it's pretty robust.

@s-sajid-ali
Copy link
Copy Markdown
Contributor

I'll re-run the test script I created for #8817 with this branch and get back with the results in a few days.

@adamjstewart
Copy link
Copy Markdown
Member Author

Thanks @s-sajid-ali. You should be able to run:

$ spack install --test=root py-numpy +blas+lapack ^intel-mkl
$ cd $(spack location -i py-numpy +blas+lapack ^intel-mkl)
$ cat ./lib/python3.7/site-packages/numpy/distutils/site.cfg
$ ldd -r $(find . -name '*.so') | sort | uniq

for every combination. We want to make sure that a) the site.cfg is formatted correctly, b) the install passes all unit tests, including import tests, and c) rpath correctly links to the right libraries.

@scheibelp
Copy link
Copy Markdown
Member

I would rather:
tell users to upgrade to a newer version of numpy, or

IMO that's problematic because 1.17.x is Python 3 only and Python 2 is still supported for a short while longer.

tell users they can try to backport numpy/numpy#13132 to older versions of numpy

That seems like a big ask

https://github.com/numpy/numpy/commit/0f19dae081e6678902826b195e0d3857c5b4c2b3 minus the .travis.yml changes (attached) appears to apply cleanly.

If we merge this without addressing some 1.16.x version an issue should be opened and hopefully that patch will be sufficient.

@adamjstewart
Copy link
Copy Markdown
Member Author

@scheibelp does the latest commit address your concerns?

@scheibelp
Copy link
Copy Markdown
Member

does the latest commit address your concerns?

yes

@adamjstewart adamjstewart mentioned this pull request Aug 6, 2019
@s-sajid-ali
Copy link
Copy Markdown
Contributor

s-sajid-ali commented Aug 6, 2019

WIP

CentOS/Py 3.6.8 Intel-MKL OpenBLAS BLIS libFLAME libFLAME+BLIS
GCC 9.1.0 Pass Pass Pass Fail 1,2,3 Fail 1,2,3
Intel19 [] [] [] [] []

py-numpy fails to link to any variant of libFLAME (release, master, static, shared) and complains of undefined references of BLAS functions from the libflame library. When I attempted to build py-numpy+blis+libflame, I ended up building py-numpy+blis~libflame

@adamjstewart
Copy link
Copy Markdown
Member Author

Okay, I think this PR is complete from my end. I've tested most common configurations and reported bugs upstream when I wasn't able to get them working. If anyone wants to see any more tests, let me know. Otherwise, I think this PR is finally ready to merge!

@adamjstewart adamjstewart merged commit 66e9b12 into spack:develop Aug 6, 2019
@adamjstewart adamjstewart deleted the packages/py-numpy branch August 6, 2019 23:20
likask added a commit to likask/spack that referenced this pull request Aug 7, 2019
…upsream_develop

* commit 'f7026a058b63f5a3109691e2c3871ee77c08f756': (1881 commits)
  Version 19.8.1 of PLASMA  (spack#12299)
  new package: py-exodus (spack#12291)
  ncurses: fix pic and opt flags (spack#12272)
  pumi: new version 2.2.1 (spack#12282)
  tests: explain and test dependency flattening routines (spack#11993)
  graphviz package: add MacOS fixes and quartz support (spack#11128)
  Overhaul numpy package (spack#12170)
  mirrors: mirror config should use spack variable expansions (spack#9027)
  stacks: fix reference handling in env.write() (spack#12096)
  fltk: fix about variable types (spack#12292)
  Avoid sending empty reports to codecov (spack#12293)
  Packages/musl (spack#12288)
  c-blosc package: Add -std=gnu99 flag for gcc (spack#11959)
  Move new packages from tutorial to builtin (spack#12289)
  Balay/amrex 19.08 (spack#12287)
  openPMD-api: pre-load depend libs (spack#12279)
  Add version 19.8.0 of PLASMA (spack#12275)
  Add version 2.5.1 of MAGMA released today (spack#12274)
  ginkgo: add maintainers (spack#12273)
  new package: py-backports-tempfile (spack#12261)
  ...

# Conflicts:
#	.travis.yml
#	var/spack/repos/builtin/packages/moab/package.py
#	var/spack/repos/builtin/packages/mofem-cephas/package.py
#	var/spack/repos/builtin/packages/mofem-fracture-module/package.py
#	var/spack/repos/builtin/packages/mofem-users-modules/package.py
#	var/spack/repos/builtin/packages/petsc/package.py
dev-zero pushed a commit to dev-zero/spack that referenced this pull request Aug 13, 2019
* Add numpy 1.17.0

* Overhaul numpy package

* Flake8 fixes

* Undefined reference fix

* HeaderList and LibraryList need an arg

* veclibfort has no headers

* Add patch for older versions of py-numpy

* Remove py-meep hack from py-numpy package

* libflame: always add max arg hack flag

* Fix build with GCC 4.8

* Compiler flags come from self.compiler

* Only apply -std=c99 to cflags

* Try to fix libflame package

* Fix ATLAS build on macOS

* --force-clang flag added in 3.10.3
@adamjstewart
Copy link
Copy Markdown
Member Author

Update: the blis issues were finally resolved in #12869

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

3 participants