Update of siesta libs (#26489)

This commit is contained in:
Daniele Cesarini 2021-10-11 16:09:39 +02:00 committed by GitHub
parent 78200b6b41
commit 79aba5942a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 78 additions and 7 deletions

View File

@ -3,6 +3,8 @@
# #
# SPDX-License-Identifier: (Apache-2.0 OR MIT) # SPDX-License-Identifier: (Apache-2.0 OR MIT)
import os
from spack import * from spack import *
@ -10,12 +12,26 @@ class Libgridxc(Package):
"""A library to compute the exchange and correlation energy and potential """A library to compute the exchange and correlation energy and potential
in spherical (i.e. an atom) or periodic systems.""" in spherical (i.e. an atom) or periodic systems."""
homepage = "https://launchpad.net/libgridxc" homepage = "https://gitlab.com/siesta-project/libraries/libgridxc"
url = "https://launchpad.net/libgridxc/trunk/0.7/+download/libgridxc-0.7.6.tgz" git = "https://gitlab.com/siesta-project/libraries/libgridxc.git"
url = "https://gitlab.com/siesta-project/libraries/libgridxc/-/archive/libgridxc-0.9.6/libgridxc-libgridxc-0.9.6.tar.gz"
version('0.7.6', sha256='ecf88ea68b9dbbdae3e86c8d598aee63b134f2f2d0e879fdedc06544b8267b91') version('0.9.6', sha256='3b89ccc02d65729ea2d7cb291ae1d9b53acd65c1fd144e8846362cffb71b114a')
version('0.9.5', sha256='98aa34dbaffe360ff332606eebb7c842994244a3114015d89c5a3850298c40aa')
version('0.9.1', sha256='346735e30dd3a4099532a985b7a491f6d2b882954a527bdac655d87232be5341')
version('0.8.5', sha256='af293be83d85908231aba9074f2b51545457bc7fce87fab9f72010a10f0028a6')
version('0.8.4', sha256='b4f2f4af1f0c98b9e82505b99924da16e8c7719dd3e3e95f1d16e504b43944ce')
version('0.8.3', sha256='01643c2e009474d4eb1f945f7e506f465bf0378d19e56028bc4a9af56ab0b1f3')
version('0.8.0', sha256='ff89b3302f850d1d9f651951e4ade20dfa4c71c809a2d86382c6797392064c9c')
version('0.7.6', sha256='058b80f40c85997eea0eae3f15b7cc8105f817e59564106308b22f57a03b216b')
phases = ['configure', 'install'] depends_on('autoconf@2.69:', type='build')
depends_on('automake@1.14:', type='build')
depends_on('libtool@2.4.2:', type='build')
depends_on('m4', type='build')
depends_on('libxc@:4.3.4', when='@0.8.0:')
phases = ['configure', 'build', 'install']
def configure(self, spec, prefix): def configure(self, spec, prefix):
sh = which('sh') sh = which('sh')
@ -23,6 +39,24 @@ def configure(self, spec, prefix):
sh('../src/config.sh') sh('../src/config.sh')
copy('../extra/fortran.mk', 'fortran.mk') copy('../extra/fortran.mk', 'fortran.mk')
def install(self, spec, prefix): def build(self, spec, prefix):
with working_dir('build'): with working_dir('build'):
make('PREFIX=%s' % self.prefix, 'FC=fc') if self.version < Version('0.8.0'):
make('PREFIX=%s' % self.prefix,
'FC=fc',
parallel=False)
else:
make('PREFIX=%s' % self.prefix,
'FC=fc',
'WITH_LIBXC=1',
'LIBXC_ROOT=%s' % self.spec['libxc'].prefix,
parallel=False)
def install(self, spec, prefix):
mkdirp(join_path(self.prefix, 'share', 'org.siesta-project'))
install(join_path(self.prefix, 'gridxc.mk'),
join_path(self.prefix, 'share', 'org.siesta-project', 'gridxc.mk'))
os.remove(join_path(self.prefix, 'gridxc.mk'))
install(join_path(self.prefix, 'libxc.mk'),
join_path(self.prefix, 'share', 'org.siesta-project', 'libxc.mk'))
os.remove(join_path(self.prefix, 'libxc.mk'))

View File

@ -0,0 +1,30 @@
# Copyright 2013-2021 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 Libpsml(AutotoolsPackage):
"""libPSML is a library to handle pseudopotentials in PSML format."""
homepage = "https://gitlab.com/siesta-project/libraries/libpsml"
git = "https://gitlab.com/siesta-project/libraries/libpsml.git"
url = "https://gitlab.com/siesta-project/libraries/libpsml/-/archive/libpsml-1.1.10/libpsml-libpsml-1.1.10.tar.gz"
version('1.1.10', sha256='ba87ece7d443a42a5db3a119c555a29a391a060dd6f3f5039a2c6ea248b7fe84')
version('1.1.9', sha256='04b8de33c555ae94a790116cd3cf7b6c9e8ec9a018562edff544a2e04876cf0c')
version('1.1.8', sha256='77498783be1bc7006819f36c42477b5913464b8c660203f7d6b7f7e25aa29145')
version('1.1.7', sha256='b3f5431fd3965b66fe01b899c0c3ef73d9f969d67329cd1f5aba84fb056b5dd1')
version('1.1.6', sha256='521647dbd945b208e5d468fceeb2bc397737d9a659e2c7549597bf4eb29f60df')
depends_on('autoconf@2.69:', type='build')
depends_on('automake@1.14:', type='build')
depends_on('libtool@2.4.2:', type='build')
depends_on('m4', type='build')
depends_on('xmlf90')
def configure_args(self):
return ['--with-xmlf90=%s' % self.spec['xmlf90'].prefix]

View File

@ -11,8 +11,10 @@ class Xmlf90(AutotoolsPackage):
"""xmlf90 is a suite of libraries to handle XML in Fortran.""" """xmlf90 is a suite of libraries to handle XML in Fortran."""
homepage = "https://launchpad.net/xmlf90" homepage = "https://launchpad.net/xmlf90"
url = "https://launchpad.net/xmlf90/trunk/1.5/+download/xmlf90-1.5.2.tgz" url = "https://launchpad.net/xmlf90/trunk/1.5/+download/xmlf90-1.5.4.tar.gz"
version('1.5.4', sha256='a0b1324ff224d5b5ad1127a6ad4f90979f6b127f1a517f98253eea377237bbe4')
version('1.5.3', sha256='a5378a5d9df4b617f51382092999eb0f20fa1a90ab49afbccfd80aa51650d27c')
version('1.5.2', sha256='666694db793828d1d1e9aea665f75c75ee21772693465a88b43e6370862abfa6') version('1.5.2', sha256='666694db793828d1d1e9aea665f75c75ee21772693465a88b43e6370862abfa6')
depends_on('autoconf@2.69:', type='build') depends_on('autoconf@2.69:', type='build')
@ -20,6 +22,11 @@ class Xmlf90(AutotoolsPackage):
depends_on('libtool@2.4.2:', type='build') depends_on('libtool@2.4.2:', type='build')
depends_on('m4', type='build') depends_on('m4', type='build')
def url_for_version(self, version):
url = 'https://launchpad.net/xmlf90/trunk/{0}/+download/xmlf90-{1}.tar.gz'
return url.format(version.up_to(2), version)
@when('@1.5.2')
def autoreconf(self, spec, prefix): def autoreconf(self, spec, prefix):
sh = which('sh') sh = which('sh')
sh('autogen.sh') sh('autogen.sh')