summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorbecker33 <becker33@llnl.gov>2018-01-18 17:55:44 -0800
committerscheibelp <scheibel1@llnl.gov>2018-01-18 17:55:44 -0800
commit3686c250ed61473a0de456d9c7aed98c3187724b (patch)
tree9d1378c34070703aa823347bfffd08737add87f3 /var
parent568db965cffe113127bc06a7198873cc6d454873 (diff)
downloadspack-3686c250ed61473a0de456d9c7aed98c3187724b.tar.gz
spack-3686c250ed61473a0de456d9c7aed98c3187724b.tar.bz2
spack-3686c250ed61473a0de456d9c7aed98c3187724b.tar.xz
spack-3686c250ed61473a0de456d9c7aed98c3187724b.zip
Fix type issues with setting flag handlers (#6960)
The flag_handlers method was being set as a bound method, but when reset in the package.py file it was being set as an unbound method (all python2 issues). This gets the underlying function information, which is the same in either case. The bug was uncovered for parmetis in #6858. This is a partial fix. Included are changes to the parmetis package.py file to make use of flag_handlers.
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/parmetis/package.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/var/spack/repos/builtin/packages/parmetis/package.py b/var/spack/repos/builtin/packages/parmetis/package.py
index dacd218f99..86fee57abb 100644
--- a/var/spack/repos/builtin/packages/parmetis/package.py
+++ b/var/spack/repos/builtin/packages/parmetis/package.py
@@ -53,6 +53,13 @@ class Parmetis(CMakePackage):
# https://bitbucket.org/petsc/pkg-parmetis/commits/82409d68aa1d6cbc70740d0f35024aae17f7d5cb/raw/ # NOQA: E501
patch('pkg-parmetis-82409d68aa1d6cbc70740d0f35024aae17f7d5cb.patch')
+ def flag_handler(self, name, flags):
+ if name == 'cflags':
+ if '%pgi' in self.spec:
+ my_flags = flags + ['-c11']
+ return (None, None, my_flags)
+ return (None, None, flags)
+
def url_for_version(self, version):
url = 'http://glaros.dtc.umn.edu/gkhome/fetch/sw/parmetis'
if version < Version('3.2.0'):
@@ -68,9 +75,7 @@ class Parmetis(CMakePackage):
'-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,
- '-DCMAKE_C_FLAGS:STRING=%s' % (
- '-c11' if '%pgi' in spec else ''),
+ '-DCMAKE_CXX_COMPILER:STRING=%s' % spec['mpi'].mpicxx
])
if '+shared' in spec: