diff options
-rw-r--r-- | var/spack/repos/builtin/packages/shtools/package.py | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/var/spack/repos/builtin/packages/shtools/package.py b/var/spack/repos/builtin/packages/shtools/package.py index 56cf255a8c..6b90a5156a 100644 --- a/var/spack/repos/builtin/packages/shtools/package.py +++ b/var/spack/repos/builtin/packages/shtools/package.py @@ -14,6 +14,7 @@ class Shtools(MakefilePackage): maintainers = ['eschnett'] + version('4.8', sha256='c36fc86810017e544abbfb12f8ddf6f101a1ac8b89856a76d7d9801ffc8dac44') version('4.5', sha256='1975a2a2bcef8c527d321be08c13c2bc479e0d6b81c468a3203f95df59be4f89') # Note: This package also provides Python wrappers. We do not @@ -30,18 +31,23 @@ class Shtools(MakefilePackage): def makeopts(self, spec, prefix): return [ "F95={0}".format(self.compiler.fc), - ("F95FLAGS={0} -O3 -std=f2003 -ffast-math". - format(self.compiler.fc_pic_flag)), + "F95FLAGS={0} -O3 -std=gnu -ffast-math". + format(self.compiler.fc_pic_flag), "OPENMPFLAGS={0}".format(self.compiler.openmp_flag), "BLAS={0}".format(spec['blas'].libs), "FFTW={0}".format(spec['fftw'].libs), "LAPACK={0}".format(spec['lapack'].libs), "PREFIX={0}".format(prefix), + "PWD={0}".format(self.build_directory), ] def build(self, spec, prefix): - target = 'fortran-mp' if spec.satisfies('+openmp') else 'fortran' - make(target, *self.makeopts(self, spec, prefix)) + with working_dir(self.build_directory): + # The 'fortran' and 'fortran-mp' targets must be built separately + make('fortran', *self.makeopts(spec, prefix)) + if spec.satisfies('+openmp'): + make('fortran-mp', *self.makeopts(spec, prefix)) def install(self, spec, prefix): - make('install', *self.makeopts(self, spec, prefix)) + with working_dir(self.build_directory): + make('install', *self.makeopts(spec, prefix)) |