diff options
author | becker33 <becker33@llnl.gov> | 2018-01-18 17:55:44 -0800 |
---|---|---|
committer | Todd Gamblin <tgamblin@llnl.gov> | 2018-01-19 09:39:38 -0800 |
commit | 4fb3b30d3e3c5655acc0b9f34b593c0208bdfbd1 (patch) | |
tree | f0cfd50e0f1546025aba97f05fc59b553c5baf42 /var | |
parent | e0826804c21cb35052bc89eda635e1fa69d71e93 (diff) | |
download | spack-4fb3b30d3e3c5655acc0b9f34b593c0208bdfbd1.tar.gz spack-4fb3b30d3e3c5655acc0b9f34b593c0208bdfbd1.tar.bz2 spack-4fb3b30d3e3c5655acc0b9f34b593c0208bdfbd1.tar.xz spack-4fb3b30d3e3c5655acc0b9f34b593c0208bdfbd1.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.py | 11 |
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 927a7715e6..565c06686c 100644 --- a/var/spack/repos/builtin/packages/parmetis/package.py +++ b/var/spack/repos/builtin/packages/parmetis/package.py @@ -54,6 +54,13 @@ class Parmetis(Package): # 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'): @@ -70,9 +77,7 @@ class Parmetis(Package): '-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: |