PLASMA: add version 18.9.0 (w/CMake) and remove 17.1 (no config. system)#9489
PLASMA: add version 18.9.0 (w/CMake) and remove 17.1 (no config. system)#9489scheibelp merged 4 commits intospack:developfrom luszczek:develop
Conversation
| hg = "https://[email protected]/icl/plasma" | ||
|
|
||
| version("develop", hg=hg) | ||
| version("17.1", "64b410b76023a41b3f07a5f0dca554e1") |
There was a problem hiding this comment.
typically we don't remove old versions
There was a problem hiding this comment.
Acknowledged, but the old version had no configuration system and the new one has CMake. The Spack package class has to either extend MakefilePackage or CMakePackage as far as I understand.
There was a problem hiding this comment.
Yes, but you can override the Cmake-specific methods and implement the make flow in e.g. the install method. See for example the nest package
There was a problem hiding this comment.
I added the old version back that uses Makefile. nest package was useful - thanks.
| return options | ||
|
|
||
| # Before 18.9.0 it was an Makefile package | ||
| @when("@:17.1") |
There was a problem hiding this comment.
Do you know that only 18.9 introduced Cmake? If yes, why don't you use @:18.8.99? In theory someone could add a version in between
There was a problem hiding this comment.
In theory, maybe. In practice, I approve commits to PLASMA, I develop PLASMA, I package PLASMA, I release PLASMA, I decide versioning scheme of PLASMA. And the version scheme is YEAR.MONTH.
|
|
||
| @when("@18.9.0:") | ||
| def cmake_args(self): | ||
| if self.spec.satisfies('@:17.1'): |
There was a problem hiding this comment.
this may never be triggered
| make("install") | ||
|
|
||
| @when("@:17.1") | ||
| def edit(self, spec, prefix): |
There was a problem hiding this comment.
I'm not sure if this will work. It is a CmakePackage and I don't think it executes an edit-phase. I implemented everything needed to be done in the "old" build flow under a single (decorated) install method
There was a problem hiding this comment.
edit() method is called from install. I tried it with all combinations of versions and dependencies and it install()/edit() seemed to have done its job.
| header_flags = "" | ||
| # accumulate CPP flags for headers: <cblas.h> and <lapacke.h> | ||
| for dep in ("blas", "lapack"): | ||
| try: # in case the dependency does not provide header flags |
There was a problem hiding this comment.
but how would it find the headers then? If it doesn't work (or we might pick up system libraries) just throw an error and tell the user how to fix it.
There was a problem hiding this comment.
This is what for dep loop is doing: walk dependencies, get the header paths, add it to build. Dependencies that do not provide headers are explicitly blocked and the comments next to conflict() say that the headers are missing or incomplete.
There was a problem hiding this comment.
So we may never hit the except block because we explicitly disable all non-complete providers? Why do we ignore the exception then? What am I missing?
Suppose someone adds a new provider that also doesn't provide all headers.
There was a problem hiding this comment.
The reason why there is a try-except because I had an exception for one of the combinations of dependencies.
Providing "blas" and "lapack" is not a well defined functionality. Some of this is taken care of by conflict designation. The usable packages are handled here. But the problem is "blas" might not provide something because "lapack" provides that. And looking at the packages of "blas" and "lapack", I didn't see a common theme I could just use in a consistent manner.
| def build_targets(self): | ||
| targets = list() | ||
|
|
||
| if self.spec.satisfies('@18.9.0:'): |
There was a problem hiding this comment.
@luszczek It looks like this is intended to only return build targets for 17.1. However, I don't see anything making use of build_targets for 17.1, i.e. it looks like the entire build is defined in the install method. I wanted to check that (a) in fact you want these constraints to apply to 17.1 and (b) I was curious if you saw them getting applied (e.g. in the build log).
From looking at this, I think the return value of this method is never used, so you could remove all of the logic here.
There was a problem hiding this comment.
I don't know if I'm misusing build_targets but install method is trivial. It is edit that does the real work as much as it can. What is left is things I cannot edit through code and I can just stick on the invocation line of make. And this is exactly what I'm trying to do in build_targets for 17.1. More specifically, MKLROOT is not nicely available for automated editing so I override it in build_targets and make MKLROOT=-lmkl does the rest.
There was a problem hiding this comment.
@scheibelp Did I justified build_targets logic? Could you please approve the PR?
There was a problem hiding this comment.
@luszczek Your intended use of build_targets is fine (and necessary for the time being), but what I meant was that I don't think that function is being used anywhere. When I pulled this PR and tested it for version 17.1, I didn't see the function get called. So I'm curious if:
- you built
17.1and it works for you: in that case I don't think the build target customization is required (because these build targets are not being added to themakeinvocation as far as I can tell) - you have not yet tried
17.1: in that case I suspect it may not succeed, especially if those make args are necessary
I should also say that while we like keeping old versions around. IMO in your case, as the developer, if you find it tedious or not worthwhile to maintain support across the two build systems, I'm not against it being removed.
There was a problem hiding this comment.
I tested 17.1 with supported dependencies and they work with the property build_targets removed. So I removed it with another commit. Thank you for checking.
|
Thanks! |
* Add version 18.9.0 (w/CMake) * Add version dependent install methods to handle transition from Make-based package (17.1) to CMake-based package, using the NEST package as an example * Remove unnecessary build_targets method for older Make-based version * Don't retrieve just the C/Fortran interfaces for netlib-lapack - blas/lapack libs are now handled the same for all implementations * Remove netlib-lapack detection patch
* Add version 18.9.0 (w/CMake) * Add version dependent install methods to handle transition from Make-based package (17.1) to CMake-based package, using the NEST package as an example * Remove unnecessary build_targets method for older Make-based version * Don't retrieve just the C/Fortran interfaces for netlib-lapack - blas/lapack libs are now handled the same for all implementations * Remove netlib-lapack detection patch
* Add version 18.9.0 (w/CMake) * Add version dependent install methods to handle transition from Make-based package (17.1) to CMake-based package, using the NEST package as an example * Remove unnecessary build_targets method for older Make-based version * Don't retrieve just the C/Fortran interfaces for netlib-lapack - blas/lapack libs are now handled the same for all implementations * Remove netlib-lapack detection patch
No description provided.