From 2878862b6f13bb5770da42a7b7cbbe7a4f031849 Mon Sep 17 00:00:00 2001 From: crivella Date: Fri, 27 Jun 2025 13:53:10 +0200 Subject: [PATCH 1/6] WIP need to fix `#pragma weak` not working and unknown type names --- .../m/MPICH/MPICH-4.3.0-LLVMtc-20.1.5.eb | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 easybuild/easyconfigs/m/MPICH/MPICH-4.3.0-LLVMtc-20.1.5.eb diff --git a/easybuild/easyconfigs/m/MPICH/MPICH-4.3.0-LLVMtc-20.1.5.eb b/easybuild/easyconfigs/m/MPICH/MPICH-4.3.0-LLVMtc-20.1.5.eb new file mode 100644 index 000000000000..443a5b508272 --- /dev/null +++ b/easybuild/easyconfigs/m/MPICH/MPICH-4.3.0-LLVMtc-20.1.5.eb @@ -0,0 +1,29 @@ +name = 'MPICH' +version = '4.3.0' + +homepage = 'https://www.mpich.org/' +description = """MPICH is a high-performance and widely portable implementation +of the Message Passing Interface (MPI) standard (MPI-1, MPI-2 and MPI-3).""" + +toolchain = {'name': 'LLVMtc', 'version': '20.1.5'} +toolchainopts = { + 'extra_fflags': '-w -fallow-argument-mismatch -O2' +} + +source_urls = ['https://www.mpich.org/static/downloads/%(version)s'] +sources = [SOURCELOWER_TAR_GZ] +checksums = ['5e04132984ad83cab9cc53f76072d2b5ef5a6d24b0a9ff9047a8ff96121bcc63'] + +dependencies = [ + ('UCX', '1.15.0'), +] + +configopts = ' '.join([ + # 'FFLAGS="-w -fallow-argument-mismatch -O2"', + '--with-device=ch4:ucx --with-ucx=$EBROOTUCX', + '--enable-weak-symbols', +]) + +mpi_abi = True + +moduleclass = 'mpi' From 4409ca831ec56caded0bc096950e9609de78f041 Mon Sep 17 00:00:00 2001 From: crivella Date: Mon, 30 Jun 2025 10:46:46 +0200 Subject: [PATCH 2/6] Testing patch from MPICH#7491 --- .../m/MPICH/MPICH-4.3.0-LLVMtc-20.1.5.eb | 6 +- .../m/MPICH/MPICH-4.3.0-clang_weakattr.patch | 68 +++++++++++++++++++ 2 files changed, 72 insertions(+), 2 deletions(-) create mode 100644 easybuild/easyconfigs/m/MPICH/MPICH-4.3.0-clang_weakattr.patch diff --git a/easybuild/easyconfigs/m/MPICH/MPICH-4.3.0-LLVMtc-20.1.5.eb b/easybuild/easyconfigs/m/MPICH/MPICH-4.3.0-LLVMtc-20.1.5.eb index 443a5b508272..8b8d19313e49 100644 --- a/easybuild/easyconfigs/m/MPICH/MPICH-4.3.0-LLVMtc-20.1.5.eb +++ b/easybuild/easyconfigs/m/MPICH/MPICH-4.3.0-LLVMtc-20.1.5.eb @@ -12,6 +12,7 @@ toolchainopts = { source_urls = ['https://www.mpich.org/static/downloads/%(version)s'] sources = [SOURCELOWER_TAR_GZ] +patches = ['MPICH-4.3.0-clang_weakattr.patch'] checksums = ['5e04132984ad83cab9cc53f76072d2b5ef5a6d24b0a9ff9047a8ff96121bcc63'] dependencies = [ @@ -20,8 +21,9 @@ dependencies = [ configopts = ' '.join([ # 'FFLAGS="-w -fallow-argument-mismatch -O2"', - '--with-device=ch4:ucx --with-ucx=$EBROOTUCX', - '--enable-weak-symbols', + '--with-device=ch4:ucx', + # '--with-ucx=$EBROOTUCX', + # '--enable-weak-symbols', ]) mpi_abi = True diff --git a/easybuild/easyconfigs/m/MPICH/MPICH-4.3.0-clang_weakattr.patch b/easybuild/easyconfigs/m/MPICH/MPICH-4.3.0-clang_weakattr.patch new file mode 100644 index 000000000000..c5b37ce4d301 --- /dev/null +++ b/easybuild/easyconfigs/m/MPICH/MPICH-4.3.0-clang_weakattr.patch @@ -0,0 +1,68 @@ +Taken from https://github.com/pmodels/mpich/pull/7491 +See related issue for details https://github.com/pmodels/mpich/issues/7486 +From e5fd7c3e0c5b7a59bee28e942ee5222cbac995e9 Mon Sep 17 00:00:00 2001 +From: Hui Zhou +Date: Fri, 27 Jun 2025 16:46:38 -0500 +Subject: [PATCH] binding/abi: fix declaration for HAVE_WEAK_ATTRIBUTE + +Only handle types need use ABI types (e.g. ABI_Comm) in declarations. +For example, MPI_Comm_copy_attr_function should not be replaced as +ABI_Comm_copy_attr_function. Clang uses weak attributes. +--- + maint/local_python/binding_c.py | 18 ++++++++++-------- + 1 file changed, 10 insertions(+), 8 deletions(-) + +diff --git a/maint/local_python/binding_c.py b/maint/local_python/binding_c.py +index 93c7490ba2d..5d5ab433870 100644 +--- a/maint/local_python/binding_c.py ++++ b/maint/local_python/binding_c.py +@@ -1783,9 +1783,9 @@ def push_impl_decl(func, impl_name=None): + if func['_impl_param_list']: + params = ', '.join(func['_impl_param_list']) + if func['dir'] == 'coll': +- # block collective use an extra errflag ++ # block collective use an extra coll_attr + if not RE.match(r'MPI_(I.*|Neighbor.*|.*_init)$', func['name']): +- params = params + ", MPIR_Errflag_t errflag" ++ params = params + ", int coll_attr" + else: + params="void" + +@@ -1841,7 +1841,7 @@ def dump_body_coll(func): + dump_error_check("") + else: + # blocking collectives +- dump_line_with_break("mpi_errno = %s(%s, MPIR_ERR_NONE);" % (mpir_name, args)) ++ dump_line_with_break("mpi_errno = %s(%s, 0);" % (mpir_name, args)) + dump_error_check("") + + def dump_coll_v_swap(func): +@@ -2980,10 +2980,8 @@ def get_declare_function(func, is_large, kind=""): + if func['return'] == 'EXTRA_STATE': + ret = 'void *' + +- params = get_C_params(func, mapping) ++ params = get_C_params(func, mapping, kind == 'abi') + s_param = ', '.join(params) +- if kind == 'abi': +- s_param = re.sub(r'\bMPI_', 'ABI_', s_param) + s = "%s %s(%s)" % (ret, name, s_param) + + if kind == 'proto': +@@ -2993,10 +2991,14 @@ def get_declare_function(func, is_large, kind=""): + s += " MPICH_API_PUBLIC" + return s + +-def get_C_params(func, mapping): ++def get_C_params(func, mapping, is_abi=False): + param_list = [] ++ re_Handle = r'MPI_(Comm|Datatype|Errhandler|Group|Info|Message|Op|Request|Session|Win|File)\b' + for p in func['c_parameters']: +- param_list.append(get_C_param(p, func, mapping)) ++ param = get_C_param(p, func, mapping) ++ if is_abi: ++ param = re.sub(re_Handle, r'ABI_\1', param) ++ param_list.append(param) + if not len(param_list): + return ["void"] + else: From 963ea195c26f2f915269c54068993e823cea9751 Mon Sep 17 00:00:00 2001 From: crivella Date: Mon, 30 Jun 2025 12:04:33 +0200 Subject: [PATCH 3/6] Moved `4.3.0` -> `4.3.1` --- ...H-4.3.0-LLVMtc-20.1.5.eb => MPICH-4.3.1-LLVMtc-20.1.5.eb} | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) rename easybuild/easyconfigs/m/MPICH/{MPICH-4.3.0-LLVMtc-20.1.5.eb => MPICH-4.3.1-LLVMtc-20.1.5.eb} (84%) diff --git a/easybuild/easyconfigs/m/MPICH/MPICH-4.3.0-LLVMtc-20.1.5.eb b/easybuild/easyconfigs/m/MPICH/MPICH-4.3.1-LLVMtc-20.1.5.eb similarity index 84% rename from easybuild/easyconfigs/m/MPICH/MPICH-4.3.0-LLVMtc-20.1.5.eb rename to easybuild/easyconfigs/m/MPICH/MPICH-4.3.1-LLVMtc-20.1.5.eb index 8b8d19313e49..62df1b03c5f0 100644 --- a/easybuild/easyconfigs/m/MPICH/MPICH-4.3.0-LLVMtc-20.1.5.eb +++ b/easybuild/easyconfigs/m/MPICH/MPICH-4.3.1-LLVMtc-20.1.5.eb @@ -1,5 +1,5 @@ name = 'MPICH' -version = '4.3.0' +version = '4.3.1' homepage = 'https://www.mpich.org/' description = """MPICH is a high-performance and widely portable implementation @@ -20,10 +20,7 @@ dependencies = [ ] configopts = ' '.join([ - # 'FFLAGS="-w -fallow-argument-mismatch -O2"', '--with-device=ch4:ucx', - # '--with-ucx=$EBROOTUCX', - # '--enable-weak-symbols', ]) mpi_abi = True From c7cac3148e4fb1c883fd28afd5ce97daaecba328 Mon Sep 17 00:00:00 2001 From: crivella Date: Mon, 30 Jun 2025 12:25:16 +0200 Subject: [PATCH 4/6] Checksums --- easybuild/easyconfigs/m/MPICH/MPICH-4.3.1-LLVMtc-20.1.5.eb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/easybuild/easyconfigs/m/MPICH/MPICH-4.3.1-LLVMtc-20.1.5.eb b/easybuild/easyconfigs/m/MPICH/MPICH-4.3.1-LLVMtc-20.1.5.eb index 62df1b03c5f0..b8df07408343 100644 --- a/easybuild/easyconfigs/m/MPICH/MPICH-4.3.1-LLVMtc-20.1.5.eb +++ b/easybuild/easyconfigs/m/MPICH/MPICH-4.3.1-LLVMtc-20.1.5.eb @@ -13,7 +13,10 @@ toolchainopts = { source_urls = ['https://www.mpich.org/static/downloads/%(version)s'] sources = [SOURCELOWER_TAR_GZ] patches = ['MPICH-4.3.0-clang_weakattr.patch'] -checksums = ['5e04132984ad83cab9cc53f76072d2b5ef5a6d24b0a9ff9047a8ff96121bcc63'] +checksums = [ + {'mpich-4.3.1.tar.gz': 'acc11cb2bdc69678dc8bba747c24a28233c58596f81f03785bf2b7bb7a0ef7dc'}, + {'MPICH-4.3.0-clang_weakattr.patch': '66017e2876d56e4040a79b9fca1f9d3fdb35dba528ce4aaea87d9ae14cba8f04'}, +] dependencies = [ ('UCX', '1.15.0'), From 68fd3218473b12f5dccf1685efcc4b2c14e79049 Mon Sep 17 00:00:00 2001 From: crivella Date: Mon, 30 Jun 2025 12:29:30 +0200 Subject: [PATCH 5/6] Remove unneeded configopt --- easybuild/easyconfigs/m/MPICH/MPICH-4.3.1-LLVMtc-20.1.5.eb | 4 ---- 1 file changed, 4 deletions(-) diff --git a/easybuild/easyconfigs/m/MPICH/MPICH-4.3.1-LLVMtc-20.1.5.eb b/easybuild/easyconfigs/m/MPICH/MPICH-4.3.1-LLVMtc-20.1.5.eb index b8df07408343..59545b61e65b 100644 --- a/easybuild/easyconfigs/m/MPICH/MPICH-4.3.1-LLVMtc-20.1.5.eb +++ b/easybuild/easyconfigs/m/MPICH/MPICH-4.3.1-LLVMtc-20.1.5.eb @@ -22,10 +22,6 @@ dependencies = [ ('UCX', '1.15.0'), ] -configopts = ' '.join([ - '--with-device=ch4:ucx', -]) - mpi_abi = True moduleclass = 'mpi' From 7ef0536506a9096dd6ab8c926336b002e2ce1272 Mon Sep 17 00:00:00 2001 From: crivella Date: Wed, 2 Jul 2025 11:17:14 +0200 Subject: [PATCH 6/6] Use the upstream fixes directly in new version --- ...H-4.3.1-LLVMtc-20.1.5.eb => MPICH-4.3.2-LLVMtc-20.1.5.eb} | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) rename easybuild/easyconfigs/m/MPICH/{MPICH-4.3.1-LLVMtc-20.1.5.eb => MPICH-4.3.2-LLVMtc-20.1.5.eb} (66%) diff --git a/easybuild/easyconfigs/m/MPICH/MPICH-4.3.1-LLVMtc-20.1.5.eb b/easybuild/easyconfigs/m/MPICH/MPICH-4.3.2-LLVMtc-20.1.5.eb similarity index 66% rename from easybuild/easyconfigs/m/MPICH/MPICH-4.3.1-LLVMtc-20.1.5.eb rename to easybuild/easyconfigs/m/MPICH/MPICH-4.3.2-LLVMtc-20.1.5.eb index 59545b61e65b..a513cf1fe594 100644 --- a/easybuild/easyconfigs/m/MPICH/MPICH-4.3.1-LLVMtc-20.1.5.eb +++ b/easybuild/easyconfigs/m/MPICH/MPICH-4.3.2-LLVMtc-20.1.5.eb @@ -1,5 +1,5 @@ name = 'MPICH' -version = '4.3.1' +version = '4.3.2' homepage = 'https://www.mpich.org/' description = """MPICH is a high-performance and widely portable implementation @@ -12,10 +12,7 @@ toolchainopts = { source_urls = ['https://www.mpich.org/static/downloads/%(version)s'] sources = [SOURCELOWER_TAR_GZ] -patches = ['MPICH-4.3.0-clang_weakattr.patch'] checksums = [ - {'mpich-4.3.1.tar.gz': 'acc11cb2bdc69678dc8bba747c24a28233c58596f81f03785bf2b7bb7a0ef7dc'}, - {'MPICH-4.3.0-clang_weakattr.patch': '66017e2876d56e4040a79b9fca1f9d3fdb35dba528ce4aaea87d9ae14cba8f04'}, ] dependencies = [