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
This commit is contained in:
Tiziano Müller 2020-12-25 00:12:34 +01:00 committed by GitHub
parent 999b35cf5f
commit 5d2c09e19e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 39 additions and 0 deletions

View file

@ -47,6 +47,10 @@ class Cp2k(MakefilePackage, CudaPackage):
description=('Enable planewave electronic structure' description=('Enable planewave electronic structure'
' calculations via SIRIUS')) ' calculations via SIRIUS'))
variant('cosma', default=False, description='Use COSMA for p?gemm') 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 # override cuda_arch from CudaPackage since we only support one arch
# at a time and only specific ones for which we have parameter files # 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('py-numpy', when='@7:+cuda', type='build')
depends_on('python@3.6:', 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 # PEXSI, ELPA, COSMA and SIRIUS depend on MPI
conflicts('~mpi', '+pexsi') conflicts('~mpi', '+pexsi')
conflicts('~mpi', '+elpa') conflicts('~mpi', '+elpa')
@ -137,6 +144,8 @@ class Cp2k(MakefilePackage, CudaPackage):
conflicts('+sirius', '@:6.999') # sirius support was introduced in 7+ conflicts('+sirius', '@:6.999') # sirius support was introduced in 7+
conflicts('+cosma', '@:7.999') # COSMA support was introduced in 8+ 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_fft')
conflicts('~cuda', '+cuda_blas') conflicts('~cuda', '+cuda_blas')
@ -479,6 +488,19 @@ def edit(self, spec, prefix):
output=str).split() output=str).split()
libs += pkgconf('--libs', 'libxsmmf', 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) dflags.extend(cppflags)
cflags.extend(cppflags) cflags.extend(cppflags)
cxxflags.extend(cppflags) cxxflags.extend(cppflags)

View file

@ -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')