From 74ffd8b6bece653a2c8f881ad557b1c8484707c0 Mon Sep 17 00:00:00 2001 From: Jed Brown Date: Fri, 9 Feb 2018 20:01:49 -0700 Subject: [PATCH] hpgmg package: add debug option and new version (#7175) This adds a static version of hpgmg (up to now only the latest commit from the master branch was available). This also adds a debug variant and sets optimization flags for ~debug when the compiler is gcc, intel, or clang --- .../repos/builtin/packages/hpgmg/package.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/var/spack/repos/builtin/packages/hpgmg/package.py b/var/spack/repos/builtin/packages/hpgmg/package.py index db9b0ce225..a7517a3258 100644 --- a/var/spack/repos/builtin/packages/hpgmg/package.py +++ b/var/spack/repos/builtin/packages/hpgmg/package.py @@ -37,10 +37,11 @@ class Hpgmg(Package): the second coarsening 6 times, etc.""" homepage = "https://bitbucket.org/hpgmg/hpgmg" - url = "https://bitbucket.org/hpgmg/hpgmg/get/master.tar.gz" + url = "https://hpgmg.org/static/hpgmg-0.tar.gz" tags = ['proxy-app'] - version('master', '4a2b139e1764c84ed7fe06334d3f8d8a') + version('a0a5510df23b', 'b9c50f25e541428d4735fb07344d1d0ed9fc821bdde918d8e0defa78c0d9b4f9') + version('develop', git='https://bitbucket.org/hpgmg/hpgmg.git', branch='master') variant( 'fe', default=True, description='Build finite element solver') @@ -48,6 +49,7 @@ class Hpgmg(Package): 'fv', default='mpi', values=('serial', 'mpi', 'none'), description='Build finite volume solver with or without MPI support') variant('cuda', default=False, description='Build with CUDA') + variant('debug', default=False, description='Build in debug mode') depends_on('petsc', when='+fe') depends_on('mpi', when='+fe') @@ -68,10 +70,18 @@ def configure_args(self): if 'mpi' in self.spec: args.append('--CC={0}'.format(self.spec['mpi'].mpicc)) + cflags = [] if 'fv=none' in self.spec: args.append('--no-fv') else: - args.append('--CFLAGS=' + self.compiler.openmp_flag) + cflags.append(self.compiler.openmp_flag) + + if '+debug' in self.spec: + cflags.append('-g') + elif any(map(self.spec.satisfies, ['%gcc', '%clang', '%intel'])): + cflags += ['-O3', '-march=native'] + + args.append('--CFLAGS=' + ' '.join(cflags)) return args