diff options
-rw-r--r-- | var/spack/repos/builtin/packages/superlu-mt/package.py | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/var/spack/repos/builtin/packages/superlu-mt/package.py b/var/spack/repos/builtin/packages/superlu-mt/package.py index 889e95f5bb..8f0e39d3aa 100644 --- a/var/spack/repos/builtin/packages/superlu-mt/package.py +++ b/var/spack/repos/builtin/packages/superlu-mt/package.py @@ -18,11 +18,16 @@ class SuperluMt(Package): version('3.1', sha256='407b544b9a92b2ed536b1e713e80f986824cf3016657a4bfc2f3e7d2a76ecab6') + variant('int64', default=False, + description='Build with 64 bit integers') + variant('pic', default=True, + description='Build with position independent code') variant('blas', default=True, description='Build with external BLAS library') # Must choose one or the other - variant('openmp', default=False, description='Build with OpenMP support') + variant('openmp', default=False, + description='Build with OpenMP support') variant('pthread', default=True, description='Build with POSIX threads support') @@ -85,7 +90,7 @@ class SuperluMt(Package): 'PREDEFS = -D_$(PLAT)', # Compilers and flags 'CC = {0}'.format(os.environ['CC']), - 'CFLAGS += $(PREDEFS) -D_LONGINT', + 'CFLAGS += $(PREDEFS)', 'NOOPTS = -O0', 'FORTRAN = {0}'.format(os.environ['FC']), 'LOADER = {0}'.format(os.environ['CC']), @@ -93,6 +98,19 @@ class SuperluMt(Package): 'CDEFS = -DAdd_' ]) + if '+int64' in spec: + config.extend([ + 'CFLAGS += -D_LONGINT', + ]) + + if '+pic' in spec: + config.extend([ + 'CFLAGS += {0}'.format(self.compiler.cc_pic_flag), + 'NOOPTS += {0}'.format(self.compiler.cc_pic_flag), + 'FFLAGS += {0}'.format(self.compiler.f77_pic_flag), + 'LOADOPTS += {0}'.format(self.compiler.cc_pic_flag) + ]) + # Write configuration options to include file with open('make.inc', 'w') as inc: for option in config: |