-
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
Add blis package #8925
Add blis package #8925
Conversation
multi=False | ||
) | ||
|
||
# TODO: add cpu variants. Currently using auto. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you plan to add this, or is this just a remark for future expansions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's some knl
specific hbw_malloc
options. I'm not sure which is better so I'll let people who use this on knl
to add the options in a meaningful way.
from spack import * | ||
|
||
|
||
class Blis(Package): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you convert this to AutotoolsPackage
? Everything looks pretty standard, you should only need to override configure_args
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It started life in the spack universe as an Autotools
package but realizing that they don't use autotools
, I changed it back !
Browsing through the repo it looks like this is not designed as an autotools
package so do we want to make it one here ? (see flame/blis#17, flame/blis#197, flame/blis#195, etc )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, so this is a "fake" Autotools package that writes their own script that just happens to be called configure
. In that case, you're right, this shouldn't be an Autotools package. Can you add a comment mentioning this so others aren't confused?
"auto") | ||
make() | ||
make('install') | ||
make('check') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Normally make('check')
is run after make()
and before make('install')
. Do their installation docs say otherwise?
Also, this should be optional. If you change it to:
if self.run_tests:
make('check')
it will only run the tests if spack install --test
is used.
|
||
def install(self, spec, prefix): | ||
configure("--prefix=" + self.spec.prefix, | ||
"--enable-threading=" + self.spec.variants['threads'].value, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't have to use self
here since you already have access to spec
and prefix
.
version('0.3.0', sha256='d34d17df7bdc2be8771fe0b7f867109fd10437ac91e2a29000a4a23164c7f0da') | ||
version('0.2.2', sha256='4a7ecb56034fb20e9d1d8b16e2ef587abbc3d30cb728e70629ca7e795a7998e8') | ||
|
||
depends_on('python@2.7:2.8,3.4:') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
type=('build', 'run')
?
vairant( | ||
'blas', default='false', | ||
description='BLAS compatibility', | ||
values=('true', 'false'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo: vairant
Also, none of these variants (aside from threads
) should be multi-valued variants. They can be simple traditional boolean variants:
variant('blas', default=False, description='BLAS compatibility')
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, what exactly does this variant do? Does it still provide blas
when blis~blas
? None of these variants seem to be passed to the build instructions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll do it soon, but here is the explanation
While BLIS exports a new BLAS-like API, it also includes a BLAS compatibility layer which gives application developers access to BLIS implementations via traditional BLAS routine calls. An object-based API unique to BLIS is also available.
provides('blas', when="+blas") | ||
provides('blas', when="+cblas") | ||
|
||
phases = ['configure', 'install'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would also add a phase for build
. See http://spack.readthedocs.io/en/latest/build_systems/custompackage.html for examples of how each phase works and how to add testing.
if spec.variants['cblas']: | ||
cblas = "--enable-cblas" | ||
else: | ||
cblas = "--disable-cblas" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of saving these as variables, I would append them to an args
list. Then, when you call configure
, use:
configure(*args)
That's how most other packages work, and then you don't need to keep track of any additional variables.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
*args
unpacks a list into a set of strings ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
def build(self, spec, prefix): | ||
make() | ||
if self.run_tests: | ||
make('check') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be made into a separate function like so: http://spack.readthedocs.io/en/latest/build_systems/custompackage.html#testing
Just replace test
with check
.
phases = ['configure', 'build', 'install'] | ||
|
||
def configure(self, spec, prefix): | ||
congfig_args = [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo: congfig -> config
else: | ||
config_args.append("--disable-static") | ||
|
||
configure("--prefix=" + spec.prefix, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can just use prefix
here, no need for spec.prefix
.
Everything works with
|
The configure script for EDIT: to be clear, the search function doesn't acknowledge the possibility of a compiler binary called Spack should automatically set |
I removed
|
else: | ||
config_args.append("--disable-blas") | ||
|
||
if self.variants['shared']: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In some places you use spec.variants
, and in others you use self.variants
. I would use the same syntax that every other package uses:
if '+shared' in spec:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
config_args.append("--disable-shared") | ||
|
||
if '+static' in spec: | ||
config_args.append("--enable-static") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indentation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed it already.
|
@adamjstewart : Fixed the build and test issues. Can you merge this ? |
Yep, just ping me when the Travis tests finish. |
Did I miss a resolution for #8925 (comment) or did you want to handle that later (EDIT: not necessarily you but I mean are you fine with that being handled later)? |
I don't remember how I fixed it but it's working now.
|
First pass at adding the blis linear algebra package.