-
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
libpciaccess cannot be built with PGI compilers #481
Conversation
Actually, hold off on merging this for now. There's something I want to test first... |
Unfortunately, my changes in #493 didn't fix this problem, so I'm reopening this PR. If anyone can figure out how to get PGI to install libpciaccess without this hack, please let me know. |
While I was at it, I submitted a bug report with Xorg to see if they can get to the bottom of why I am unable to install libpciaccess. |
Keep me posted. Does it make sense to merge in the meantime? I am not a huge fan of the "just make a lib directory" stuff (as I would rather have an optional dependency from things that depend on this). Would that be a better temporary fix? |
I would also prefer to have an optional dependency than a "fake" install. This is just what @eschnett suggested since he did the same for OS X. But that may have been before optional dependencies had been implemented. On Monday I'm going to contact PGI to see if they can help. In the meantime, I guess this can be left alone since no one else has complained about it and I don't need it right away. If PGI can't help me, I'll rewrite this PR to make libpciaccess an optional dependency of hwloc for OS X and PGI. I'll close this for now. |
I submitted a bug report with PGI and they confirmed that this is a bug. Since they haven't yet offered a patch, I'm reopening this PR. We have two options:
@tgamblin: It sounds like you would prefer option 2. hwloc and py-pandas are currently the only packages that depend on libpciaccess, so it wouldn't be that bad. Is there currently any way to specify that a package depends_on another package when multiple conditions are not met? Specifically, the architecture is not |
You probably want to make this a variant, since building both with and without should work in the "normal" cases. The variant's default can be as complex as needs to be, as it's a simple boolean expression. The dependency is then simply enabled by the variant. This also makes the package decision explicit. |
That was my second thought. But the problem is that I can't use |
You can access the architecture as If a compiler is broken (or a package is broken with a particular compiler), then maybe it's not a good idea to change the default behaviour. Instead, maybe an error message would be best, recommending to manually choose a variant that works. |
You can get away with Erik's suggestion at least for the if sys.platform != 'darwin':
depends_on('libpciaccess') And that will work, because we don't do cross-compiles (yet), and you know that Spack is running on the same arch it builds on. The better platform/OS/target support that we've talked about at telcons should allow you to do this kind of thing with Another question would be whether you'd rather just have |
In general, I think having a versatile depends_on('libpciaccess', unless=['=darwin', '%pgi']) With this design, a user could specify an unlimited number of conditions that need to be met. They could also combine depends_on('libpciaccess', unless=['=darwin', '%pgi']) could translate to "don't depend on libpciaccess if arch is darwin or compiler is pgi, and: depends_on('libpciaccess', unless=[['=darwin', '%pgi']]) could translate to "don't depend on libpciaccess if arch is darwin and compiler is pgi. Note the use of double brackets. That way we could develop a sufficiently complicated conditional using nested lists. Something like I'm not sure how I feel about the alternative of using the system compiler. It won't solve the problems with Darwin, so we would end up using both. It certainly sounds like the easiest solution; it just feels like we're cheating in a way. But then again, not depending on it at all requires us to use the pre-installed system installations, which probably weren't built with PGI. I would prefer to use the stuff from #120 than add a |
I really like the What I am not sure about is how depends_on('libfoo', unless='^libbar')
depends_on('libbar', when='^libfoo') I think what is needed is a more sophisticated constraint solver, and that will take time. The other avenue would be to disallow I'm game for at least adding |
@adamjstewart just fyi, for the time being you can use #299 to evaluate a predicate after |
@adamjstewart @alalazo PR #299 has been merged into the mainline, so that functionality is there if you choose to use it. |
Now that I think about it, maybe depends_on('libpciaccess', when=depends_on_libpciaccess)
def depends_on_libpciaccess(self, spec, version):
if spec.satisfies('=darwin-x86_64') or spec.satisfies('%pgi')
return False
else:
return True This way we have complete control over exactly what we want, and it is much easier to comprehend. |
One final thought I want to get out of my head. Let's suppose we have 2 packages, A and B, and 3 compilers, X, Y, and Z. A depends on B. B can be built with compilers X and Y, but not Z. So far, this is identical to the situation we have with libpciaccess. However, what if B is not already installed on the system and A cannot be built without it. The way that I would envision Spack handling this would be: spack install A %X # build A and B with X
spack install A %Y # build A and B with Y
spack install A %Z # build A with Z but B with X or Y This is similar to the idea of setting a preferred compiler for B, except that it doesn't always build with X. For example, I want libpciaccess to be built with GCC (or whatever is the current default compiler) if and only if I try to build it with PGI. Man, dependency resolution is confusing 0_o |
I'm going to close this PR for now. It may still be wise to add some logic that will allow us to mark packages as not-buildable on certain platforms or with specific compilers. But for now, I am content with adding |
I don't think libpciaccess can be built with PGI compilers. The only way I was able to build OpenMPI was to trick Spack into thinking I installed libpciaccess as was done for Darwin in #257. If anyone can figure out how to build libpciaccess with PGI I will be more than happy to close this PR.
See https://groups.google.com/forum/#!topic/spack/JX2hsOyXSdk for the relevant discussion. Thanks to @eschnett for the suggestion.