summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorTiziano Müller <tiziano.mueller@chem.uzh.ch>2019-04-30 21:52:13 +0200
committerPeter Scheibel <scheibel1@llnl.gov>2019-05-01 04:52:13 +0900
commitd2786ec0640ae762f91b3c9234d78c3c7d52a620 (patch)
tree57f0582c92b7bd3f539ab734f4489a31a462417c /var
parent8e5e36dc0bcb8a1740d764359b36627cb4a30cef (diff)
downloadspack-d2786ec0640ae762f91b3c9234d78c3c7d52a620.tar.gz
spack-d2786ec0640ae762f91b3c9234d78c3c7d52a620.tar.bz2
spack-d2786ec0640ae762f91b3c9234d78c3c7d52a620.tar.xz
spack-d2786ec0640ae762f91b3c9234d78c3c7d52a620.zip
CP2K package: add versions and tests, adjust optimization flags (#11263)
* Remove -ffast-math optimization flag * Add 'develop' version which points to git repo * Depend on libint for all versions >= 3.0 * Build directory is different for versions >= 7 (including develop) * Add "make test" as post install check
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/cp2k/package.py23
1 files changed, 20 insertions, 3 deletions
diff --git a/var/spack/repos/builtin/packages/cp2k/package.py b/var/spack/repos/builtin/packages/cp2k/package.py
index 6a5d9a46fb..7825076703 100644
--- a/var/spack/repos/builtin/packages/cp2k/package.py
+++ b/var/spack/repos/builtin/packages/cp2k/package.py
@@ -17,12 +17,14 @@ class Cp2k(MakefilePackage):
"""
homepage = 'https://www.cp2k.org'
url = 'https://github.com/cp2k/cp2k/releases/download/v3.0.0/cp2k-3.0.tar.bz2'
+ git = 'https://github.com/cp2k/cp2k.git'
list_url = 'https://github.com/cp2k/cp2k/releases'
version('6.1', sha256='af803558e0a6b9e9d9ce8a3ab955ba32bacd179922455424e061c82c9fefa34b')
version('5.1', sha256='e23613b593354fa82e0b8410e17d94c607a0b8c6d9b5d843528403ab09904412')
version('4.1', sha256='4a3e4a101d8a35ebd80a9e9ecb02697fb8256364f1eccdbe4e5a85d31fe21343')
version('3.0', sha256='1acfacef643141045b7cbade7006f9b7538476d861eeecd9658c9e468dc61151')
+ version('develop', branch='master', submodules="True")
variant('mpi', default=True, description='Enable MPI support')
variant('blas', default='openblas', values=('openblas', 'mkl', 'accelerate'),
@@ -59,7 +61,7 @@ class Cp2k(MakefilePackage):
depends_on('pkgconfig', type='build', when='smm=libxsmm')
# libint & libxc are always statically linked
- depends_on('libint@1.1.4:1.2', when='@3.0:6.999', type='build')
+ depends_on('libint@1.1.4:1.2', when='@3.0:', type='build')
depends_on('libxc@2.2.2:', when='+libxc@:5.5999', type='build')
depends_on('libxc@4.0.3:', when='+libxc@6.0:', type='build')
@@ -125,7 +127,6 @@ class Cp2k(MakefilePackage):
'-O2',
'-mtune=native',
'-funroll-loops',
- '-ffast-math',
'-ftree-vectorize',
],
'intel': ['-O2', '-pc64', '-unroll'],
@@ -361,7 +362,13 @@ class Cp2k(MakefilePackage):
@property
def build_directory(self):
- return os.path.join(self.stage.source_path, 'makefiles')
+ build_dir = self.stage.source_path
+
+ if self.spec.satisfies('@:6.9999'):
+ # prior to version 7.1 was the Makefile located in makefiles/
+ build_dir = os.path.join(build_dir, 'makefiles')
+
+ return build_dir
@property
def build_targets(self):
@@ -380,3 +387,13 @@ class Cp2k(MakefilePackage):
exe_dir = os.path.join('exe', self.makefile_architecture)
install_tree(exe_dir, self.prefix.bin)
install_tree('data', self.prefix.share.data)
+
+ def check(self):
+ data_dir = os.path.join(self.stage.source_path, 'data')
+
+ # CP2K < 7 still uses $PWD to detect the current working dir
+ # and Makefile is in a subdir, account for both facts here:
+ with spack.util.environment.set_env(CP2K_DATA_DIR=data_dir,
+ PWD=self.build_directory):
+ with working_dir(self.build_directory):
+ make('test', *self.build_targets)