From b490d00aa6bd3defbdfbc63a2a8f28d9c6be392e Mon Sep 17 00:00:00 2001 From: Alexander Grund Date: Wed, 4 Jun 2025 13:12:07 +0200 Subject: [PATCH 1/8] Use LLVM easyblock for Clang 18 easyconfigs --- ...Clang-18.1.8-GCCcore-13.3.0-CUDA-12.6.0.eb | 31 +++++++++---------- .../c/Clang/Clang-18.1.8-GCCcore-13.3.0.eb | 30 +++++++++--------- 2 files changed, 28 insertions(+), 33 deletions(-) diff --git a/easybuild/easyconfigs/c/Clang/Clang-18.1.8-GCCcore-13.3.0-CUDA-12.6.0.eb b/easybuild/easyconfigs/c/Clang/Clang-18.1.8-GCCcore-13.3.0-CUDA-12.6.0.eb index 4ab1428d8b4..60799d84c02 100644 --- a/easybuild/easyconfigs/c/Clang/Clang-18.1.8-GCCcore-13.3.0-CUDA-12.6.0.eb +++ b/easybuild/easyconfigs/c/Clang/Clang-18.1.8-GCCcore-13.3.0-CUDA-12.6.0.eb @@ -1,16 +1,7 @@ -## -# This file is an EasyBuild reciPY as per https://github.com/easybuilders/easybuild -# -# Copyright:: Copyright 2013-2015 Dmitri Gribenko, Ward Poelmans -# Authors:: Dmitri Gribenko -# Authors:: Ward Poelmans -# License:: GPLv2 or later, MIT, three-clause BSD. -# $Id$ -## - name = 'Clang' version = '18.1.8' versionsuffix = '-CUDA-%(cudaver)s' +easyblock = 'EB_LLVM' homepage = 'https://clang.llvm.org/' description = """C, C++, Objective-C compiler, based on LLVM. Does not @@ -30,8 +21,10 @@ builddependencies = [ ('CMake', '3.29.3'), ('Perl', '5.38.2'), # Including Python bindings would require this as a runtime dep - # and SWIG as an additional build dep ('Python', '3.12.3'), + # For testing + ('psutil', '6.0.0'), + ('lit', '18.1.8'), ] dependencies = [ # since Clang is a compiler, binutils is a runtime dependency too @@ -42,17 +35,21 @@ dependencies = [ ('GMP', '6.3.0'), ('Z3', '4.13.0'), ('CUDA', '12.6.0', '', SYSTEM), - ] -# If True, Flang does not currently support building with LLVM exceptions enabled. +# enabling RTTI makes the flang compiler need to link to libc++ so instead of +# flang-new -flang-experimental-exec -fopenmp hello_openmp.f90 +# you would need +# flang-new -flang-experimental-exec -fopenmp hello_openmp.f90 -l c++ enable_rtti = False assertions = True +build_clang_extras = True +build_lld = True +build_lldb = True +build_runtimes = True +build_shared_libs = True python_bindings = False -skip_all_tests = True - -llvm_runtimes = ['libunwind', 'libcxx', 'libcxxabi'] -llvm_projects = ['polly', 'lld', 'lldb', 'clang-tools-extra', 'flang'] +use_polly = True moduleclass = 'compiler' diff --git a/easybuild/easyconfigs/c/Clang/Clang-18.1.8-GCCcore-13.3.0.eb b/easybuild/easyconfigs/c/Clang/Clang-18.1.8-GCCcore-13.3.0.eb index 8b096078c89..d63e8f8c495 100644 --- a/easybuild/easyconfigs/c/Clang/Clang-18.1.8-GCCcore-13.3.0.eb +++ b/easybuild/easyconfigs/c/Clang/Clang-18.1.8-GCCcore-13.3.0.eb @@ -1,15 +1,6 @@ -## -# This file is an EasyBuild reciPY as per https://github.com/easybuilders/easybuild -# -# Copyright:: Copyright 2013-2015 Dmitri Gribenko, Ward Poelmans -# Authors:: Dmitri Gribenko -# Authors:: Ward Poelmans -# License:: GPLv2 or later, MIT, three-clause BSD. -# $Id$ -## - name = 'Clang' version = '18.1.8' +easyblock = 'EB_LLVM' homepage = 'https://clang.llvm.org/' description = """C, C++, Objective-C compiler, based on LLVM. Does not @@ -29,8 +20,10 @@ builddependencies = [ ('CMake', '3.29.3'), ('Perl', '5.38.2'), # Including Python bindings would require this as a runtime dep - # and SWIG as an additional build dep ('Python', '3.12.3'), + # For testing + ('psutil', '6.0.0'), + ('lit', '18.1.8'), ] dependencies = [ # since Clang is a compiler, binutils is a runtime dependency too @@ -42,14 +35,19 @@ dependencies = [ ('Z3', '4.13.0'), ] -# If True, Flang does not currently support building with LLVM exceptions enabled. +# enabling RTTI makes the flang compiler need to link to libc++ so instead of +# flang-new -flang-experimental-exec -fopenmp hello_openmp.f90 +# you would need +# flang-new -flang-experimental-exec -fopenmp hello_openmp.f90 -l c++ enable_rtti = False assertions = True +build_clang_extras = True +build_lld = True +build_lldb = True +build_runtimes = True +build_shared_libs = True python_bindings = False -skip_all_tests = True - -llvm_runtimes = ['libunwind', 'libcxx', 'libcxxabi'] -llvm_projects = ['polly', 'lld', 'lldb', 'clang-tools-extra', 'flang'] +use_polly = True moduleclass = 'compiler' From 7a266f569ca4019779e2c2a23e91274a332f526e Mon Sep 17 00:00:00 2001 From: Alexander Grund Date: Wed, 2 Jul 2025 17:30:11 +0200 Subject: [PATCH 2/8] Move easyblock param to top and add CUDA CCs --- .../c/Clang/Clang-18.1.8-GCCcore-13.3.0-CUDA-12.6.0.eb | 5 ++++- easybuild/easyconfigs/c/Clang/Clang-18.1.8-GCCcore-13.3.0.eb | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/easybuild/easyconfigs/c/Clang/Clang-18.1.8-GCCcore-13.3.0-CUDA-12.6.0.eb b/easybuild/easyconfigs/c/Clang/Clang-18.1.8-GCCcore-13.3.0-CUDA-12.6.0.eb index 60799d84c02..1255d44f08d 100644 --- a/easybuild/easyconfigs/c/Clang/Clang-18.1.8-GCCcore-13.3.0-CUDA-12.6.0.eb +++ b/easybuild/easyconfigs/c/Clang/Clang-18.1.8-GCCcore-13.3.0-CUDA-12.6.0.eb @@ -1,7 +1,8 @@ +easyblock = 'EB_LLVM' + name = 'Clang' version = '18.1.8' versionsuffix = '-CUDA-%(cudaver)s' -easyblock = 'EB_LLVM' homepage = 'https://clang.llvm.org/' description = """C, C++, Objective-C compiler, based on LLVM. Does not @@ -37,6 +38,8 @@ dependencies = [ ('CUDA', '12.6.0', '', SYSTEM), ] +cuda_compute_capabilities = ['5.0', '6.0', '7.0', '7.5', '8.0', '8.6', '9.0'] + # enabling RTTI makes the flang compiler need to link to libc++ so instead of # flang-new -flang-experimental-exec -fopenmp hello_openmp.f90 # you would need diff --git a/easybuild/easyconfigs/c/Clang/Clang-18.1.8-GCCcore-13.3.0.eb b/easybuild/easyconfigs/c/Clang/Clang-18.1.8-GCCcore-13.3.0.eb index d63e8f8c495..73ce23bcf7c 100644 --- a/easybuild/easyconfigs/c/Clang/Clang-18.1.8-GCCcore-13.3.0.eb +++ b/easybuild/easyconfigs/c/Clang/Clang-18.1.8-GCCcore-13.3.0.eb @@ -1,6 +1,7 @@ +easyblock = 'EB_LLVM' + name = 'Clang' version = '18.1.8' -easyblock = 'EB_LLVM' homepage = 'https://clang.llvm.org/' description = """C, C++, Objective-C compiler, based on LLVM. Does not From d5a7eeae61409e2261e2a6a23da5195145e95b77 Mon Sep 17 00:00:00 2001 From: Alexander Grund Date: Fri, 4 Jul 2025 10:33:01 +0200 Subject: [PATCH 3/8] Include OpenMP library aliases --- .../c/Clang/Clang-18.1.8-GCCcore-13.3.0-CUDA-12.6.0.eb | 1 + easybuild/easyconfigs/c/Clang/Clang-18.1.8-GCCcore-13.3.0.eb | 1 + 2 files changed, 2 insertions(+) diff --git a/easybuild/easyconfigs/c/Clang/Clang-18.1.8-GCCcore-13.3.0-CUDA-12.6.0.eb b/easybuild/easyconfigs/c/Clang/Clang-18.1.8-GCCcore-13.3.0-CUDA-12.6.0.eb index 1255d44f08d..42702142a69 100644 --- a/easybuild/easyconfigs/c/Clang/Clang-18.1.8-GCCcore-13.3.0-CUDA-12.6.0.eb +++ b/easybuild/easyconfigs/c/Clang/Clang-18.1.8-GCCcore-13.3.0-CUDA-12.6.0.eb @@ -48,6 +48,7 @@ enable_rtti = False assertions = True build_clang_extras = True +build_openmp_library_aliases = True build_lld = True build_lldb = True build_runtimes = True diff --git a/easybuild/easyconfigs/c/Clang/Clang-18.1.8-GCCcore-13.3.0.eb b/easybuild/easyconfigs/c/Clang/Clang-18.1.8-GCCcore-13.3.0.eb index 73ce23bcf7c..a72c2b77d22 100644 --- a/easybuild/easyconfigs/c/Clang/Clang-18.1.8-GCCcore-13.3.0.eb +++ b/easybuild/easyconfigs/c/Clang/Clang-18.1.8-GCCcore-13.3.0.eb @@ -44,6 +44,7 @@ enable_rtti = False assertions = True build_clang_extras = True +build_openmp_library_aliases = True build_lld = True build_lldb = True build_runtimes = True From 74161af52b767de9fbdff513830b6d31d9a0ae67 Mon Sep 17 00:00:00 2001 From: Alexander Grund Date: Fri, 4 Jul 2025 17:30:29 +0200 Subject: [PATCH 4/8] Skip failing tests --- .../c/Clang/Clang-18.1.8-GCCcore-13.3.0-CUDA-12.6.0.eb | 8 ++++++++ .../easyconfigs/c/Clang/Clang-18.1.8-GCCcore-13.3.0.eb | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/easybuild/easyconfigs/c/Clang/Clang-18.1.8-GCCcore-13.3.0-CUDA-12.6.0.eb b/easybuild/easyconfigs/c/Clang/Clang-18.1.8-GCCcore-13.3.0-CUDA-12.6.0.eb index 42702142a69..0fa4f218f57 100644 --- a/easybuild/easyconfigs/c/Clang/Clang-18.1.8-GCCcore-13.3.0-CUDA-12.6.0.eb +++ b/easybuild/easyconfigs/c/Clang/Clang-18.1.8-GCCcore-13.3.0-CUDA-12.6.0.eb @@ -56,4 +56,12 @@ build_shared_libs = True python_bindings = False use_polly = True +test_suite_max_failed = 10 +test_suite_ignore_patterns = [ + # https://reviews.llvm.org/D129116 + "mlir-pdll-lsp-server/", + # GMT vs UCT mismatch + "std/time/time.syn/", +] + moduleclass = 'compiler' diff --git a/easybuild/easyconfigs/c/Clang/Clang-18.1.8-GCCcore-13.3.0.eb b/easybuild/easyconfigs/c/Clang/Clang-18.1.8-GCCcore-13.3.0.eb index a72c2b77d22..964402ab4d1 100644 --- a/easybuild/easyconfigs/c/Clang/Clang-18.1.8-GCCcore-13.3.0.eb +++ b/easybuild/easyconfigs/c/Clang/Clang-18.1.8-GCCcore-13.3.0.eb @@ -52,4 +52,12 @@ build_shared_libs = True python_bindings = False use_polly = True +test_suite_max_failed = 10 +test_suite_ignore_patterns = [ + # https://reviews.llvm.org/D129116 + "mlir-pdll-lsp-server/", + # GMT vs UCT mismatch + "std/time/time.syn/", +] + moduleclass = 'compiler' From 926123a936eb27a3b50d967d4f737aa61178d628 Mon Sep 17 00:00:00 2001 From: Alexander Grund Date: Thu, 10 Jul 2025 10:22:22 +0200 Subject: [PATCH 5/8] Add patches from LLVM 18.1.8 to Clang ECs --- .../Clang/Clang-18.1.8-GCCcore-13.3.0-CUDA-12.6.0.eb | 12 +++++++++++- .../c/Clang/Clang-18.1.8-GCCcore-13.3.0.eb | 12 +++++++++++- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/easybuild/easyconfigs/c/Clang/Clang-18.1.8-GCCcore-13.3.0-CUDA-12.6.0.eb b/easybuild/easyconfigs/c/Clang/Clang-18.1.8-GCCcore-13.3.0-CUDA-12.6.0.eb index 0fa4f218f57..3c0ad61afa7 100644 --- a/easybuild/easyconfigs/c/Clang/Clang-18.1.8-GCCcore-13.3.0-CUDA-12.6.0.eb +++ b/easybuild/easyconfigs/c/Clang/Clang-18.1.8-GCCcore-13.3.0-CUDA-12.6.0.eb @@ -16,7 +16,17 @@ source_urls = ["https://github.com/llvm/llvm-project/releases/download/llvmorg-% sources = [ 'llvm-project-%(version)s.src.tar.xz', ] -checksums = ['0b58557a6d32ceee97c8d533a59b9212d87e0fc4d2833924eb6c611247db2f2a'] +patches = [ + 'LLVM-18.1.8_envintest.patch', + 'LLVM-18.1.8_libomptarget_tests.patch', + 'LLVM-19.1.7_clang_rpathwrap_test.patch', +] +checksums = [ + {'llvm-project-18.1.8.src.tar.xz': '0b58557a6d32ceee97c8d533a59b9212d87e0fc4d2833924eb6c611247db2f2a'}, + {'LLVM-18.1.8_envintest.patch': '8e25dfab8a29a860717b4bd2d8cdd0e795433766d7fffbda32d06a2bde47058d'}, + {'LLVM-18.1.8_libomptarget_tests.patch': '858669446358d24936e2c85fa2bdc0b9e77427dc4a6f2aaa9c6d8e28638041c8'}, + {'LLVM-19.1.7_clang_rpathwrap_test.patch': '5ee6a87ec8ff1c8b736ffe0513aa2098bd2b83a1ffc647a1ad2cf966f567e8a1'}, +] builddependencies = [ ('CMake', '3.29.3'), diff --git a/easybuild/easyconfigs/c/Clang/Clang-18.1.8-GCCcore-13.3.0.eb b/easybuild/easyconfigs/c/Clang/Clang-18.1.8-GCCcore-13.3.0.eb index 964402ab4d1..721fd694714 100644 --- a/easybuild/easyconfigs/c/Clang/Clang-18.1.8-GCCcore-13.3.0.eb +++ b/easybuild/easyconfigs/c/Clang/Clang-18.1.8-GCCcore-13.3.0.eb @@ -15,7 +15,17 @@ source_urls = ["https://github.com/llvm/llvm-project/releases/download/llvmorg-% sources = [ 'llvm-project-%(version)s.src.tar.xz', ] -checksums = ['0b58557a6d32ceee97c8d533a59b9212d87e0fc4d2833924eb6c611247db2f2a'] +patches = [ + 'LLVM-18.1.8_envintest.patch', + 'LLVM-18.1.8_libomptarget_tests.patch', + 'LLVM-19.1.7_clang_rpathwrap_test.patch', +] +checksums = [ + {'llvm-project-18.1.8.src.tar.xz': '0b58557a6d32ceee97c8d533a59b9212d87e0fc4d2833924eb6c611247db2f2a'}, + {'LLVM-18.1.8_envintest.patch': '8e25dfab8a29a860717b4bd2d8cdd0e795433766d7fffbda32d06a2bde47058d'}, + {'LLVM-18.1.8_libomptarget_tests.patch': '858669446358d24936e2c85fa2bdc0b9e77427dc4a6f2aaa9c6d8e28638041c8'}, + {'LLVM-19.1.7_clang_rpathwrap_test.patch': '5ee6a87ec8ff1c8b736ffe0513aa2098bd2b83a1ffc647a1ad2cf966f567e8a1'}, +] builddependencies = [ ('CMake', '3.29.3'), From 3f2a87aebae5e1e6dd4e7b626be1f6779540e4b5 Mon Sep 17 00:00:00 2001 From: Alexander Grund Date: Thu, 10 Jul 2025 13:07:11 +0200 Subject: [PATCH 6/8] Add alt-location to find LLVM patches in Clang --- .../c/Clang/Clang-18.1.8-GCCcore-13.3.0-CUDA-12.6.0.eb | 6 +++--- .../easyconfigs/c/Clang/Clang-18.1.8-GCCcore-13.3.0.eb | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/easybuild/easyconfigs/c/Clang/Clang-18.1.8-GCCcore-13.3.0-CUDA-12.6.0.eb b/easybuild/easyconfigs/c/Clang/Clang-18.1.8-GCCcore-13.3.0-CUDA-12.6.0.eb index 3c0ad61afa7..b818ad8c2b7 100644 --- a/easybuild/easyconfigs/c/Clang/Clang-18.1.8-GCCcore-13.3.0-CUDA-12.6.0.eb +++ b/easybuild/easyconfigs/c/Clang/Clang-18.1.8-GCCcore-13.3.0-CUDA-12.6.0.eb @@ -17,9 +17,9 @@ sources = [ 'llvm-project-%(version)s.src.tar.xz', ] patches = [ - 'LLVM-18.1.8_envintest.patch', - 'LLVM-18.1.8_libomptarget_tests.patch', - 'LLVM-19.1.7_clang_rpathwrap_test.patch', + {'name': 'LLVM-18.1.8_envintest.patch', 'alt_location': 'LLVM'}, + {'name': 'LLVM-18.1.8_libomptarget_tests.patch', 'alt_location': 'LLVM'}, + {'name': 'LLVM-19.1.7_clang_rpathwrap_test.patch', 'alt_location': 'LLVM'}, ] checksums = [ {'llvm-project-18.1.8.src.tar.xz': '0b58557a6d32ceee97c8d533a59b9212d87e0fc4d2833924eb6c611247db2f2a'}, diff --git a/easybuild/easyconfigs/c/Clang/Clang-18.1.8-GCCcore-13.3.0.eb b/easybuild/easyconfigs/c/Clang/Clang-18.1.8-GCCcore-13.3.0.eb index 721fd694714..00f4eb44416 100644 --- a/easybuild/easyconfigs/c/Clang/Clang-18.1.8-GCCcore-13.3.0.eb +++ b/easybuild/easyconfigs/c/Clang/Clang-18.1.8-GCCcore-13.3.0.eb @@ -16,9 +16,9 @@ sources = [ 'llvm-project-%(version)s.src.tar.xz', ] patches = [ - 'LLVM-18.1.8_envintest.patch', - 'LLVM-18.1.8_libomptarget_tests.patch', - 'LLVM-19.1.7_clang_rpathwrap_test.patch', + {'name': 'LLVM-18.1.8_envintest.patch', 'alt_location': 'LLVM'}, + {'name': 'LLVM-18.1.8_libomptarget_tests.patch', 'alt_location': 'LLVM'}, + {'name': 'LLVM-19.1.7_clang_rpathwrap_test.patch', 'alt_location': 'LLVM'}, ] checksums = [ {'llvm-project-18.1.8.src.tar.xz': '0b58557a6d32ceee97c8d533a59b9212d87e0fc4d2833924eb6c611247db2f2a'}, From 92f1fc986b5ef2832389839234a7b922d47afaf1 Mon Sep 17 00:00:00 2001 From: Alexander Grund Date: Tue, 29 Jul 2025 12:20:44 +0200 Subject: [PATCH 7/8] Skip sanitizer tests --- .../c/Clang/Clang-18.1.8-GCCcore-13.3.0-CUDA-12.6.0.eb | 1 + easybuild/easyconfigs/c/Clang/Clang-18.1.8-GCCcore-13.3.0.eb | 1 + 2 files changed, 2 insertions(+) diff --git a/easybuild/easyconfigs/c/Clang/Clang-18.1.8-GCCcore-13.3.0-CUDA-12.6.0.eb b/easybuild/easyconfigs/c/Clang/Clang-18.1.8-GCCcore-13.3.0-CUDA-12.6.0.eb index b818ad8c2b7..327d40c9268 100644 --- a/easybuild/easyconfigs/c/Clang/Clang-18.1.8-GCCcore-13.3.0-CUDA-12.6.0.eb +++ b/easybuild/easyconfigs/c/Clang/Clang-18.1.8-GCCcore-13.3.0-CUDA-12.6.0.eb @@ -66,6 +66,7 @@ build_shared_libs = True python_bindings = False use_polly = True +skip_sanitizer_tests = True test_suite_max_failed = 10 test_suite_ignore_patterns = [ # https://reviews.llvm.org/D129116 diff --git a/easybuild/easyconfigs/c/Clang/Clang-18.1.8-GCCcore-13.3.0.eb b/easybuild/easyconfigs/c/Clang/Clang-18.1.8-GCCcore-13.3.0.eb index 00f4eb44416..f94c8a43341 100644 --- a/easybuild/easyconfigs/c/Clang/Clang-18.1.8-GCCcore-13.3.0.eb +++ b/easybuild/easyconfigs/c/Clang/Clang-18.1.8-GCCcore-13.3.0.eb @@ -62,6 +62,7 @@ build_shared_libs = True python_bindings = False use_polly = True +skip_sanitizer_tests = True test_suite_max_failed = 10 test_suite_ignore_patterns = [ # https://reviews.llvm.org/D129116 From a8831fee94e43790f4e07b06c3a4651fef671b7e Mon Sep 17 00:00:00 2001 From: Alexander Grund Date: Wed, 30 Jul 2025 18:01:02 +0200 Subject: [PATCH 8/8] Ignore another test --- .../c/Clang/Clang-18.1.8-GCCcore-13.3.0-CUDA-12.6.0.eb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/easybuild/easyconfigs/c/Clang/Clang-18.1.8-GCCcore-13.3.0-CUDA-12.6.0.eb b/easybuild/easyconfigs/c/Clang/Clang-18.1.8-GCCcore-13.3.0-CUDA-12.6.0.eb index 327d40c9268..45ffe9f5a3a 100644 --- a/easybuild/easyconfigs/c/Clang/Clang-18.1.8-GCCcore-13.3.0-CUDA-12.6.0.eb +++ b/easybuild/easyconfigs/c/Clang/Clang-18.1.8-GCCcore-13.3.0-CUDA-12.6.0.eb @@ -73,6 +73,8 @@ test_suite_ignore_patterns = [ "mlir-pdll-lsp-server/", # GMT vs UCT mismatch "std/time/time.syn/", + # Fails due to missing CUDA context, likely an upstream issue + "api/omp_host_pinned_memory", ] moduleclass = 'compiler'