diff options
author | Kelly (KT) Thompson <KineticTheory@users.noreply.github.com> | 2018-01-08 08:18:42 -0700 |
---|---|---|
committer | Adam J. Stewart <ajstewart426@gmail.com> | 2018-01-08 09:18:42 -0600 |
commit | eb66aca9aed6582c2efe6877cc9dac24016d282d (patch) | |
tree | 27f84e54c9c850f0c287c6460f7860d2cc617284 | |
parent | 298f5562c99ad3ad87da9e0df78bc25e95ce0c02 (diff) | |
download | spack-eb66aca9aed6582c2efe6877cc9dac24016d282d.tar.gz spack-eb66aca9aed6582c2efe6877cc9dac24016d282d.tar.bz2 spack-eb66aca9aed6582c2efe6877cc9dac24016d282d.tar.xz spack-eb66aca9aed6582c2efe6877cc9dac24016d282d.zip |
Upgrade recipe for parmetis to be a CMakePackage (#6807)
* Upgrade recipe for parmetis to be a CMakePackage
+ Eliminate `install` method (use the one from CMakePackage).
+ Move configure options to new method `cmake_args`
+ Move special install instructions for DarwinOS to a `run_after` method.
* Fix run_after section; Remove variant +debug.
-rw-r--r-- | var/spack/repos/builtin/packages/parmetis/package.py | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/var/spack/repos/builtin/packages/parmetis/package.py b/var/spack/repos/builtin/packages/parmetis/package.py index 927a7715e6..dacd218f99 100644 --- a/var/spack/repos/builtin/packages/parmetis/package.py +++ b/var/spack/repos/builtin/packages/parmetis/package.py @@ -27,7 +27,7 @@ from spack import * import sys -class Parmetis(Package): +class Parmetis(CMakePackage): """ParMETIS is an MPI-based parallel library that implements a variety of algorithms for partitioning unstructured graphs, meshes, and for computing fill-reducing orderings of sparse matrices.""" @@ -40,7 +40,6 @@ class Parmetis(Package): version('4.0.2', '0912a953da5bb9b5e5e10542298ffdce') variant('shared', default=True, description='Enables the build of shared libraries.') - variant('debug', default=False, description='Builds the library in debug mode.') variant('gdb', default=False, description='Enables gdb support.') depends_on('cmake@2.8:', type='build') @@ -61,11 +60,10 @@ class Parmetis(Package): url += '/parmetis-{0}.tar.gz'.format(version) return url - def install(self, spec, prefix): - source_directory = self.stage.source_path - build_directory = join_path(source_directory, 'build') + def cmake_args(self): + spec = self.spec - options = std_cmake_args[:] + options = [] options.extend([ '-DGKLIB_PATH:PATH=%s/GKlib' % spec['metis'].prefix.include, '-DMETIS_PATH:PATH=%s' % spec['metis'].prefix, @@ -87,17 +85,13 @@ class Parmetis(Package): for o in rpath_options: options.remove(o) - if '+debug' in spec: - options.extend(['-DDEBUG:BOOL=ON', - '-DCMAKE_BUILD_TYPE:STRING=Debug']) if '+gdb' in spec: options.append('-DGDB:BOOL=ON') - with working_dir(build_directory, create=True): - cmake(source_directory, *options) - make() - make('install') + return options - # The shared library is not installed correctly on Darwin; fix this - if (sys.platform == 'darwin') and ('+shared' in spec): - fix_darwin_install_name(prefix.lib) + @run_after('install') + def darwin_fix(self): + # The shared library is not installed correctly on Darwin; fix this + if (sys.platform == 'darwin') and ('+shared' in self.spec): + fix_darwin_install_name(prefix.lib) |