diff --git a/lib/spack/spack/build_systems/cuda.py b/lib/spack/spack/build_systems/cuda.py index 79d63fab10..e7ae26f3c9 100644 --- a/lib/spack/spack/build_systems/cuda.py +++ b/lib/spack/spack/build_systems/cuda.py @@ -86,6 +86,27 @@ def cuda_flags(arch_list): # apply to platform=darwin. We currently do not provide conflicts for # platform=darwin with %apple-clang. + # GCC + # According to + # https://github.com/spack/spack/pull/25054#issuecomment-886531664 + # these conflicts are valid independently from the architecture + + # minimum supported versions + conflicts('%gcc@:4', when='+cuda ^cuda@11.0:') + conflicts('%gcc@:5', when='+cuda ^cuda@11.4:') + + # maximum supported version + # NOTE: + # in order to not constrain future cuda version to old gcc versions, + # it has been decided to use an upper bound for the latest version. + # This implies that the last one in the list has to be updated at + # each release of a new cuda minor version. + conflicts('%gcc@10:', when='+cuda ^cuda@:11.0') + conflicts('%gcc@11:', when='+cuda ^cuda@:11.4') + + # https://gist.github.com/ax3l/9489132#gistcomment-3860114 + conflicts('%gcc@10', when='+cuda ^cuda@:11.4.0') + # Linux x86_64 compiler conflicts from here: # https://gist.github.com/ax3l/9489132 with when('~allow-unsupported-compilers'): @@ -94,9 +115,6 @@ def cuda_flags(arch_list): conflicts('%gcc@7:', when='+cuda ^cuda@:9.1 target=x86_64:') conflicts('%gcc@8:', when='+cuda ^cuda@:10.0.130 target=x86_64:') conflicts('%gcc@9:', when='+cuda ^cuda@:10.2.89 target=x86_64:') - conflicts('%gcc@:4', when='+cuda ^cuda@11.0.2: target=x86_64:') - conflicts('%gcc@10:', when='+cuda ^cuda@:11.0.3 target=x86_64:') - conflicts('%gcc@11:', when='+cuda ^cuda@:11.1.0 target=x86_64:') conflicts('%pgi@:14.8', when='+cuda ^cuda@:7.0.27 target=x86_64:') conflicts('%pgi@:15.3,15.5:', when='+cuda ^cuda@7.5 target=x86_64:') conflicts('%pgi@:16.2,16.0:16.3', when='+cuda ^cuda@8 target=x86_64:') @@ -130,9 +148,6 @@ def cuda_flags(arch_list): conflicts('%gcc@8:', when='+cuda ^cuda@:10.0.130 target=ppc64le:') conflicts('%gcc@9:', when='+cuda ^cuda@:10.1.243 target=ppc64le:') # officially, CUDA 11.0.2 only supports the system GCC 8.3 on ppc64le - conflicts('%gcc@:4', when='+cuda ^cuda@11.0.2: target=ppc64le:') - conflicts('%gcc@10:', when='+cuda ^cuda@:11.0.2 target=ppc64le:') - conflicts('%gcc@11:', when='+cuda ^cuda@:11.1.0 target=ppc64le:') conflicts('%pgi', when='+cuda ^cuda@:8 target=ppc64le:') conflicts('%pgi@:16', when='+cuda ^cuda@:9.1.185 target=ppc64le:') conflicts('%pgi@:17', when='+cuda ^cuda@:10 target=ppc64le:')