Skip to content

PLASMA: add version 18.9.0 (w/CMake) and remove 17.1 (no config. system)#9489

Merged
scheibelp merged 4 commits intospack:developfrom
luszczek:develop
Oct 22, 2018
Merged

PLASMA: add version 18.9.0 (w/CMake) and remove 17.1 (no config. system)#9489
scheibelp merged 4 commits intospack:developfrom
luszczek:develop

Conversation

@luszczek
Copy link
Copy Markdown
Contributor

No description provided.

hg = "https://[email protected]/icl/plasma"

version("develop", hg=hg)
version("17.1", "64b410b76023a41b3f07a5f0dca554e1")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typically we don't remove old versions

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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'):
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this may never be triggered

make("install")

@when("@:17.1")
def edit(self, spec, prefix):
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@balay balay added the xSDK label Oct 12, 2018
def build_targets(self):
targets = list()

if self.spec.satisfies('@18.9.0:'):
Copy link
Copy Markdown
Member

@scheibelp scheibelp Oct 15, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@scheibelp Did I justified build_targets logic? Could you please approve the PR?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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.1 and 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 the make invocation 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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@scheibelp scheibelp merged commit 01913fb into spack:develop Oct 22, 2018
@scheibelp
Copy link
Copy Markdown
Member

Thanks!

baberlevi pushed a commit to ResearchIT/spack that referenced this pull request Oct 29, 2018
* 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
tjfulle pushed a commit to tjfulle/spack that referenced this pull request Oct 31, 2018
* 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
scottwittenburg pushed a commit to scottwittenburg/spack that referenced this pull request Dec 14, 2018
* 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants