blis, amdblis: remove custom phases, add v0.9.0 for blis (#29969)

Also refactor a few variants
This commit is contained in:
Massimiliano Culpo 2022-04-09 10:08:36 +02:00 committed by GitHub
parent f6795ae46d
commit 3ad3e53ff8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 25 additions and 73 deletions

View File

@ -27,15 +27,7 @@ class Amdblis(BlisBase):
version('3.0', sha256='ac848c040cd6c3550fe49148dbdf109216cad72d3235763ee7ee8134e1528517') version('3.0', sha256='ac848c040cd6c3550fe49148dbdf109216cad72d3235763ee7ee8134e1528517')
version('2.2', sha256='e1feb60ac919cf6d233c43c424f6a8a11eab2c62c2c6e3f2652c15ee9063c0c9') version('2.2', sha256='e1feb60ac919cf6d233c43c424f6a8a11eab2c62c2c6e3f2652c15ee9063c0c9')
variant( variant('ilp64', default=False, when='@3.0.1:', description='ILP64 support')
'ilp64',
default=False,
description='Build with ILP64 support')
conflicts(
'+ilp64',
when='@:3.0.0',
msg='ilp64 is supported from amdblis 3.0.1 version onwards')
def configure_args(self): def configure_args(self):
spec = self.spec spec = self.spec
@ -44,8 +36,8 @@ def configure_args(self):
if spec.satisfies('+ilp64'): if spec.satisfies('+ilp64'):
args.append('--blas-int-size=64') args.append('--blas-int-size=64')
""" To enable Fortran to C calling convention for # To enable Fortran to C calling convention for
complex types when compiling with aocc flang""" # complex types when compiling with aocc flang
if self.spec.satisfies("@3.0 %aocc"): if self.spec.satisfies("@3.0 %aocc"):
args.append('CFLAGS={0}'.format("-DAOCL_F2C")) args.append('CFLAGS={0}'.format("-DAOCL_F2C"))
args.append('CXXFLAGS={0}'.format("-DAOCL_F2C")) args.append('CXXFLAGS={0}'.format("-DAOCL_F2C"))
@ -57,8 +49,8 @@ def configure_args(self):
return args return args
def configure(self, spec, prefix): def config_args(self):
config_args = self.configure_args() config_args = super(Amdblis, self).config_args()
# "amdzen" - A fat binary or multiarchitecture binary # "amdzen" - A fat binary or multiarchitecture binary
# support for 3.1 release onwards # support for 3.1 release onwards
@ -67,5 +59,4 @@ def configure(self, spec, prefix):
else: else:
config_args.append("auto") config_args.append("auto")
configure("--prefix=" + prefix, return config_args
*config_args)

View File

@ -9,38 +9,19 @@
# https://github.com/flame/blis/issues/197 # https://github.com/flame/blis/issues/197
class BlisBase(Package): class BlisBase(MakefilePackage):
"""Base class for building BLIS, shared with the AMD optimized version """Base class for building BLIS, shared with the AMD optimized version
of the library in the 'amdblis' package. of the library in the 'amdblis' package.
""" """
depends_on('python@2.7:2.8,3.4:', type=('build', 'run')) depends_on('python@2.7:2.8,3.4:', type=('build', 'run'))
variant( variant('threads', default='none', values=('pthreads', 'openmp', 'none'),
'threads', default='none', description='Multithreading support', multi=False)
description='Multithreading support',
values=('pthreads', 'openmp', 'none'),
multi=False
)
variant( variant('blas', default=True, description='BLAS compatibility')
'blas', default=True, variant('cblas', default=True, description='CBLAS compatibility')
description='BLAS compatibility', variant('libs', default='shared,static', values=('shared', 'static'),
) multi=True, description='Build shared libs, static libs or both')
variant(
'cblas', default=True,
description='CBLAS compatibility',
)
variant(
'shared', default=True,
description='Build shared library',
)
variant(
'static', default=True,
description='Build static library',
)
# TODO: add cpu variants. Currently using auto. # TODO: add cpu variants. Currently using auto.
# If one knl, should the default be memkind ? # If one knl, should the default be memkind ?
@ -54,14 +35,11 @@ class BlisBase(Package):
conflicts('%nvhpc') conflicts('%nvhpc')
conflicts('%pgi') conflicts('%pgi')
phases = ['configure', 'build', 'install']
def configure_args(self): def configure_args(self):
spec = self.spec spec = self.spec
config_args = [] config_args = [
"--enable-threading={0}".format(spec.variants['threads'].value)
config_args.append("--enable-threading=" + ]
spec.variants['threads'].value)
if '+cblas' in spec: if '+cblas' in spec:
config_args.append("--enable-cblas") config_args.append("--enable-cblas")
@ -73,38 +51,22 @@ def configure_args(self):
else: else:
config_args.append("--disable-blas") config_args.append("--disable-blas")
if '+shared' in spec: if spec.satisfies('libs=shared'):
config_args.append("--enable-shared") config_args.append("--enable-shared")
else: else:
config_args.append("--disable-shared") config_args.append("--disable-shared")
if '+static' in spec: if spec.satisfies('libs=static'):
config_args.append("--enable-static") config_args.append("--enable-static")
else: else:
config_args.append("--disable-static") config_args.append("--disable-static")
return config_args return config_args
def configure(self, spec, prefix): def edit(self, spec, prefix):
config_args = self.configure_args() # To ensure auto should always be the last argument for base and derived class
config_args = self.configure_args() + ['auto']
# To ensure auto should always be the configure("--prefix={0}".format(prefix), *config_args)
# last argument for base and derived class
config_args.append("auto")
configure("--prefix=" + prefix,
*config_args)
def build(self, spec, prefix):
make()
@run_after('build')
@on_package_attributes(run_tests=True)
def check(self):
make('check')
def install(self, spec, prefix):
make('install')
@run_after('install') @run_after('install')
def darwin_fix(self): def darwin_fix(self):
@ -115,10 +77,8 @@ def darwin_fix(self):
@property @property
def libs(self): def libs(self):
return find_libraries( return find_libraries(
["libblis", "libblis-mt"], ["libblis", "libblis-mt"], root=self.prefix,
root=self.prefix, shared=self.spec.satisfies('libs=shared'), recursive=True
shared='+shared' in self.spec,
recursive=True
) )
@ -141,6 +101,7 @@ class Blis(BlisBase):
git = "https://github.com/flame/blis.git" git = "https://github.com/flame/blis.git"
version('master', branch='master') version('master', branch='master')
version('0.9.0', sha256='1135f664be7355427b91025075562805cdc6cc730d3173f83533b2c5dcc2f308')
version('0.8.1', sha256='729694128719801e82fae7b5f2489ab73e4a467f46271beff09588c9265a697b') version('0.8.1', sha256='729694128719801e82fae7b5f2489ab73e4a467f46271beff09588c9265a697b')
version('0.8.0', sha256='5e05868c4a6cf5032a7492f8861653e939a8f907a4fa524bbb6e14394e170a3d') version('0.8.0', sha256='5e05868c4a6cf5032a7492f8861653e939a8f907a4fa524bbb6e14394e170a3d')
version('0.7.0', sha256='7e345d666799e15bba570bd125f97042f17bf752a61dcf314486a6cd096d5f68') version('0.7.0', sha256='7e345d666799e15bba570bd125f97042f17bf752a61dcf314486a6cd096d5f68')