Skip to content
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

libxsmm: add libs property #6193

Merged
merged 1 commit into from
Nov 8, 2017
Merged

libxsmm: add libs property #6193

merged 1 commit into from
Nov 8, 2017

Conversation

baip
Copy link
Contributor

@baip baip commented Nov 8, 2017

This allows dependents to use spec['libxsmm'].libs.

result = find_libraries(['libxsmm', 'libxsmmf'], root=self.prefix,
recurse=True)
result += find_libraries(['libxsmm', 'libxsmmf'], root=self.prefix,
shared=False, recurse=True)
Copy link
Member

Choose a reason for hiding this comment

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

Why do u need both shared and static?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's because the library can be built with shared and/or static versions -- what's the best way to handle this?

Copy link
Member

Choose a reason for hiding this comment

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

what's the best way to handle this?

Different packages do it differently, some have shared variant which is used in build system and in libs(), some just return shared always.

But it certainly strange to return both shared and static together here. You can at least try searching for static if shared were not found.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

Copy link
Member

Choose a reason for hiding this comment

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

For now I'd add a shared variant that defaults true, and return either shared libs or static depending on what it's set to.

@alalazo: this is probably another place where the interface could come in handy. The libs you want probably depend on whether the caller is built shared. Might be worth thinking about how to integrate that after SC.

Copy link
Member

Choose a reason for hiding this comment

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

@tgamblin

Might be worth thinking about how to integrate that after SC.

Definitely. Probably we also need to decide on a solution for the problem raised in #5269 that works for every use case we have. Lately I am not pushing new features because I am waiting for the release to be tagged, and don't want to add noise to that.

@baip I think adding a variant:

 variant('shared', default=True, description="Build shared libraries")

as @tgamblin suggested, and then having:

@property
def libs(self):
    shared = True if '+shared' in self.spec else False
    return find_libraries(
        ['libxsmm', 'libxsmmf'], root=self.prefix, shared=shared, recurse=True
    )

is more along the lines of what we do in other packages, at least for now

Copy link
Member

@davydden davydden left a comment

Choose a reason for hiding this comment

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

please return either shared or static in libs().

@junghans junghans merged commit 4273eba into spack:develop Nov 8, 2017
@baip baip deleted the libxsmm-libs branch November 9, 2017 00:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants