Hi all,
I am struggling with a strange problem with virtual packages and specs. I could bring it down to a "small" reproducer (*). Let's take a fake package that depends on both
depends_on("py-scipy")
depends_on("py-numpy")
In my RHEL6 setup that immediately results in an invalid spec error (*). Having a closer look we have the following dependency:
"py-scipy" -> "lapack" (a virtual package)
"py-numpy" -> "netlib-lapack" (a concrete package)
On resolving the virtual package "lapack" spack picks up the default variant (~shared), while "py-numpy" explicitly asks for the +shared variant. And hence the conflict. I guess that's not the desired behaviour of how virtual packages should be resolved?
In the minimal reproducer w/ py-scipy and py-numpy, I could get things running after adding the two following constrains:
depends_on("netlib-lapack+shared")
depends_on("netlib-blas+fpic")
Unfortunately I was hit by yet another feature that doesn't look that obvious. For this there is a second reproducer (**) using a toy package w/ the following dependencies:
depends_on("eigen")
depends_on("netlib-blas+fpic")
depends_on("netlib-lapack+shared")
depends_on("py-scipy")
depends_on("py-numpy")
depends_on("py-matplotlib")
I end up with a "Multiple providers found for 'lapack'" as shown below (**). It is particularly strange as adding/removing the totally unrelated eigen has an impact on how lapack gets resolved.
Any help or idea is appreciated.
Thanks,
Benedikt
(*)
git clone
https://github.com/hegner/spack.git -b bug_virtualpackages
cd spack
./bin/spack install reproducer
==> Error: Invalid spec: 'netlib...@3.5.0%g...@4.4.7~shared=linux-x86_64^cm...@3.4.3%g...@4.4.7+ncurses=linux-x86_64^ncurses@6.0%g...@4.4.7=linux-x86_64^netli...@3.5.0%g...@4.4.7~fpic=linux-x86_64'. Package netlib-lapack requires variant +shared, but spec asked for ~shared
(**)
./bin/spack install reproducer2
==> Error: Multiple providers found for 'lapack': ['netlib-lapack+shared', 'netlib...@3.5.0%g...@4.4.7+shared=linux-x86_64^cm...@3.4.3%g...@4.4.7+ncurses=linux-x86_64^ncurses@6.0%g...@4.4.7=linux-x86_64^netli...@3.5.0%g...@4.4.7+fpic=linux-x86_64']