diff --git a/var/spack/repos/builtin/packages/petsc/package.py b/var/spack/repos/builtin/packages/petsc/package.py index 99800b501..b40173fe6 100644 --- a/var/spack/repos/builtin/packages/petsc/package.py +++ b/var/spack/repos/builtin/packages/petsc/package.py @@ -195,10 +195,7 @@ class Petsc(Package): '--download-hwloc=0', 'CFLAGS=%s' % ' '.join(spec.compiler_flags['cflags']), 'FFLAGS=%s' % ' '.join(spec.compiler_flags['fflags']), - 'CXXFLAGS=%s' % ' '.join(spec.compiler_flags['cxxflags']), - 'COPTFLAGS=', - 'FOPTFLAGS=', - 'CXXOPTFLAGS='] + 'CXXFLAGS=%s' % ' '.join(spec.compiler_flags['cxxflags'])] options.extend(self.mpi_dependent_options()) options.extend([ '--with-precision=%s' % ( @@ -209,6 +206,13 @@ class Petsc(Package): '--with-debugging=%s' % ('1' if '+debug' in spec else '0'), '--with-64-bit-indices=%s' % ('1' if '+int64' in spec else '0') ]) + if '+debug' in spec: + options.append('--with-debugging=%s') + else: + options.extend(['COPTFLAGS=', + 'FOPTFLAGS=', + 'CXXOPTFLAGS=']) + # Make sure we use exactly the same Blas/Lapack libraries # across the DAG. To that end list them explicitly lapack_blas = spec['lapack'].libs + spec['blas'].libs