From 0df0a872fd2439290c64b0c97af89e715b1309ed Mon Sep 17 00:00:00 2001 From: Alexander Grund Date: Fri, 22 Sep 2023 15:29:26 +0200 Subject: [PATCH 1/3] improve CUDA 11 compatibility of GCC 12.2 --- .../easyconfigs/g/GCCcore/GCCcore-12.2.0.eb | 3 +++ ...ore-12.2.0_improve-cuda-compatibility.patch | 18 ++++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 easybuild/easyconfigs/g/GCCcore/GCCcore-12.2.0_improve-cuda-compatibility.patch diff --git a/easybuild/easyconfigs/g/GCCcore/GCCcore-12.2.0.eb b/easybuild/easyconfigs/g/GCCcore/GCCcore-12.2.0.eb index 9a758565b1f..d799279899f 100644 --- a/easybuild/easyconfigs/g/GCCcore/GCCcore-12.2.0.eb +++ b/easybuild/easyconfigs/g/GCCcore/GCCcore-12.2.0.eb @@ -36,6 +36,7 @@ patches = [ 'GCCcore-12.1.0_allow-pragma-wself-init.patch', 'GCCcore-12.1.0_fix-Wuninitialized-in-AVX-headers.patch', 'GCCcore-12.2.0_fix-vectorizer.patch', + 'GCCcore-12.2.0_improve-cuda-compatibility.patch', ] checksums = [ {'gcc-12.2.0.tar.gz': 'ac6b317eb4d25444d87cf29c0d141dedc1323a1833ec9995211b13e1a851261c'}, @@ -52,6 +53,8 @@ checksums = [ {'GCCcore-12.1.0_fix-Wuninitialized-in-AVX-headers.patch': '0ea675960795e238a43ae7d685a0082b21f0b63cf2fe499f6d55e89e0aaee392'}, {'GCCcore-12.2.0_fix-vectorizer.patch': '0b76fc379308fd189ee39c4a3a49facacf8ede08dbec4280f289341083f1632b'}, + {'GCCcore-12.2.0_improve-cuda-compatibility.patch': + '44d028df2a166a801a0e599f9ac2044673501602f2461ad3ff882d5f29add363'}, ] builddependencies = [ diff --git a/easybuild/easyconfigs/g/GCCcore/GCCcore-12.2.0_improve-cuda-compatibility.patch b/easybuild/easyconfigs/g/GCCcore/GCCcore-12.2.0_improve-cuda-compatibility.patch new file mode 100644 index 00000000000..f557fac646b --- /dev/null +++ b/easybuild/easyconfigs/g/GCCcore/GCCcore-12.2.0_improve-cuda-compatibility.patch @@ -0,0 +1,18 @@ +The GCC stdlib uses a GCC feature not supported by nvcc until CUDA 12. +I.e. CUDA 12 does not support GCC 12 (only GCC <= 11) erroring at +> if ((void*)(this->*(&time_get::do_get)) == (void*)(&time_get::do_get)) + +As the same isn't supported by clang use the same fix. +See https://gcc.gnu.org/bugzilla//show_bug.cgi?id=104990 + +--- gcc-12.2.0-orig/libstdc++-v3/include/bits/locale_facets_nonio.tcc ++++ gcc-12.2.0/libstdc++-v3/include/bits/locale_facets_nonio.tcc +@@ -1465,7 +1465,7 @@ + ctype<_CharT> const& __ctype = use_facet >(__loc); + __err = ios_base::goodbit; + bool __use_state = false; +-#if __GNUC__ >= 5 && !defined(__clang__) ++#if __GNUC__ >= 5 && !defined(__clang__) && (!defined(__CUDACC__) || (__CUDACC_VER_MAJOR__ >= 12)) + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wpmf-conversions" + // Nasty hack. The C++ standard mandates that get invokes the do_get From bbf15a020b7a77152c847b2d56d0ab4fed34ae55 Mon Sep 17 00:00:00 2001 From: Alexander Grund Date: Fri, 22 Sep 2023 15:36:13 +0200 Subject: [PATCH 2/3] add patch author --- easybuild/easyconfigs/g/GCCcore/GCCcore-12.2.0.eb | 2 +- .../g/GCCcore/GCCcore-12.2.0_improve-cuda-compatibility.patch | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/easybuild/easyconfigs/g/GCCcore/GCCcore-12.2.0.eb b/easybuild/easyconfigs/g/GCCcore/GCCcore-12.2.0.eb index d799279899f..aa2a7e328a2 100644 --- a/easybuild/easyconfigs/g/GCCcore/GCCcore-12.2.0.eb +++ b/easybuild/easyconfigs/g/GCCcore/GCCcore-12.2.0.eb @@ -54,7 +54,7 @@ checksums = [ '0ea675960795e238a43ae7d685a0082b21f0b63cf2fe499f6d55e89e0aaee392'}, {'GCCcore-12.2.0_fix-vectorizer.patch': '0b76fc379308fd189ee39c4a3a49facacf8ede08dbec4280f289341083f1632b'}, {'GCCcore-12.2.0_improve-cuda-compatibility.patch': - '44d028df2a166a801a0e599f9ac2044673501602f2461ad3ff882d5f29add363'}, + '91d00122554b56381592229398540e63baa26d03633292a7fdf338407a4a62d5'}, ] builddependencies = [ diff --git a/easybuild/easyconfigs/g/GCCcore/GCCcore-12.2.0_improve-cuda-compatibility.patch b/easybuild/easyconfigs/g/GCCcore/GCCcore-12.2.0_improve-cuda-compatibility.patch index f557fac646b..c1538d09041 100644 --- a/easybuild/easyconfigs/g/GCCcore/GCCcore-12.2.0_improve-cuda-compatibility.patch +++ b/easybuild/easyconfigs/g/GCCcore/GCCcore-12.2.0_improve-cuda-compatibility.patch @@ -5,6 +5,8 @@ I.e. CUDA 12 does not support GCC 12 (only GCC <= 11) erroring at As the same isn't supported by clang use the same fix. See https://gcc.gnu.org/bugzilla//show_bug.cgi?id=104990 +Author: Alexander Grund (TU Dresden) + --- gcc-12.2.0-orig/libstdc++-v3/include/bits/locale_facets_nonio.tcc +++ gcc-12.2.0/libstdc++-v3/include/bits/locale_facets_nonio.tcc @@ -1465,7 +1465,7 @@ From 67a2e1364b30719ce30c75e1617b2ccc9a67b466 Mon Sep 17 00:00:00 2001 From: Kenneth Hoste Date: Wed, 11 Oct 2023 09:42:39 +0200 Subject: [PATCH 3/3] also use patch to improve CUDA 11 compatibility in GCCcore/12.3.0 --- easybuild/easyconfigs/g/GCCcore/GCCcore-12.3.0.eb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/easybuild/easyconfigs/g/GCCcore/GCCcore-12.3.0.eb b/easybuild/easyconfigs/g/GCCcore/GCCcore-12.3.0.eb index 45270c7b7f8..c9fe0e62a87 100644 --- a/easybuild/easyconfigs/g/GCCcore/GCCcore-12.3.0.eb +++ b/easybuild/easyconfigs/g/GCCcore/GCCcore-12.3.0.eb @@ -33,6 +33,7 @@ sources = [ patches = [ 'GCCcore-6.2.0-fix-find-isl.patch', 'GCCcore-9.3.0_gmp-c99.patch', + 'GCCcore-12.2.0_improve-cuda-compatibility.patch', ] checksums = [ {'gcc-12.3.0.tar.gz': '11275aa7bb34cd8ab101d01b341015499f8d9466342a2574ece93f954d92273b'}, @@ -44,6 +45,8 @@ checksums = [ {'nvptx-tools-20230122.tar.gz': 'af05fac26e9a83d337758a5495dc35f7a7bbfd90cd09f4a5d3242d059f235e08'}, {'GCCcore-6.2.0-fix-find-isl.patch': '5ad909606d17d851c6ad629b4fddb6c1621844218b8d139fed18c502a7696c68'}, {'GCCcore-9.3.0_gmp-c99.patch': '0e135e1cc7cec701beea9d7d17a61bab34cfd496b4b555930016b98db99f922e'}, + {'GCCcore-12.2.0_improve-cuda-compatibility.patch': + '91d00122554b56381592229398540e63baa26d03633292a7fdf338407a4a62d5'}, ] builddependencies = [