Updating 'metis' and 'parmetis' to conform to PEP8 standards.

This commit is contained in:
Joseph Ciurej
2016-05-19 09:33:47 -07:00
parent 0ef6843d85
commit 064d3584c0
2 changed files with 65 additions and 62 deletions

View File

@@ -26,11 +26,11 @@
from spack import *
import sys
class Parmetis(Package):
"""
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.
"""
"""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."""
homepage = 'http://glaros.dtc.umn.edu/gkhome/metis/parmetis/overview'
base_url = 'http://glaros.dtc.umn.edu/gkhome/fetch/sw/parmetis'
@@ -42,20 +42,20 @@ class Parmetis(Package):
variant('debug', default=False, description='Builds the library in debug mode')
variant('gdb', default=False, description='Enables gdb support')
depends_on('cmake @2.8:') # build dependency
depends_on('cmake@2.8:') # build dependency
depends_on('mpi')
depends_on('metis@5:')
patch('enable_external_metis.patch')
# bug fixes from PETSc developers
# https://bitbucket.org/petsc/pkg-parmetis/commits/1c1a9fd0f408dc4d42c57f5c3ee6ace411eb222b/raw/
# https://bitbucket.org/petsc/pkg-parmetis/commits/1c1a9fd0f408dc4d42c57f5c3ee6ace411eb222b/raw/ # NOQA: ignore=E501
patch('pkg-parmetis-1c1a9fd0f408dc4d42c57f5c3ee6ace411eb222b.patch')
# https://bitbucket.org/petsc/pkg-parmetis/commits/82409d68aa1d6cbc70740d0f35024aae17f7d5cb/raw/
# https://bitbucket.org/petsc/pkg-parmetis/commits/82409d68aa1d6cbc70740d0f35024aae17f7d5cb/raw/ # NOQA: ignore=E501
patch('pkg-parmetis-82409d68aa1d6cbc70740d0f35024aae17f7d5cb.patch')
def url_for_version(self, version):
version_dir = 'OLD/' if version < Version('3.2.0') else ''
return '%s/%sparmetis-%s.tar.gz' % (Parmetis.base_url, version_dir, version)
verdir = 'OLD/' if version < Version('3.2.0') else ''
return '%s/%sparmetis-%s.tar.gz' % (Parmetis.base_url, verdir, version)
def install(self, spec, prefix):
options = []
@@ -63,17 +63,19 @@ def install(self, spec, prefix):
build_directory = join_path(self.stage.path, 'spack-build')
source_directory = self.stage.source_path
metis_source = join_path(source_directory, 'metis')
options.extend(['-DGKLIB_PATH:PATH={metis_source}/GKlib'.format(metis_source=spec['metis'].prefix.include),
'-DMETIS_PATH:PATH={metis_source}'.format(metis_source=spec['metis'].prefix),
'-DCMAKE_C_COMPILER:STRING={mpicc}'.format(mpicc=spec['mpi'].mpicc),
'-DCMAKE_CXX_COMPILER:STRING={mpicxx}'.format(mpicxx=spec['mpi'].mpicxx)])
options.extend([
'-DGKLIB_PATH:PATH=%s/GKlib' % spec['metis'].prefix.include,
'-DMETIS_PATH:PATH=%s' % spec['metis'].prefix,
'-DCMAKE_C_COMPILER:STRING=%s' % spec['mpi'].mpicc,
'-DCMAKE_CXX_COMPILER:STRING=%s' % spec['mpi'].mpicxx
])
if '+shared' in spec:
options.append('-DSHARED:BOOL=ON')
if '+debug' in spec:
options.extend(['-DDEBUG:BOOL=ON', '-DCMAKE_BUILD_TYPE:STRING=Debug'])
options.extend(['-DDEBUG:BOOL=ON',
'-DCMAKE_BUILD_TYPE:STRING=Debug'])
if '+gdb' in spec:
options.append('-DGDB:BOOL=ON')
@@ -82,6 +84,6 @@ def install(self, spec, prefix):
make()
make('install')
# The shared library is not installed correctly on Darwin; correct this
# 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)