mixins: implemented declarative syntax
Implemented a declarative syntax for the additional behavior that can get attached to classes. Implemented a function to filter compiler wrappers that uses the mechanism above.
This commit is contained in:
@@ -28,7 +28,7 @@
|
||||
from spack import *
|
||||
|
||||
|
||||
class Hdf5(AutotoolsPackage, mixins.FilterCompilerWrappers):
|
||||
class Hdf5(AutotoolsPackage):
|
||||
"""HDF5 is a data model, library, and file format for storing and managing
|
||||
data. It supports an unlimited variety of datatypes, and is designed for
|
||||
flexible and efficient I/O and for high volume and complex data.
|
||||
@@ -97,6 +97,8 @@ class Hdf5(AutotoolsPackage, mixins.FilterCompilerWrappers):
|
||||
patch('h5f90global-mult-obj-same-equivalence-same-common-block.patch',
|
||||
when='@1.10.1%intel@18')
|
||||
|
||||
filter_compiler_wrappers('h5cc', 'h5c++', 'h5fc')
|
||||
|
||||
def url_for_version(self, version):
|
||||
url = "https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-{0}/hdf5-{1}/src/hdf5-{1}.tar.gz"
|
||||
return url.format(version.up_to(2), version)
|
||||
@@ -295,11 +297,3 @@ def check_install(self):
|
||||
print('-' * 80)
|
||||
raise RuntimeError("HDF5 install check failed")
|
||||
shutil.rmtree(checkdir)
|
||||
|
||||
@property
|
||||
def to_be_filtered_for_wrappers(self):
|
||||
return [
|
||||
join_path(self.prefix.bin, 'h5c++'),
|
||||
join_path(self.prefix.bin, 'h5cc'),
|
||||
join_path(self.prefix.bin, 'h5fc'),
|
||||
]
|
||||
|
@@ -26,7 +26,7 @@
|
||||
import os
|
||||
|
||||
|
||||
class Mpich(AutotoolsPackage, mixins.FilterCompilerWrappers):
|
||||
class Mpich(AutotoolsPackage):
|
||||
"""MPICH is a high performance and widely portable implementation of
|
||||
the Message Passing Interface (MPI) standard."""
|
||||
|
||||
@@ -71,6 +71,8 @@ class Mpich(AutotoolsPackage, mixins.FilterCompilerWrappers):
|
||||
provides('mpi@:3.0', when='@3:')
|
||||
provides('mpi@:1.3', when='@1:')
|
||||
|
||||
filter_compiler_wrappers('mpicc', 'mpicxx', 'mpif77', 'mpif90')
|
||||
|
||||
# fix MPI_Barrier segmentation fault
|
||||
# see https://lists.mpich.org/pipermail/discuss/2016-May/004764.html
|
||||
# and https://lists.mpich.org/pipermail/discuss/2016-June/004768.html
|
||||
@@ -169,12 +171,3 @@ def configure_args(self):
|
||||
config_args.append(device_config)
|
||||
|
||||
return config_args
|
||||
|
||||
@property
|
||||
def to_be_filtered_for_wrappers(self):
|
||||
return [
|
||||
join_path(self.prefix.bin, 'mpicc'),
|
||||
join_path(self.prefix.bin, 'mpicxx'),
|
||||
join_path(self.prefix.bin, 'mpif77'),
|
||||
join_path(self.prefix.bin, 'mpif90')
|
||||
]
|
||||
|
@@ -35,7 +35,7 @@ def _process_manager_validator(values):
|
||||
)
|
||||
|
||||
|
||||
class Mvapich2(AutotoolsPackage, mixins.FilterCompilerWrappers):
|
||||
class Mvapich2(AutotoolsPackage):
|
||||
"""MVAPICH2 is an MPI implementation for Infiniband networks."""
|
||||
homepage = "http://mvapich.cse.ohio-state.edu/"
|
||||
url = "http://mvapich.cse.ohio-state.edu/download/mvapich/mv2/mvapich2-2.2.tar.gz"
|
||||
@@ -107,6 +107,8 @@ class Mvapich2(AutotoolsPackage, mixins.FilterCompilerWrappers):
|
||||
depends_on('libpciaccess', when=(sys.platform != 'darwin'))
|
||||
depends_on('cuda', when='+cuda')
|
||||
|
||||
filter_compiler_wrappers('mpicc', 'mpicxx', 'mpif77', 'mpif90')
|
||||
|
||||
def url_for_version(self, version):
|
||||
base_url = "http://mvapich.cse.ohio-state.edu/download"
|
||||
if version < Version('2.0'):
|
||||
@@ -231,12 +233,3 @@ def configure_args(self):
|
||||
args.extend(self.process_manager_options)
|
||||
args.extend(self.network_options)
|
||||
return args
|
||||
|
||||
@property
|
||||
def to_be_filtered_for_wrappers(self):
|
||||
return [
|
||||
join_path(self.prefix.bin, 'mpicc'),
|
||||
join_path(self.prefix.bin, 'mpicxx'),
|
||||
join_path(self.prefix.bin, 'mpif77'),
|
||||
join_path(self.prefix.bin, 'mpif90')
|
||||
]
|
||||
|
@@ -64,7 +64,7 @@ def _mxm_dir():
|
||||
return None
|
||||
|
||||
|
||||
class Openmpi(AutotoolsPackage, mixins.FilterCompilerWrappers):
|
||||
class Openmpi(AutotoolsPackage):
|
||||
"""The Open MPI Project is an open source Message Passing Interface
|
||||
implementation that is developed and maintained by a consortium
|
||||
of academic, research, and industry partners. Open MPI is
|
||||
@@ -214,6 +214,23 @@ class Openmpi(AutotoolsPackage, mixins.FilterCompilerWrappers):
|
||||
conflicts('fabrics=pmi', when='@:1.5.4') # PMI support was added in 1.5.5
|
||||
conflicts('fabrics=mxm', when='@:1.5.3') # MXM support was added in 1.5.4
|
||||
|
||||
filter_compiler_wrappers(
|
||||
'mpicc-vt-wrapper-data.txt',
|
||||
'mpicc-wrapper-data.txt',
|
||||
'ortecc-wrapper-data.txt',
|
||||
'shmemcc-wrapper-data.txt',
|
||||
'mpic++-vt-wrapper-data.txt',
|
||||
'mpic++-wrapper-data.txt',
|
||||
'ortec++-wrapper-data.txt',
|
||||
'mpifort-vt-wrapper-data.txt',
|
||||
'mpifort-wrapper-data.txt',
|
||||
'shmemfort-wrapper-data.txt',
|
||||
'mpif90-vt-wrapper-data.txt',
|
||||
'mpif90-wrapper-data.txt',
|
||||
'mpif77-vt-wrapper-data.txt',
|
||||
'mpif77-wrapper-data.txt'
|
||||
)
|
||||
|
||||
def url_for_version(self, version):
|
||||
url = "http://www.open-mpi.org/software/ompi/v{0}/downloads/openmpi-{1}.tar.bz2"
|
||||
return url.format(version.up_to(2), version)
|
||||
@@ -374,29 +391,3 @@ def configure_args(self):
|
||||
config_args.append('--without-ucx')
|
||||
|
||||
return config_args
|
||||
|
||||
@property
|
||||
def to_be_filtered_for_wrappers(self):
|
||||
|
||||
basepath = join_path(self.prefix, 'share', 'openmpi')
|
||||
|
||||
wrappers = [
|
||||
'mpicc-vt-wrapper-data.txt',
|
||||
'mpicc-wrapper-data.txt',
|
||||
'ortecc-wrapper-data.txt',
|
||||
'shmemcc-wrapper-data.txt',
|
||||
'mpic++-vt-wrapper-data.txt',
|
||||
'mpic++-wrapper-data.txt',
|
||||
'ortec++-wrapper-data.txt',
|
||||
'mpifort-vt-wrapper-data.txt',
|
||||
'mpifort-wrapper-data.txt',
|
||||
'shmemfort-wrapper-data.txt',
|
||||
'mpif90-vt-wrapper-data.txt',
|
||||
'mpif90-wrapper-data.txt',
|
||||
'mpif77-vt-wrapper-data.txt',
|
||||
'mpif77-wrapper-data.txt'
|
||||
]
|
||||
|
||||
abs_wrappers = [join_path(basepath, x) for x in wrappers]
|
||||
|
||||
return [x for x in abs_wrappers if not os.path.islink(x)]
|
||||
|
@@ -26,7 +26,7 @@
|
||||
from spack import *
|
||||
|
||||
|
||||
class R(AutotoolsPackage, mixins.FilterCompilerWrappers):
|
||||
class R(AutotoolsPackage):
|
||||
"""R is 'GNU S', a freely available language and environment for
|
||||
statistical computing and graphics which provides a wide variety of
|
||||
statistical and graphical techniques: linear and nonlinear modelling,
|
||||
@@ -88,6 +88,8 @@ class R(AutotoolsPackage, mixins.FilterCompilerWrappers):
|
||||
|
||||
patch('zlib.patch', when='@:3.3.2')
|
||||
|
||||
filter_compiler_wrappers('Makeconf')
|
||||
|
||||
@property
|
||||
def etcdir(self):
|
||||
return join_path(prefix, 'rlib', 'R', 'etc')
|
||||
@@ -129,10 +131,6 @@ def copy_makeconf(self):
|
||||
dst_makeconf = join_path(self.etcdir, 'Makeconf.spack')
|
||||
shutil.copy(src_makeconf, dst_makeconf)
|
||||
|
||||
@property
|
||||
def to_be_filtered_for_wrappers(self):
|
||||
return [join_path(self.etcdir, 'Makeconf')]
|
||||
|
||||
# ========================================================================
|
||||
# Set up environment to make install easy for R extensions.
|
||||
# ========================================================================
|
||||
|
Reference in New Issue
Block a user