summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTiziano Müller <tiziano.mueller@chem.uzh.ch>2020-12-25 00:12:34 +0100
committerGitHub <noreply@github.com>2020-12-24 17:12:34 -0600
commit5d2c09e19e730783334bcec3112a3f7518fc544d (patch)
treed93e173c51922dc1cf7d4c87adf8f6012366f1cc
parent999b35cf5f58abc1281417fd8cbc8fdeb6a094c3 (diff)
downloadspack-5d2c09e19e730783334bcec3112a3f7518fc544d.tar.gz
spack-5d2c09e19e730783334bcec3112a3f7518fc544d.tar.bz2
spack-5d2c09e19e730783334bcec3112a3f7518fc544d.tar.xz
spack-5d2c09e19e730783334bcec3112a3f7518fc544d.zip
Add libvori and support for libvori (and spglib) in CP2K (#20508)
* packages: initial commit of libvori * cp2k: add support for libvori * cp2k: add support for spglib
-rw-r--r--var/spack/repos/builtin/packages/cp2k/package.py22
-rw-r--r--var/spack/repos/builtin/packages/libvori/package.py17
2 files changed, 39 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/cp2k/package.py b/var/spack/repos/builtin/packages/cp2k/package.py
index 1a74283b3c..6094a27225 100644
--- a/var/spack/repos/builtin/packages/cp2k/package.py
+++ b/var/spack/repos/builtin/packages/cp2k/package.py
@@ -47,6 +47,10 @@ class Cp2k(MakefilePackage, CudaPackage):
description=('Enable planewave electronic structure'
' calculations via SIRIUS'))
variant('cosma', default=False, description='Use COSMA for p?gemm')
+ variant('libvori', default=False,
+ description=('Enable support for Voronoi integration'
+ ' and BQB compression'))
+ variant('spglib', default=False, description='Enable support for spglib')
# override cuda_arch from CudaPackage since we only support one arch
# at a time and only specific ones for which we have parameter files
@@ -129,6 +133,9 @@ class Cp2k(MakefilePackage, CudaPackage):
depends_on('py-numpy', when='@7:+cuda', type='build')
depends_on('python@3.6:', when='@7:+cuda', type='build')
+ depends_on('libvori@201217:', when='@8:+libvori', type='build')
+ depends_on('spglib', when='+spglib')
+
# PEXSI, ELPA, COSMA and SIRIUS depend on MPI
conflicts('~mpi', '+pexsi')
conflicts('~mpi', '+elpa')
@@ -137,6 +144,8 @@ class Cp2k(MakefilePackage, CudaPackage):
conflicts('+sirius', '@:6.999') # sirius support was introduced in 7+
conflicts('+cosma', '@:7.999') # COSMA support was introduced in 8+
+ conflicts('+libvori', '@:7.999') # libvori support was introduced in 8+
+
conflicts('~cuda', '+cuda_fft')
conflicts('~cuda', '+cuda_blas')
@@ -479,6 +488,19 @@ class Cp2k(MakefilePackage, CudaPackage):
output=str).split()
libs += pkgconf('--libs', 'libxsmmf', output=str).split()
+ if '+libvori' in spec:
+ cppflags += ['-D__LIBVORI']
+ libvori = spec['libvori'].libs
+ ldflags += [libvori.search_flags]
+ libs += libvori
+ libs += ['-lstdc++']
+
+ if '+spglib' in spec:
+ cppflags += ['-D__SPGLIB']
+ spglib = spec['spglib'].libs
+ ldflags += [spglib.search_flags]
+ libs += spglib
+
dflags.extend(cppflags)
cflags.extend(cppflags)
cxxflags.extend(cppflags)
diff --git a/var/spack/repos/builtin/packages/libvori/package.py b/var/spack/repos/builtin/packages/libvori/package.py
new file mode 100644
index 0000000000..d8e484b85c
--- /dev/null
+++ b/var/spack/repos/builtin/packages/libvori/package.py
@@ -0,0 +1,17 @@
+# 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 Libvori(CMakePackage):
+ """Support for Voronoi Integration and lossless BQB compression"""
+
+ homepage = "https://brehm-research.de/voronoi.php"
+ url = "https://www.cp2k.org/static/downloads/libvori-201217.tar.gz"
+
+ maintainers = ['dev-zero']
+
+ version('201217', sha256='6ad456ed6ca5d28cadcc0d90eabe8fff5caa77b99f12764323de5e3ae21cddf5')