Update packages for NVIDIA HPC SDK 21.1 (#21975)

Co-authored-by: Scott McMillan <smcmillan@nvidia.com>
This commit is contained in:
Scott McMillan 2021-04-07 02:41:43 -05:00 committed by GitHub
parent c188575cfe
commit 51ac05483d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
21 changed files with 109 additions and 19 deletions

View File

@ -0,0 +1,38 @@
--- a/lib/xalloc-oversized.h
+++ b/lib/xalloc-oversized.h
@@ -41,10 +41,10 @@
positive and N must be nonnegative. This is a macro, not a
function, so that it works correctly even when SIZE_MAX < N. */
-#if 7 <= __GNUC__ && !defined __clang__
+#if 7 <= __GNUC__ && !defined __clang__ && !defined __NVCOMPILER
# define xalloc_oversized(n, s) \
__builtin_mul_overflow_p (n, s, (__xalloc_count_type) 1)
-#elif 5 <= __GNUC__ && !defined __ICC && !__STRICT_ANSI__
+#elif 5 <= __GNUC__ && !defined __ICC && !__STRICT_ANSI__ && !defined __NVCOMPILER
# define xalloc_oversized(n, s) \
(__builtin_constant_p (n) && __builtin_constant_p (s) \
? __xalloc_oversized (n, s) \
--- a/lib/intprops.h
+++ b/lib/intprops.h
@@ -226,9 +226,9 @@
/* True if __builtin_add_overflow (A, B, P) and __builtin_sub_overflow
(A, B, P) work when P is non-null. */
-#if 5 <= __GNUC__ && !defined __ICC
+#if 5 <= __GNUC__ && !defined __ICC && !defined __NVCOMPILER
# define _GL_HAS_BUILTIN_ADD_OVERFLOW 1
-#elif defined __has_builtin
+#elif defined __has_builtin && !defined __NVCOMPILER
# define _GL_HAS_BUILTIN_ADD_OVERFLOW __has_builtin (__builtin_add_overflow)
#else
# define _GL_HAS_BUILTIN_ADD_OVERFLOW 0
@@ -249,7 +249,7 @@
presumably run afoul of Clang bug 16404. */
# define _GL_HAS_BUILTIN_OVERFLOW_P 0
#else
-# define _GL_HAS_BUILTIN_OVERFLOW_P (7 <= __GNUC__)
+# define _GL_HAS_BUILTIN_OVERFLOW_P (7 <= __GNUC__ && !defined __NVCOMPILER)
#endif
/* The _GL*_OVERFLOW macros have the same restrictions as the

View File

@ -51,7 +51,10 @@ class Bison(AutotoolsPackage, GNUMirrorPackage):
depends_on('help2man', type='build') depends_on('help2man', type='build')
patch('pgi.patch', when='@3.0.4') patch('pgi.patch', when='@3.0.4')
patch('nvhpc.patch', when='%nvhpc') # The NVIDIA compilers do not currently support some GNU builtins.
# Detect this case and use the fallback path.
patch('nvhpc-3.6.patch', when='@3.6.0:3.6.99 %nvhpc')
patch('nvhpc-3.7.patch', when='@3.7.0:3.7.99 %nvhpc')
conflicts('%intel@:14', when='@3.4.2:', conflicts('%intel@:14', when='@3.4.2:',
msg="Intel 14 has immature C11 support") msg="Intel 14 has immature C11 support")

View File

@ -52,7 +52,7 @@ def patch(self):
) )
# The Makefiles use GCC flags that are incompatible with PGI # The Makefiles use GCC flags that are incompatible with PGI
if self.spec.satisfies('%pgi') or self.spec.satisfies('%nvhpc'): if self.spec.satisfies('%pgi') or self.spec.satisfies('%nvhpc@:20.11'):
filter_file('-Wall -Winline', '-Minform=inform', 'Makefile') filter_file('-Wall -Winline', '-Minform=inform', 'Makefile')
filter_file('-Wall -Winline', '-Minform=inform', filter_file('-Wall -Winline', '-Minform=inform',
'Makefile-libbz2_so') 'Makefile-libbz2_so')

View File

@ -61,7 +61,7 @@ def build_targets(self):
targets = [] targets = []
cc = self.spec['mpi'].mpicc cc = self.spec['mpi'].mpicc
cflags = '-O3' cflags = '-O3'
if not self.spec.satisfies('%nvhpc'): if not self.spec.satisfies('%nvhpc@:20.11'):
cflags = '-O3 -std=c99' cflags = '-O3 -std=c99'
oshmem_cc = 'cc' oshmem_cc = 'cc'
oshmem_c_flags = '-O3 -g' oshmem_c_flags = '-O3 -g'

View File

@ -237,7 +237,10 @@ def cmake_args(self):
options.append('-DGMX_SIMD=AVX_128_FMA') options.append('-DGMX_SIMD=AVX_128_FMA')
elif 'vsx' in target: elif 'vsx' in target:
# IBM Power 7 and beyond # IBM Power 7 and beyond
options.append('-DGMX_SIMD=IBM_VSX') if self.spec.satisfies('%nvhpc'):
options.append('-DGMX_SIMD=None')
else:
options.append('-DGMX_SIMD=IBM_VSX')
elif target.family == 'aarch64': elif target.family == 'aarch64':
# ARMv8 # ARMv8
if self.spec.satisfies('%nvhpc'): if self.spec.satisfies('%nvhpc'):

View File

@ -34,7 +34,7 @@ class Libpciaccess(AutotoolsPackage, XorgPackage):
def configure_args(self): def configure_args(self):
config_args = [] config_args = []
if (self.spec.satisfies('%nvhpc') and if (self.spec.satisfies('%nvhpc@:20.11') and
(self.spec.target.family == 'aarch64' or (self.spec.target.family == 'aarch64' or
self.spec.target.family == 'ppc64le')): self.spec.target.family == 'ppc64le')):
config_args.append('--disable-strict-compilation') config_args.append('--disable-strict-compilation')

View File

@ -26,6 +26,6 @@ class Libtiff(AutotoolsPackage):
def patch(self): def patch(self):
# Remove flags not recognized by the NVIDIA compiler # Remove flags not recognized by the NVIDIA compiler
if self.spec.satisfies('%nvhpc'): if self.spec.satisfies('%nvhpc@:20.11'):
filter_file('vl_cv_prog_cc_warnings="-Wall -W"', filter_file('vl_cv_prog_cc_warnings="-Wall -W"',
'vl_cv_prog_cc_warnings="-Wall"', 'configure') 'vl_cv_prog_cc_warnings="-Wall"', 'configure')

View File

@ -55,7 +55,7 @@ def _make_executable(self, name):
def patch(self): def patch(self):
# Remove flags not recognized by the NVIDIA compiler # Remove flags not recognized by the NVIDIA compiler
if self.spec.satisfies('%nvhpc'): if self.spec.satisfies('%nvhpc@:20.11'):
filter_file('-fno-builtin', '-Mnobuiltin', 'configure') filter_file('-fno-builtin', '-Mnobuiltin', 'configure')
filter_file('-fno-builtin', '-Mnobuiltin', 'libltdl/configure') filter_file('-fno-builtin', '-Mnobuiltin', 'libltdl/configure')

View File

@ -33,7 +33,7 @@ def configure_args(self):
config_args = [] config_args = []
# -Werror flags are not properly interpreted by the NVIDIA compiler # -Werror flags are not properly interpreted by the NVIDIA compiler
if self.spec.satisfies('%nvhpc'): if self.spec.satisfies('%nvhpc@:20.11'):
config_args.append('--disable-selective-werror') config_args.append('--disable-selective-werror')
return config_args return config_args

View File

@ -53,7 +53,7 @@ def configure_args(self):
config_args = [] config_args = []
# -Werror flags are not properly interpreted by the NVIDIA compiler # -Werror flags are not properly interpreted by the NVIDIA compiler
if self.spec.satisfies('%nvhpc'): if self.spec.satisfies('%nvhpc@:20.11'):
config_args.append('--disable-selective-werror') config_args.append('--disable-selective-werror')
return config_args return config_args

View File

@ -51,7 +51,7 @@ def install(self, spec, prefix):
def patch(self): def patch(self):
# Remove flags not recognized by the NVIDIA compiler # Remove flags not recognized by the NVIDIA compiler
if self.spec.satisfies('%nvhpc'): if self.spec.satisfies('%nvhpc@:20.11'):
filter_file('-fvisibility=hidden', '', 'Makefile') filter_file('-fvisibility=hidden', '', 'Makefile')
filter_file('-fvisibility=hidden', '', 'lib/Makefile') filter_file('-fvisibility=hidden', '', 'lib/Makefile')
filter_file('-pedantic', '', 'Makefile') filter_file('-pedantic', '', 'Makefile')

View File

@ -49,7 +49,7 @@ def configure_args(self):
return args return args
def patch(self): def patch(self):
if self.spec.satisfies('%nvhpc'): if self.spec.satisfies('%nvhpc@:20.11'):
# workaround anonymous version tag linker error for the NVIDIA # workaround anonymous version tag linker error for the NVIDIA
# compilers # compilers
filter_file('${wl}-version-script ' filter_file('${wl}-version-script '

View File

@ -29,7 +29,7 @@ class Nasm(AutotoolsPackage):
def patch(self): def patch(self):
# Remove flags not recognized by the NVIDIA compiler # Remove flags not recognized by the NVIDIA compiler
if self.spec.satisfies('%nvhpc'): if self.spec.satisfies('%nvhpc@:20.11'):
filter_file(r'CFLAGS="\$pa_add_cflags__old_cflags -Werror=.*"', filter_file(r'CFLAGS="\$pa_add_cflags__old_cflags -Werror=.*"',
'CFLAGS="$pa_add_cflags__old_cflags"', 'configure') 'CFLAGS="$pa_add_cflags__old_cflags"', 'configure')
filter_file(r'CFLAGS="\$pa_add_flags__old_flags -Werror=.*"', filter_file(r'CFLAGS="\$pa_add_flags__old_flags -Werror=.*"',

View File

@ -173,7 +173,7 @@ class Openmpi(AutotoolsPackage):
patch('nag_pthread/2.0.0_2.1.1.patch', when='@2.0.0:2.1.1%nag') patch('nag_pthread/2.0.0_2.1.1.patch', when='@2.0.0:2.1.1%nag')
patch('nag_pthread/1.10.4_1.10.999.patch', when='@1.10.4:1.10.999%nag') patch('nag_pthread/1.10.4_1.10.999.patch', when='@1.10.4:1.10.999%nag')
patch('nvhpc-libtool.patch', when='%nvhpc@develop') patch('nvhpc-libtool.patch', when='@develop %nvhpc')
patch('nvhpc-configure.patch', when='%nvhpc') patch('nvhpc-configure.patch', when='%nvhpc')
# Fix MPI_Sizeof() in the "mpi" Fortran module for compilers that do not # Fix MPI_Sizeof() in the "mpi" Fortran module for compilers that do not
@ -756,7 +756,7 @@ def configure_args(self):
else: else:
config_args.append('--without-cuda') config_args.append('--without-cuda')
if spec.satisfies('%nvhpc'): if spec.satisfies('%nvhpc@:20.11'):
# Workaround compiler issues # Workaround compiler issues
config_args.append('CFLAGS=-O1') config_args.append('CFLAGS=-O1')

View File

@ -114,7 +114,7 @@ def install(self, spec, prefix):
if spec.satisfies('@1.0'): if spec.satisfies('@1.0'):
options.append('no-krb5') options.append('no-krb5')
# clang does not support the .arch directive in assembly files. # clang does not support the .arch directive in assembly files.
if 'clang' in self.compiler.cc and \ if ('clang' in self.compiler.cc or 'nvc' in self.compiler.cc) and \
'aarch64' in spack.architecture.sys_type(): 'aarch64' in spack.architecture.sys_type():
options.append('no-asm') options.append('no-asm')

View File

@ -0,0 +1,42 @@
--- a/Configure 2021-01-19 09:35:25.337234880 -0800
+++ b/Configure 2021-01-19 09:36:43.001275967 -0800
@@ -4979,7 +4979,7 @@
# and usrinc directly from the compiler.
# Note that ccname for clang is also gcc.
case "$ccname" in
- gcc)
+ XXX)
$echo 'extern int foo;' > try.c
set X `$cppstdin -v try.c 2>&1 | $awk '/^#include </,/^End of search /'|$cppfilter $grep '/include'`
shift
--- a/Makefile.SH 2021-01-28 15:18:51.559057410 -0800
+++ b/Makefile.SH 2021-01-28 15:20:01.552036603 -0800
@@ -1143,7 +1143,7 @@
# But also this ensures that all extensions are built before we try to scan
# them, which picks up Devel::PPPort's documentation.
pod/perltoc.pod: $(perltoc_pod_prereqs) $(PERL_EXE) $(ext) pod/buildtoc
- $(RUN_PERL) -f pod/buildtoc -q
+ $(MINIPERL) -f pod/buildtoc -q
pod/perlapi.pod: pod/perlintern.pod
@@ -1200,8 +1200,8 @@
$spitshell >>$Makefile <<EOT
install_$name install-$name: \$(INSTALL_DEPENDENCE) installperl all installman
- \$(RUN_PERL) installperl --destdir=\$(DESTDIR) $flags \$(INSTALLFLAGS) \$(STRIPFLAGS)
- \$(RUN_PERL) installman --destdir=\$(DESTDIR) $flags
+ \$(MINIPERL) installperl --destdir=\$(DESTDIR) $flags \$(INSTALLFLAGS) \$(STRIPFLAGS)
+ \$(MINIPERL) installman --destdir=\$(DESTDIR) $flags
EOT
fi
@@ -1219,7 +1219,7 @@
LOCAL_PERL='$(RUN_PERL)'
$spitshell >>$Makefile <<'!NO!SUBS!'
install.perl: $(INSTALL_DEPENDENCE) installperl
- $(RUN_PERL) installperl --destdir=$(DESTDIR) $(INSTALLFLAGS) $(STRIPFLAGS)
+ $(MINIPERL) installperl --destdir=$(DESTDIR) $(INSTALLFLAGS) $(STRIPFLAGS)
-@test ! -s extras.lst || PATH="`pwd`:\${PATH}" PERL5LIB="`pwd`/lib" \$(RUN_PERL) -Ilib -MCPAN -e '@ARGV&&install(@ARGV)' `cat extras.lst`
!NO!SUBS!

View File

@ -78,8 +78,11 @@ class Perl(Package): # Perl doesn't use Autotools, it should subclass Package
patch('macos-11-version-check.patch', when='@5.24.1:5.32.0 platform=darwin') patch('macos-11-version-check.patch', when='@5.24.1:5.32.0 platform=darwin')
# Enable builds with the NVIDIA compiler # Enable builds with the NVIDIA compiler
# The Configure script assumes some gcc specific behavior, and use
# the mini Perl environment to bootstrap installation.
patch('nvhpc-5.30.patch', when='@5.30.0:5.30.99 %nvhpc') patch('nvhpc-5.30.patch', when='@5.30.0:5.30.99 %nvhpc')
conflicts('@5.32.0:', when='%nvhpc', patch('nvhpc-5.32.patch', when='@5.32.0:5.32.99 %nvhpc')
conflicts('@5.32.0:', when='%nvhpc@:20.11',
msg='The NVIDIA compilers are incompatible with version 5.32 and later') msg='The NVIDIA compilers are incompatible with version 5.32 and later')
# Installing cpanm alongside the core makes it safe and simple for # Installing cpanm alongside the core makes it safe and simple for

View File

@ -18,6 +18,6 @@ class Popt(AutotoolsPackage):
def patch(self): def patch(self):
# Remove flags not recognized by the NVIDIA compilers # Remove flags not recognized by the NVIDIA compilers
if self.spec.satisfies('%nvhpc'): if self.spec.satisfies('%nvhpc@:20.11'):
filter_file('CFLAGS="$CFLAGS -Wall -W"', filter_file('CFLAGS="$CFLAGS -Wall -W"',
'CFLAGS="$CFLAGS -Wall"', 'configure', string=True) 'CFLAGS="$CFLAGS -Wall"', 'configure', string=True)

View File

@ -41,7 +41,7 @@ def build_targets(self):
targets = [] targets = []
cflags = '' cflags = ''
if not self.spec.satisfies('%nvhpc'): if not self.spec.satisfies('%nvhpc@:20.11'):
cflags = '-std=gnu99' cflags = '-std=gnu99'
if '+mpi' in self.spec: if '+mpi' in self.spec:

View File

@ -32,7 +32,8 @@ def build_targets(self):
targets = [] targets = []
if '%nvhpc' in self.spec: if '%nvhpc' in self.spec:
targets.append('CFLAGS=-O1') if self.spec.satisfies('%nvhpc@:20.11'):
targets.append('CFLAGS=-O1')
if 'avx512' in self.spec.target: if 'avx512' in self.spec.target:
# Workaround AVX512 compiler issue # Workaround AVX512 compiler issue