Skip to content
Snippets Groups Projects
Commit eb66aca9 authored by Kelly (KT) Thompson's avatar Kelly (KT) Thompson Committed by Adam J. Stewart
Browse files

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.
parent 298f5562
No related branches found
No related tags found
No related merge requests found
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
import sys import sys
class Parmetis(Package): class Parmetis(CMakePackage):
"""ParMETIS is an MPI-based parallel library that implements a variety of """ParMETIS is an MPI-based parallel library that implements a variety of
algorithms for partitioning unstructured graphs, meshes, and for algorithms for partitioning unstructured graphs, meshes, and for
computing fill-reducing orderings of sparse matrices.""" computing fill-reducing orderings of sparse matrices."""
...@@ -40,7 +40,6 @@ class Parmetis(Package): ...@@ -40,7 +40,6 @@ class Parmetis(Package):
version('4.0.2', '0912a953da5bb9b5e5e10542298ffdce') version('4.0.2', '0912a953da5bb9b5e5e10542298ffdce')
variant('shared', default=True, description='Enables the build of shared libraries.') 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.') variant('gdb', default=False, description='Enables gdb support.')
depends_on('cmake@2.8:', type='build') depends_on('cmake@2.8:', type='build')
...@@ -61,11 +60,10 @@ def url_for_version(self, version): ...@@ -61,11 +60,10 @@ def url_for_version(self, version):
url += '/parmetis-{0}.tar.gz'.format(version) url += '/parmetis-{0}.tar.gz'.format(version)
return url return url
def install(self, spec, prefix): def cmake_args(self):
source_directory = self.stage.source_path spec = self.spec
build_directory = join_path(source_directory, 'build')
options = std_cmake_args[:] options = []
options.extend([ options.extend([
'-DGKLIB_PATH:PATH=%s/GKlib' % spec['metis'].prefix.include, '-DGKLIB_PATH:PATH=%s/GKlib' % spec['metis'].prefix.include,
'-DMETIS_PATH:PATH=%s' % spec['metis'].prefix, '-DMETIS_PATH:PATH=%s' % spec['metis'].prefix,
...@@ -87,17 +85,13 @@ def install(self, spec, prefix): ...@@ -87,17 +85,13 @@ def install(self, spec, prefix):
for o in rpath_options: for o in rpath_options:
options.remove(o) options.remove(o)
if '+debug' in spec:
options.extend(['-DDEBUG:BOOL=ON',
'-DCMAKE_BUILD_TYPE:STRING=Debug'])
if '+gdb' in spec: if '+gdb' in spec:
options.append('-DGDB:BOOL=ON') options.append('-DGDB:BOOL=ON')
with working_dir(build_directory, create=True): return options
cmake(source_directory, *options)
make()
make('install')
# The shared library is not installed correctly on Darwin; fix this @run_after('install')
if (sys.platform == 'darwin') and ('+shared' in spec): def darwin_fix(self):
fix_darwin_install_name(prefix.lib) # 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)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment