vasp: fix build with gfortran 10 and add version 6.1.1 (#20900)

* vasp: fix build with gfortran 10

Avoid Error: Type mismatch between actual argument at (1) and actual argument at (2)

* vasp: add version 6.1.1

* vasp 6: allow building without CUDA
This commit is contained in:
Michael Kuron 2021-01-18 23:54:52 +01:00 committed by GitHub
parent bd51f81e20
commit cec784bb10
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -18,6 +18,7 @@ class Vasp(MakefilePackage):
homepage = "http://vasp.at"
url = "file://{0}/vasp.5.4.4.pl2.tgz".format(os.getcwd())
version('6.1.1', sha256='e37a4dfad09d3ad0410833bcd55af6b599179a085299026992c2d8e319bf6927')
version('5.4.4.pl2', sha256='98f75fd75399a23d76d060a6155f4416b340a1704f256a00146f89024035bc8e')
version('5.4.4', sha256='5bd2449462386f01e575f9adf629c08cb03a13142806ffb6a71309ca4431cfb3')
@ -76,6 +77,9 @@ def edit(self, spec, prefix):
filter_file('^CPP_OPTIONS[ ]{0,}=[ ]{0,}',
'CPP_OPTIONS ?= ',
'makefile.include')
filter_file('^FFLAGS[ ]{0,}=[ ]{0,}',
'FFLAGS ?= ',
'makefile.include')
filter_file('^LIBDIR[ ]{0,}=.*$', '', 'makefile.include')
filter_file('^BLAS[ ]{0,}=.*$', 'BLAS ?=', 'makefile.include')
@ -113,8 +117,13 @@ def setup_build_environment(self, spack_env):
'-Dqd_emulate'])
else:
cpp_options.append('-DHOST=\\"LinuxGNU\\"')
if self.spec.satisfies('@6:'):
cpp_options.append('-Dvasp6')
cflags = ['-fPIC', '-DADD_']
fflags = []
if '%gcc' in spec or '%intel' in spec:
fflags.append('-w')
spack_env.set('BLAS', spec['blas'].libs.ld_flags)
spack_env.set('LAPACK', spec['lapack'].libs.ld_flags)
@ -141,15 +150,19 @@ def setup_build_environment(self, spack_env):
if '+vaspsol' in spec:
cpp_options.append('-Dsol_compat')
if spec.satisfies('%gcc@10:'):
fflags.append('-fallow-argument-mismatch')
# Finally
spack_env.set('CPP_OPTIONS', ' '.join(cpp_options))
spack_env.set('CFLAGS', ' '.join(cflags))
spack_env.set('FFLAGS', ' '.join(fflags))
def build(self, spec, prefix):
if '+cuda' in self.spec:
make('gpu', 'gpu_ncl')
else:
make()
make('std', 'gam', 'ncl')
def install(self, spec, prefix):
install_tree('bin/', prefix.bin)