diff options
Diffstat (limited to 'var')
-rw-r--r-- | var/spack/repos/builtin/packages/astyle/package.py | 24 | ||||
-rw-r--r-- | var/spack/repos/builtin/packages/blitz/package.py | 11 | ||||
-rw-r--r-- | var/spack/repos/builtin/packages/gmp/package.py | 15 | ||||
-rw-r--r-- | var/spack/repos/builtin/packages/hdf5/package.py | 33 | ||||
-rw-r--r-- | var/spack/repos/builtin/packages/ibmisc/package.py | 2 | ||||
-rw-r--r-- | var/spack/repos/builtin/packages/lzo/package.py | 15 | ||||
-rw-r--r-- | var/spack/repos/builtin/packages/openjpeg/package.py | 14 | ||||
-rw-r--r-- | var/spack/repos/builtin/packages/qhull/package.py | 11 | ||||
-rw-r--r-- | var/spack/repos/builtin/packages/swiftsim/package.py | 19 | ||||
-rw-r--r-- | var/spack/repos/builtin/packages/szip/package.py | 25 |
10 files changed, 69 insertions, 100 deletions
diff --git a/var/spack/repos/builtin/packages/astyle/package.py b/var/spack/repos/builtin/packages/astyle/package.py index 815c184577..8f85d4ebbb 100644 --- a/var/spack/repos/builtin/packages/astyle/package.py +++ b/var/spack/repos/builtin/packages/astyle/package.py @@ -25,28 +25,24 @@ from spack import * -class Astyle(Package): +class Astyle(EditableMakefile): """ A Free, Fast, and Small Automatic Formatter for C, C++, C++/CLI, Objective-C, C#, and Java Source Code. """ homepage = "http://astyle.sourceforge.net/" - url = "http://downloads.sourceforge.net/project/astyle/astyle/astyle%202.04/astyle_2.04_linux.tar.gz" + url = "http://downloads.sourceforge.net/project/astyle/astyle/astyle%202.04/astyle_2.04_linux.tar.gz" version('2.04', '30b1193a758b0909d06e7ee8dd9627f6') - def install(self, spec, prefix): + parallel = False - with working_dir('src'): - # we need to edit the makefile in place to set compiler: - make_file = join_path(self.stage.source_path, - 'build', 'gcc', 'Makefile') - filter_file(r'^CXX\s*=.*', 'CXX=%s' % spack_cxx, make_file) + def wdir(self): + return join_path(self.stage.source_path, 'build', self.compiler.name) - make('-f', - make_file, - parallel=False) + def edit(self, spec, prefix): + makefile = join_path(self.wdir(), 'Makefile') + filter_file(r'^CXX\s*=.*', 'CXX=%s' % spack_cxx, makefile) - mkdirp(self.prefix.bin) - install(join_path(self.stage.source_path, 'src', 'bin', 'astyle'), - self.prefix.bin) + def install_args(self): + return ['prefix={0}'.format(prefix)] diff --git a/var/spack/repos/builtin/packages/blitz/package.py b/var/spack/repos/builtin/packages/blitz/package.py index c92e49a732..16ad3bc2ab 100644 --- a/var/spack/repos/builtin/packages/blitz/package.py +++ b/var/spack/repos/builtin/packages/blitz/package.py @@ -25,16 +25,9 @@ from spack import * -class Blitz(Package): +class Blitz(AutotoolsPackage): """N-dimensional arrays for C++""" homepage = "http://github.com/blitzpp/blitz" - url = "https://github.com/blitzpp/blitz/tarball/1.0.0" + url = "https://github.com/blitzpp/blitz/tarball/1.0.0" version('1.0.0', '9f040b9827fe22228a892603671a77af') - - # No dependencies - - def install(self, spec, prefix): - configure('--prefix=%s' % prefix) - make() - make("install") diff --git a/var/spack/repos/builtin/packages/gmp/package.py b/var/spack/repos/builtin/packages/gmp/package.py index d85330dd6e..bd1f653bd7 100644 --- a/var/spack/repos/builtin/packages/gmp/package.py +++ b/var/spack/repos/builtin/packages/gmp/package.py @@ -25,12 +25,12 @@ from spack import * -class Gmp(Package): - """GMP is a free library for arbitrary precision arithmetic, operating - on signed integers, rational numbers, and floating-point numbers.""" - +class Gmp(AutotoolsPackage): + """GMP is a free library for arbitrary precision arithmetic, + operating on signed integers, rational numbers, and + floating-point numbers.""" homepage = "https://gmplib.org" - url = "https://gmplib.org/download/gmp/gmp-6.0.0a.tar.bz2" + url = "https://gmplib.org/download/gmp/gmp-6.0.0a.tar.bz2" version('6.1.1', '4c175f86e11eb32d8bf9872ca3a8e11d') version('6.1.0', '86ee6e54ebfc4a90b643a65e402c4048') @@ -38,8 +38,3 @@ class Gmp(Package): version('6.0.0', '6ef5869ae735db9995619135bd856b84') depends_on("m4", type='build') - - def install(self, spec, prefix): - configure("--prefix=%s" % prefix) - make() - make("install") diff --git a/var/spack/repos/builtin/packages/hdf5/package.py b/var/spack/repos/builtin/packages/hdf5/package.py index aedaf18218..a7c4b2d85e 100644 --- a/var/spack/repos/builtin/packages/hdf5/package.py +++ b/var/spack/repos/builtin/packages/hdf5/package.py @@ -27,10 +27,10 @@ from spack import * import shutil -class Hdf5(Package): +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. + data. It supports an unlimited variety of datatypes, and is designed for + flexible and efficient I/O and for high volume and complex data. """ homepage = "http://www.hdfgroup.org/HDF5/" @@ -57,17 +57,19 @@ class Hdf5(Package): variant('threadsafe', default=False, description='Enable thread-safe capabilities') - depends_on("mpi", when='+mpi') - depends_on("szip", when='+szip') - depends_on("zlib") + depends_on('mpi', when='+mpi') + depends_on('szip', when='+szip') + depends_on('zlib') - def validate(self, spec): + @AutotoolsPackage.precondition('configure') + def validate(self): """ Checks if incompatible variants have been activated at the same time :param spec: spec of the package :raises RuntimeError: in case of inconsistencies """ + spec = self.spec if '+fortran' in spec and not self.compiler.fc: msg = 'cannot build a fortran variant without a fortran compiler' raise RuntimeError(msg) @@ -76,8 +78,8 @@ class Hdf5(Package): msg = 'cannot use variant +threadsafe with either +cxx or +fortran' raise RuntimeError(msg) - def install(self, spec, prefix): - self.validate(spec) + def configure_args(self): + spec = self.spec # Handle compilation after spec validation extra_args = [] @@ -140,16 +142,13 @@ class Hdf5(Package): '--disable-hl', ]) - configure( - "--prefix=%s" % prefix, - "--with-zlib=%s" % spec['zlib'].prefix, - *extra_args) - make() - make("install") - self.check_install(spec) + return ["--with-zlib=%s" % spec['zlib'].prefix] + extra_args - def check_install(self, spec): + @AutotoolsPackage.sanity_check('install') + @AutotoolsPackage.on_package_attributes(run_tests=True) + def check_install(self): "Build and run a small program to test the installed HDF5 library" + spec = self.spec print "Checking HDF5 installation..." checkdir = "spack-check" with working_dir(checkdir, create=True): diff --git a/var/spack/repos/builtin/packages/ibmisc/package.py b/var/spack/repos/builtin/packages/ibmisc/package.py index 8e83058e94..dbfa09bc20 100644 --- a/var/spack/repos/builtin/packages/ibmisc/package.py +++ b/var/spack/repos/builtin/packages/ibmisc/package.py @@ -43,7 +43,7 @@ class Ibmisc(CMakePackage): depends_on('cmake', type='build') depends_on('doxygen', type='build') - def configure_args(self): + def cmake_args(self): spec = self.spec return [ '-DUSE_EVERYTRACE=%s' % ('YES' if '+everytrace' in spec else 'NO'), diff --git a/var/spack/repos/builtin/packages/lzo/package.py b/var/spack/repos/builtin/packages/lzo/package.py index 0961bbb58c..9232bbe4e6 100644 --- a/var/spack/repos/builtin/packages/lzo/package.py +++ b/var/spack/repos/builtin/packages/lzo/package.py @@ -25,7 +25,7 @@ from spack import * -class Lzo(Package): +class Lzo(AutotoolsPackage): """Real-time data compression library""" homepage = 'https://www.oberhumer.com/opensource/lzo/' @@ -37,13 +37,14 @@ class Lzo(Package): version('2.06', '95380bd4081f85ef08c5209f4107e9f8') version('2.05', 'c67cda5fa191bab761c7cb06fe091e36') - def install(self, spec, prefix): - configure_args = [ - '--prefix={0}'.format(prefix), + def configure_args(self): + return [ '--disable-dependency-tracking', '--enable-shared' ] - configure(*configure_args) - make() + + @AutotoolsPackage.sanity_check('build') + @AutotoolsPackage.on_package_attributes(run_tests=True) + def check(self): make('check') - make('install') + make('test') diff --git a/var/spack/repos/builtin/packages/openjpeg/package.py b/var/spack/repos/builtin/packages/openjpeg/package.py index 1bc5b04f6f..17b99b8d64 100644 --- a/var/spack/repos/builtin/packages/openjpeg/package.py +++ b/var/spack/repos/builtin/packages/openjpeg/package.py @@ -25,9 +25,9 @@ from spack import * -class Openjpeg(Package): - """ - OpenJPEG is an open-source JPEG 2000 codec written in C language. +class Openjpeg(CMakePackage): + """OpenJPEG is an open-source JPEG 2000 codec written in C language. + It has been developed in order to promote the use of JPEG 2000, a still-image compression standard from the Joint Photographic Experts Group (JPEG). @@ -35,7 +35,7 @@ class Openjpeg(Package): ITU-T as a JPEG 2000 Reference Software. """ homepage = "https://github.com/uclouvain/openjpeg" - url = "https://github.com/uclouvain/openjpeg/archive/version.2.1.tar.gz" + url = "https://github.com/uclouvain/openjpeg/archive/version.2.1.tar.gz" version('2.1', '3e1c451c087f8462955426da38aa3b3d') version('2.0.1', '105876ed43ff7dbb2f90b41b5a43cfa5') @@ -44,9 +44,3 @@ class Openjpeg(Package): version('1.5.1', 'd774e4b5a0db5f0f171c4fc0aabfa14e') depends_on('cmake', type='build') - - def install(self, spec, prefix): - cmake('.', *std_cmake_args) - - make() - make("install") diff --git a/var/spack/repos/builtin/packages/qhull/package.py b/var/spack/repos/builtin/packages/qhull/package.py index 2733d8b652..eec517cb75 100644 --- a/var/spack/repos/builtin/packages/qhull/package.py +++ b/var/spack/repos/builtin/packages/qhull/package.py @@ -25,7 +25,7 @@ from spack import * -class Qhull(Package): +class Qhull(CMakePackage): """Qhull computes the convex hull, Delaunay triangulation, Voronoi diagram, halfspace intersection about a point, furt hest-site Delaunay triangulation, and furthest-site Voronoi diagram. The @@ -48,8 +48,7 @@ class Qhull(Package): depends_on('cmake', type='build') - def install(self, spec, prefix): - with working_dir('spack-build', create=True): - cmake('..', *std_cmake_args) - make() - make("install") + @CMakePackage.sanity_check('build') + @CMakePackage.on_package_attributes(run_tests=True) + def check(self): + make('test') diff --git a/var/spack/repos/builtin/packages/swiftsim/package.py b/var/spack/repos/builtin/packages/swiftsim/package.py index 636aa26bd2..ae33445377 100644 --- a/var/spack/repos/builtin/packages/swiftsim/package.py +++ b/var/spack/repos/builtin/packages/swiftsim/package.py @@ -28,7 +28,7 @@ from spack import * import llnl.util.tty as tty -class Swiftsim(Package): +class Swiftsim(AutotoolsPackage): """ SPH With Inter-dependent Fine-grained Tasking (SWIFT) provides astrophysicists with a state of the art framework to perform @@ -61,20 +61,15 @@ class Swiftsim(Package): tty.warn('This is needed to clone SWIFT repository') spack_env.set('GIT_SSL_NO_VERIFY', 1) - def install(self, spec, prefix): - # Generate configure from configure.ac - # and Makefile.am + def autoreconf(self, spec, prefix): libtoolize() aclocal() autoconf() autogen = Executable('./autogen.sh') autogen() - # Configure and install - options = ['--prefix=%s' % prefix, - '--enable-mpi' if '+mpi' in spec else '--disable-mpi', - '--with-metis={0}'.format(spec['metis'].prefix), - '--enable-optimization'] - configure(*options) - make() - make("install") + def configure_args(self): + return ['--prefix=%s' % self.prefix, + '--enable-mpi' if '+mpi' in self.spec else '--disable-mpi', + '--with-metis={0}'.format(self.spec['metis'].prefix), + '--enable-optimization'] diff --git a/var/spack/repos/builtin/packages/szip/package.py b/var/spack/repos/builtin/packages/szip/package.py index b2ca6f3995..91934f7d03 100644 --- a/var/spack/repos/builtin/packages/szip/package.py +++ b/var/spack/repos/builtin/packages/szip/package.py @@ -25,24 +25,21 @@ from spack import * -class Szip(Package): - """An implementation of the extended-Rice lossless compression algorithm. - It provides lossless compression of scientific data, and is provided - with HDF software products. +class Szip(AutotoolsPackage): + """Szip is an implementation of the extended-Rice lossless + compression algorithm. + It provides lossless compression of scientific data, and is + provided with HDF software products. """ homepage = "https://www.hdfgroup.org/doc_resource/SZIP/" - url = "http://www.hdfgroup.org/ftp/lib-external/szip/2.1/src/szip-2.1.tar.gz" + url = "http://www.hdfgroup.org/ftp/lib-external/szip/2.1/src/szip-2.1.tar.gz" version('2.1', '902f831bcefb69c6b635374424acbead') - def install(self, spec, prefix): - configure('--prefix=%s' % prefix, - '--enable-production', - '--enable-shared', - '--enable-static', - '--enable-encoding') - - make() - make("install") + def configure_args(self): + return ['--enable-production', + '--enable-shared', + '--enable-static', + '--enable-encoding'] |