Update VASP package for NVIDIA compilers (#23020)

Co-authored-by: Scott McMillan <smcmillan@nvidia.com>
This commit is contained in:
Scott McMillan 2021-04-16 17:43:10 -05:00 committed by GitHub
parent 212d33ecda
commit 4919eac5d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -58,6 +58,7 @@ def edit(self, spec, prefix):
make_include = join_path('arch', 'makefile.include.linux_gnu') make_include = join_path('arch', 'makefile.include.linux_gnu')
elif '%nvhpc' in spec: elif '%nvhpc' in spec:
make_include = join_path('arch', 'makefile.include.linux_pgi') make_include = join_path('arch', 'makefile.include.linux_pgi')
filter_file('-pgc++libs', '-c++libs', make_include, string=True)
filter_file('pgcc', spack_cc, make_include) filter_file('pgcc', spack_cc, make_include)
filter_file('pgc++', spack_cxx, make_include, string=True) filter_file('pgc++', spack_cxx, make_include, string=True)
filter_file('pgfortran', spack_fc, make_include) filter_file('pgfortran', spack_fc, make_include)
@ -125,12 +126,17 @@ def setup_build_environment(self, spack_env):
fflags = [] fflags = []
if '%gcc' in spec or '%intel' in spec: if '%gcc' in spec or '%intel' in spec:
fflags.append('-w') fflags.append('-w')
elif '%nvhpc' in spec:
fflags.extend(['-Mnoupcase', '-Mbackslash', '-Mlarge_arrays'])
spack_env.set('BLAS', spec['blas'].libs.ld_flags) spack_env.set('BLAS', spec['blas'].libs.ld_flags)
spack_env.set('LAPACK', spec['lapack'].libs.ld_flags) spack_env.set('LAPACK', spec['lapack'].libs.ld_flags)
spack_env.set('FFTW', spec['fftw'].prefix) spack_env.set('FFTW', spec['fftw'].prefix)
spack_env.set('MPI_INC', spec['mpi'].prefix.include) spack_env.set('MPI_INC', spec['mpi'].prefix.include)
if '%nvhpc' in spec:
spack_env.set('QD', spec['qd'].prefix)
if '+scalapack' in spec: if '+scalapack' in spec:
cpp_options.append('-DscaLAPACK') cpp_options.append('-DscaLAPACK')
spack_env.set('SCALAPACK', spec['netlib-scalapack'].libs.ld_flags) spack_env.set('SCALAPACK', spec['netlib-scalapack'].libs.ld_flags)