Overhaul of CMake package and compression libraries#1412
Overhaul of CMake package and compression libraries#1412tgamblin merged 7 commits intospack:developfrom
Conversation
|
@mathstuf: can you look at this one? @adamjstewart: At this point, we can probably add some logic to make CMake (and other build dependencies) build with the default front-end compiler rather than a "custom" compiler. This would probably solve a lot of problems with bringing in build dependencies, in that it wouldn't require build dependencies to work with fancy back-end compilers. What do you think? |
|
@tgamblin I would very much approve of that. I really don't care what compiler build dependencies are built with, so if they always just built with GCC, I would have fewer duplicate CMake installations. |
|
There are nightly dashboards for CMake with the Intel compiler: 11.0 for 32-bit Windows and 64-bit, and 12.0 on OS X 10.7. I don't see any Linux builders though. What version of the compiler? |
|
Oh, and an Intel 15.0 for 64-bit Windows build as well. |
| version('2.2.0', '2f47841c829facb346eb6e3fab5212e2', | ||
| url="http://downloads.sourceforge.net/project/expat/expat/2.2.0/expat-2.2.0.tar.bz2") | ||
| version('2.1.0', 'dd7dab7a5fea97d2a6a43f511449b7cd', | ||
| url="http://downloads.sourceforge.net/project/expat/expat/2.1.0/expat-2.1.0.tar.gz") |
There was a problem hiding this comment.
From what I can tell, version 2.2.0 only has a bzip2 tarball and 2.1.0 only has a gzip tarball, hence the different URLs.
|
@mathstuf I had this problem with Intel 16.0.3 and 15.0.0. This is on linux-centos6-x86_64 btw. I can try to dig up build logs if you want. |
|
+1. Build logs would be nice (but shouldn't block the PR). |
|
Moving discussion of the problems with Intel to #1415. If we discover a solution and this PR hasn't been merged yet, I'll add it here. Otherwise, this PR should be ready to merge as is. |
|
@adamjstewart: Is there a reason we need variants for all the system libraries? Couldn't you just consolidate that down to a single variant ( |
|
@tgamblin We don't need variants for everything. The way I see it, most packages like these have 4 options:
Each of these options has pros:
And each of these options has cons:
What would be the best option here? A boolean variant only lets me choose 2 of these options. Of course, we don't need any variants at all if we just want to always link to Spack-installed libraries. I would be fine with that. |
|
If we can settle on a syntax that won’t hurt users brains, we can use a non-boolean variable to choose from among these options.
|
|
@adamjstewart I just read the thread... I think we built |
114c447 to
9054dd3
Compare
|
Alright, CMake builds with Intel again thanks to @mathstuf! As for the variants, what do we want to do here? My original thought was that variants are cheap and if anyone runs into problems with a dependency they can always disable it. Do we want to always build with Spack? Do we want an all-or-nothing variable? Do we want to use non-boolean variants? |
9054dd3 to
b47357d
Compare
|
@tgamblin What else needs to be done to get this PR ready to merge? Have we decided on how we want these dependency variants to work? |
|
Ping @tgamblin |
|
@adamjstewart: sorry for the delay. RE: variants, I'd kind of rather have Do you ever do something different from options 1 or 2? Do we need to support 4 options? My gut feeling is that users aren't going to care in this instances, as long as CMake builds. I would lean towards building with spack libs by default but could go both ways on that. |
|
@tgamblin Honestly, I'm fine with having no variants and only supporting option 1. I feel like this practice is common in other packages. But if you want I can just do what I have already and replace all of the variants with a single |
|
@adamjstewart: Maybe I'm not keeping up enough with all the packages - is it common to have options for using system dependencies, or just common to have optional dependencies? A systemlibs variant would be great. |
|
@tgamblin For packages that require something, either from a system lib, tarball lib, or Spack lib, I think it usually either doesn't include the dependency (thereby using the system lib or tarball lib) or lists the dependency as required (using the Spack lib). If the dependency isn't actually required at all, it's more common to see it listed as an optional Spack dependency enabled/disabled by a variant. But all of that is irrelevant, because we can write packages the way we think they should work; not the way they've been written in the past. I'll switch everything to |
|
@adamjstewart: sounds good. FWIW, I would also be ok with just option 1 :). |
|
The only problem I see with only having option 1 is that we're adding new dependencies to a package, and we have no idea whether or not they'll break for others, especially on macOS. If you recall, we had some problems after I added new dependencies to the git package. Having a variant there to allow people to disable the dependencies if they need to might be smart. Of course, that might just uncover a new bug in one of these packages that we could solve. Why play it on the safe side when you can find and fix new bugs. It's really up to you, I don't care. I just figured we should rely on Spack since there's no guarantee that the system libs are present at all. |
|
@adamjstewart: let's go with the variant then, so there's a workaround. Ideally (and thanks to things like #1576) we'd be able to hash this stuff out in CI beforehand, but we don't have that luxury at the moment |
|
I'll get to this in a minute. Let me just finish fixing these documentation docstring bugs. |
|
I just took a look at CMake's bootstrap script and I guess I wasn't clear on what Previously, we weren't specifying anything, and therefore using the cmake-provided libraries. We were never using the system installed libraries. By using @tgamblin What do we want to do here? |
|
On the other hand, libarchive works a bit differently than cmake. You either build @tgamblin What do we want to do here? |
|
@adamjstewart: I think we should strive for |
|
@adamjstewart: for libarchive, I'd just depend on the spack dependency. My preference is to always use the spack dependencies. |
|
What would you call the variant for CMake? It's not really a system library if it's built with Spack. |
|
What about standardizing on |
|
Sure. |
|
Alright, now before I get myself in trouble, let me just test this out from a clean Spack installation. |
|
@tgamblin Ran into a package whose I also tried being more specific than '--system-curl',
'--system-expat',
'--no-system-jsoncpp',
'--system-zlib',
'--system-bzip2',
'--system-liblzma',
'--system-libarchive'That doesn't seem to link to jsoncpp either, but if it isn't working now, I don't think it was working before. Should be safe to merge I think. |
|
Just noticed in the RPATH documentation it mentions a way to add paths to the RPATH like py-pyside does. I'm going to try this out for CMake and see if I can get it to link to jsoncpp. |
|
False alarm. The reason that CMake didn't appear to be linked to libjsoncpp is that if you build with |
The reason I started this PR was because I couldn't get CMake to build when using the Intel compilers. I then noticed that CMake was missing a ton of dependencies, which were in turn missing other dependencies. After all of that trouble... I still can't get CMake to build with Intel! I'll file a separate issue for CMake, but regardless I think this PR should be merged.