summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErik Schnetter <schnetter@gmail.com>2020-02-21 15:30:25 -0500
committerGitHub <noreply@github.com>2020-02-21 14:30:25 -0600
commit6d8e0699f4d558c031ceb4c4e2f2414b8a530aac (patch)
tree3745900c32e4fcc0b928981c3ddc475302788a3a
parent0bc4a778bda3c5a6b127bc9979ba1f8157287f06 (diff)
downloadspack-6d8e0699f4d558c031ceb4c4e2f2414b8a530aac.tar.gz
spack-6d8e0699f4d558c031ceb4c4e2f2414b8a530aac.tar.bz2
spack-6d8e0699f4d558c031ceb4c4e2f2414b8a530aac.tar.xz
spack-6d8e0699f4d558c031ceb4c4e2f2414b8a530aac.zip
shtools: New package (#15133)
* shtools: New package * shtools: Convert to MakefilePackage, use Spack's generic compiler flags * shtools: Make function location explicit
-rw-r--r--var/spack/repos/builtin/packages/shtools/package.py47
1 files changed, 47 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/shtools/package.py b/var/spack/repos/builtin/packages/shtools/package.py
new file mode 100644
index 0000000000..77871d7a36
--- /dev/null
+++ b/var/spack/repos/builtin/packages/shtools/package.py
@@ -0,0 +1,47 @@
+# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
+# Spack Project Developers. See the top-level COPYRIGHT file for details.
+#
+# SPDX-License-Identifier: (Apache-2.0 OR MIT)
+
+from spack import *
+
+
+class Shtools(MakefilePackage):
+ """SHTOOLS - Spherical Harmonic Tools"""
+
+ homepage = "https://shtools.github.io/SHTOOLS/"
+ url = "https://github.com/SHTOOLS/SHTOOLS/archive/v4.5.tar.gz"
+
+ maintainers = ['eschnett']
+
+ version('4.5', sha256='1975a2a2bcef8c527d321be08c13c2bc479e0d6b81c468a3203f95df59be4f89')
+
+ # Note: This package also provides Python wrappers. We do not
+ # install these properly yet, only the Fortran library is
+ # installed.
+
+ variant('openmp', default=True, description="Enable OpenMP support")
+
+ depends_on('blas')
+ depends_on('fftw')
+ depends_on('lapack')
+
+ # Options for the Makefile
+ def makeopts(self, spec, prefix):
+ return [
+ "F95={0}".format(self.compiler.fc),
+ ("F95FLAGS={0} -O3 -std=f2003 -ffast-math".
+ format(self.compiler.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),
+ ]
+
+ def build(self, spec, prefix):
+ target = 'fortran-mp' if spec.satisfies('+openmp') else 'fortran'
+ make(target, *self.makeopts(self, spec, prefix))
+
+ def install(self, spec, prefix):
+ make('install', *self.makeopts(self, spec, prefix))