From c24db67d24a2ccaa0a31d146c5e4ac1ae5e8fd2d Mon Sep 17 00:00:00 2001 From: Matthieu Leclair Date: Mon, 9 Mar 2026 17:04:31 +0100 Subject: [PATCH 01/32] tmp:add: wait_for_compilation --- recipes/icon-dsl/25.12/gh200/environments.yaml | 2 +- recipes/icon-dsl/25.12/gh200/pre-install | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/recipes/icon-dsl/25.12/gh200/environments.yaml b/recipes/icon-dsl/25.12/gh200/environments.yaml index 98e0f07a..806a7849 100644 --- a/recipes/icon-dsl/25.12/gh200/environments.yaml +++ b/recipes/icon-dsl/25.12/gh200/environments.yaml @@ -14,7 +14,7 @@ icon: - ghex@async-mpi +python +cuda cuda_arch=90 - boost +thread - py-mpi4py - - icon4py@0.0.15 + - icon4py@blueline_wait_for_compilation - icon-exclaim @0.3.0 %nvhpc dsl=substitute +grib2 +eccodes-definitions +ecrad ~emvorado +art +dace gpu=nvidia-90 +mpi-gpu +realloc-buf ~aes ~jsbach ~ocean ~coupling ~rte-rrtmgp ~loop-exchange ~async-io-rma ~cuda-graphs fflags="-traceback" diff --git a/recipes/icon-dsl/25.12/gh200/pre-install b/recipes/icon-dsl/25.12/gh200/pre-install index 6a08c244..c4b7cd53 100644 --- a/recipes/icon-dsl/25.12/gh200/pre-install +++ b/recipes/icon-dsl/25.12/gh200/pre-install @@ -13,7 +13,7 @@ packages=( "icon4py" # "icon-exclaim" ) -SPACK_C2SM_TAG="v0.22.2.6" +SPACK_C2SM_TAG="tmp_wait_for_compilation" echo "----------------------------------------" echo "SPACK C2SM Setup Script" From 7b8376ed8ed130320643e063948d9906a81e3766 Mon Sep 17 00:00:00 2001 From: Matthieu Leclair Date: Mon, 9 Mar 2026 17:30:43 +0100 Subject: [PATCH 02/32] fix: wrong icon4py version --- .../icon-dsl/25.12/gh200/repo/packages/icon-exclaim/package.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/icon-dsl/25.12/gh200/repo/packages/icon-exclaim/package.py b/recipes/icon-dsl/25.12/gh200/repo/packages/icon-exclaim/package.py index 23cfd3ba..54dfe68a 100644 --- a/recipes/icon-dsl/25.12/gh200/repo/packages/icon-exclaim/package.py +++ b/recipes/icon-dsl/25.12/gh200/repo/packages/icon-exclaim/package.py @@ -377,7 +377,7 @@ class IconExclaim(Icon): description='Build with GT4Py dynamical core', multi=True) - depends_on("icon4py@0.0.15", when="@0.3.0") + depends_on("icon4py@blueline_wait_for_compilation", when="@0.3.0") for x in dsl_values: depends_on('icon4py', type="build", when=f"dsl={x}") From 752a54096c7084acb52b5ccda91260a145db1989 Mon Sep 17 00:00:00 2001 From: Mikael Simberg Date: Fri, 13 Mar 2026 15:57:13 +0100 Subject: [PATCH 03/32] Update recipes/icon-dsl/25.12/gh200/environments.yaml Co-authored-by: Hannes Vogt --- recipes/icon-dsl/25.12/gh200/environments.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/icon-dsl/25.12/gh200/environments.yaml b/recipes/icon-dsl/25.12/gh200/environments.yaml index 806a7849..8cbeb026 100644 --- a/recipes/icon-dsl/25.12/gh200/environments.yaml +++ b/recipes/icon-dsl/25.12/gh200/environments.yaml @@ -14,7 +14,7 @@ icon: - ghex@async-mpi +python +cuda cuda_arch=90 - boost +thread - py-mpi4py - - icon4py@blueline_wait_for_compilation + - icon4py@git=e7f2cdae5b435d2db048351dc46dcad126ce9d64=blueline_wait_for_compilation - icon-exclaim @0.3.0 %nvhpc dsl=substitute +grib2 +eccodes-definitions +ecrad ~emvorado +art +dace gpu=nvidia-90 +mpi-gpu +realloc-buf ~aes ~jsbach ~ocean ~coupling ~rte-rrtmgp ~loop-exchange ~async-io-rma ~cuda-graphs fflags="-traceback" From 6fb1419d12fdf4ba2127bba8ea1953b9332cb0b9 Mon Sep 17 00:00:00 2001 From: Mikael Simberg Date: Fri, 13 Mar 2026 15:58:27 +0100 Subject: [PATCH 04/32] Update recipes/icon-dsl/25.12/gh200/environments.yaml --- recipes/icon-dsl/25.12/gh200/environments.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/icon-dsl/25.12/gh200/environments.yaml b/recipes/icon-dsl/25.12/gh200/environments.yaml index 8cbeb026..1b147ddf 100644 --- a/recipes/icon-dsl/25.12/gh200/environments.yaml +++ b/recipes/icon-dsl/25.12/gh200/environments.yaml @@ -14,7 +14,7 @@ icon: - ghex@async-mpi +python +cuda cuda_arch=90 - boost +thread - py-mpi4py - - icon4py@git=e7f2cdae5b435d2db048351dc46dcad126ce9d64=blueline_wait_for_compilation + - icon4py@git.e7f2cdae5b435d2db048351dc46dcad126ce9d64=blueline_wait_for_compilation - icon-exclaim @0.3.0 %nvhpc dsl=substitute +grib2 +eccodes-definitions +ecrad ~emvorado +art +dace gpu=nvidia-90 +mpi-gpu +realloc-buf ~aes ~jsbach ~ocean ~coupling ~rte-rrtmgp ~loop-exchange ~async-io-rma ~cuda-graphs fflags="-traceback" From c1269fd6b9f30b0498826d3f858e9059d1787852 Mon Sep 17 00:00:00 2001 From: Mikael Simberg Date: Fri, 13 Mar 2026 20:25:16 +0100 Subject: [PATCH 05/32] Update recipes/icon-dsl/25.12/gh200/environments.yaml Co-authored-by: Hannes Vogt --- recipes/icon-dsl/25.12/gh200/environments.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/icon-dsl/25.12/gh200/environments.yaml b/recipes/icon-dsl/25.12/gh200/environments.yaml index 1b147ddf..38c179ae 100644 --- a/recipes/icon-dsl/25.12/gh200/environments.yaml +++ b/recipes/icon-dsl/25.12/gh200/environments.yaml @@ -14,7 +14,7 @@ icon: - ghex@async-mpi +python +cuda cuda_arch=90 - boost +thread - py-mpi4py - - icon4py@git.e7f2cdae5b435d2db048351dc46dcad126ce9d64=blueline_wait_for_compilation + - icon4py@git.3108df74ba35e8ca09f49c7bd22cab2093780b25=phimuell__async_mpi_test - icon-exclaim @0.3.0 %nvhpc dsl=substitute +grib2 +eccodes-definitions +ecrad ~emvorado +art +dace gpu=nvidia-90 +mpi-gpu +realloc-buf ~aes ~jsbach ~ocean ~coupling ~rte-rrtmgp ~loop-exchange ~async-io-rma ~cuda-graphs fflags="-traceback" From 5abd3f8d0772504394321e582b1a5e85e42989e4 Mon Sep 17 00:00:00 2001 From: Mikael Simberg Date: Fri, 13 Mar 2026 20:26:48 +0100 Subject: [PATCH 06/32] Update recipes/icon-dsl/25.12/gh200/repo/packages/icon-exclaim/package.py Co-authored-by: Hannes Vogt --- .../icon-dsl/25.12/gh200/repo/packages/icon-exclaim/package.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/icon-dsl/25.12/gh200/repo/packages/icon-exclaim/package.py b/recipes/icon-dsl/25.12/gh200/repo/packages/icon-exclaim/package.py index 54dfe68a..53885fdb 100644 --- a/recipes/icon-dsl/25.12/gh200/repo/packages/icon-exclaim/package.py +++ b/recipes/icon-dsl/25.12/gh200/repo/packages/icon-exclaim/package.py @@ -377,7 +377,7 @@ class IconExclaim(Icon): description='Build with GT4Py dynamical core', multi=True) - depends_on("icon4py@blueline_wait_for_compilation", when="@0.3.0") + depends_on("icon4py@phimuell__async_mpi_test", when="@0.3.0") for x in dsl_values: depends_on('icon4py', type="build", when=f"dsl={x}") From b93847a575722797b789d5be13afe66eb56ca209 Mon Sep 17 00:00:00 2001 From: Mikael Simberg Date: Fri, 13 Mar 2026 20:27:19 +0100 Subject: [PATCH 07/32] Update recipes/icon-dsl/25.12/gh200/repo/packages/icon-exclaim/package.py Co-authored-by: Hannes Vogt --- .../icon-dsl/25.12/gh200/repo/packages/icon-exclaim/package.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/icon-dsl/25.12/gh200/repo/packages/icon-exclaim/package.py b/recipes/icon-dsl/25.12/gh200/repo/packages/icon-exclaim/package.py index 53885fdb..5411864d 100644 --- a/recipes/icon-dsl/25.12/gh200/repo/packages/icon-exclaim/package.py +++ b/recipes/icon-dsl/25.12/gh200/repo/packages/icon-exclaim/package.py @@ -365,7 +365,7 @@ class IconExclaim(Icon): version('develop', branch='icon-dsl', submodules=True) version("0.3.0", - commit="5c5b742a969af2bd491e26cd0a05a35838f121c4", + commit="5f0c6eed726a37ad5e6ca311284b2a43c259c1dc", submodules=True) # EXCLAIM-GT4Py specific features: From ea53fc52c316ce4d2883e4e97ce164999df6a903 Mon Sep 17 00:00:00 2001 From: Mikael Simberg Date: Mon, 16 Mar 2026 11:06:08 +0100 Subject: [PATCH 08/32] Update recipes/icon-dsl/25.12/gh200/environments.yaml --- recipes/icon-dsl/25.12/gh200/environments.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/icon-dsl/25.12/gh200/environments.yaml b/recipes/icon-dsl/25.12/gh200/environments.yaml index 38c179ae..eb9ca5c9 100644 --- a/recipes/icon-dsl/25.12/gh200/environments.yaml +++ b/recipes/icon-dsl/25.12/gh200/environments.yaml @@ -11,7 +11,7 @@ icon: # icon4py deps - python@3.11 - py-cupy@13.3 +cuda cuda_arch=90 - - ghex@async-mpi +python +cuda cuda_arch=90 + - ghex@philip-async-mpi +python +cuda cuda_arch=90 - boost +thread - py-mpi4py - icon4py@git.3108df74ba35e8ca09f49c7bd22cab2093780b25=phimuell__async_mpi_test From 466f0162377dae4d416f42a697d2a5f3d0c6024f Mon Sep 17 00:00:00 2001 From: Mikael Simberg Date: Mon, 16 Mar 2026 11:06:39 +0100 Subject: [PATCH 09/32] Update recipes/icon-dsl/25.12/gh200/environments.yaml --- recipes/icon-dsl/25.12/gh200/environments.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/icon-dsl/25.12/gh200/environments.yaml b/recipes/icon-dsl/25.12/gh200/environments.yaml index eb9ca5c9..a5b0a3d2 100644 --- a/recipes/icon-dsl/25.12/gh200/environments.yaml +++ b/recipes/icon-dsl/25.12/gh200/environments.yaml @@ -11,7 +11,7 @@ icon: # icon4py deps - python@3.11 - py-cupy@13.3 +cuda cuda_arch=90 - - ghex@philip-async-mpi +python +cuda cuda_arch=90 + - ghex@git.9c09f3c52d2d76816074cdff869e2f90d005137c@philip-async-mpi +python +cuda cuda_arch=90 - boost +thread - py-mpi4py - icon4py@git.3108df74ba35e8ca09f49c7bd22cab2093780b25=phimuell__async_mpi_test From 6b7cd7d783b7a3af165f25776be67f255b9e0e6b Mon Sep 17 00:00:00 2001 From: Mikael Simberg Date: Mon, 16 Mar 2026 11:08:17 +0100 Subject: [PATCH 10/32] Update recipes/icon-dsl/25.12/gh200/environments.yaml --- recipes/icon-dsl/25.12/gh200/environments.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/icon-dsl/25.12/gh200/environments.yaml b/recipes/icon-dsl/25.12/gh200/environments.yaml index a5b0a3d2..c21ff132 100644 --- a/recipes/icon-dsl/25.12/gh200/environments.yaml +++ b/recipes/icon-dsl/25.12/gh200/environments.yaml @@ -15,7 +15,7 @@ icon: - boost +thread - py-mpi4py - icon4py@git.3108df74ba35e8ca09f49c7bd22cab2093780b25=phimuell__async_mpi_test - - icon-exclaim @0.3.0 %nvhpc dsl=substitute +grib2 +eccodes-definitions +ecrad + - icon-exclaim@git.5f0c6eed726a37ad5e6ca311284b2a43c259c1dc@0.3.0 %nvhpc dsl=substitute +grib2 +eccodes-definitions +ecrad ~emvorado +art +dace gpu=nvidia-90 +mpi-gpu +realloc-buf ~aes ~jsbach ~ocean ~coupling ~rte-rrtmgp ~loop-exchange ~async-io-rma ~cuda-graphs fflags="-traceback" # icon deps From 59bea8adb131d300abbf03ca775ca09e8ac952d4 Mon Sep 17 00:00:00 2001 From: Mikael Simberg Date: Mon, 16 Mar 2026 11:21:28 +0100 Subject: [PATCH 11/32] Update recipes/icon-dsl/25.12/gh200/environments.yaml --- recipes/icon-dsl/25.12/gh200/environments.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/icon-dsl/25.12/gh200/environments.yaml b/recipes/icon-dsl/25.12/gh200/environments.yaml index c21ff132..31f46f1a 100644 --- a/recipes/icon-dsl/25.12/gh200/environments.yaml +++ b/recipes/icon-dsl/25.12/gh200/environments.yaml @@ -11,7 +11,7 @@ icon: # icon4py deps - python@3.11 - py-cupy@13.3 +cuda cuda_arch=90 - - ghex@git.9c09f3c52d2d76816074cdff869e2f90d005137c@philip-async-mpi +python +cuda cuda_arch=90 + - ghex@git.9c09f3c52d2d76816074cdff869e2f90d005137c=philip-async-mpi +python +cuda cuda_arch=90 - boost +thread - py-mpi4py - icon4py@git.3108df74ba35e8ca09f49c7bd22cab2093780b25=phimuell__async_mpi_test From eae7b8751caec8986ea3a033398a35e2b57787e6 Mon Sep 17 00:00:00 2001 From: Mikael Simberg Date: Mon, 16 Mar 2026 11:21:44 +0100 Subject: [PATCH 12/32] Update recipes/icon-dsl/25.12/gh200/environments.yaml --- recipes/icon-dsl/25.12/gh200/environments.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/icon-dsl/25.12/gh200/environments.yaml b/recipes/icon-dsl/25.12/gh200/environments.yaml index 31f46f1a..8d2786ab 100644 --- a/recipes/icon-dsl/25.12/gh200/environments.yaml +++ b/recipes/icon-dsl/25.12/gh200/environments.yaml @@ -15,7 +15,7 @@ icon: - boost +thread - py-mpi4py - icon4py@git.3108df74ba35e8ca09f49c7bd22cab2093780b25=phimuell__async_mpi_test - - icon-exclaim@git.5f0c6eed726a37ad5e6ca311284b2a43c259c1dc@0.3.0 %nvhpc dsl=substitute +grib2 +eccodes-definitions +ecrad + - icon-exclaim@git.5f0c6eed726a37ad5e6ca311284b2a43c259c1dc=0.3.0 %nvhpc dsl=substitute +grib2 +eccodes-definitions +ecrad ~emvorado +art +dace gpu=nvidia-90 +mpi-gpu +realloc-buf ~aes ~jsbach ~ocean ~coupling ~rte-rrtmgp ~loop-exchange ~async-io-rma ~cuda-graphs fflags="-traceback" # icon deps From ae0d38bacba010e2758f89c1e09aa50e6ff9d27c Mon Sep 17 00:00:00 2001 From: Mikael Simberg Date: Mon, 16 Mar 2026 13:45:00 +0100 Subject: [PATCH 13/32] Update recipes/icon-dsl/25.12/gh200/environments.yaml Co-authored-by: Hannes Vogt --- recipes/icon-dsl/25.12/gh200/environments.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/icon-dsl/25.12/gh200/environments.yaml b/recipes/icon-dsl/25.12/gh200/environments.yaml index 8d2786ab..fb2c037a 100644 --- a/recipes/icon-dsl/25.12/gh200/environments.yaml +++ b/recipes/icon-dsl/25.12/gh200/environments.yaml @@ -14,7 +14,7 @@ icon: - ghex@git.9c09f3c52d2d76816074cdff869e2f90d005137c=philip-async-mpi +python +cuda cuda_arch=90 - boost +thread - py-mpi4py - - icon4py@git.3108df74ba35e8ca09f49c7bd22cab2093780b25=phimuell__async_mpi_test + - icon4py@git.bef46a7625773659ce81e249758ffe401005a92d=blueline_staging_2026-03-16 - icon-exclaim@git.5f0c6eed726a37ad5e6ca311284b2a43c259c1dc=0.3.0 %nvhpc dsl=substitute +grib2 +eccodes-definitions +ecrad ~emvorado +art +dace gpu=nvidia-90 +mpi-gpu +realloc-buf ~aes ~jsbach ~ocean ~coupling ~rte-rrtmgp ~loop-exchange ~async-io-rma ~cuda-graphs fflags="-traceback" From 5fd54def75aac71b4ed40a224affb55f5d4059de Mon Sep 17 00:00:00 2001 From: Mikael Simberg Date: Mon, 16 Mar 2026 13:46:14 +0100 Subject: [PATCH 14/32] Update recipes/icon-dsl/25.12/gh200/repo/packages/icon-exclaim/package.py Co-authored-by: Hannes Vogt --- .../icon-dsl/25.12/gh200/repo/packages/icon-exclaim/package.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/icon-dsl/25.12/gh200/repo/packages/icon-exclaim/package.py b/recipes/icon-dsl/25.12/gh200/repo/packages/icon-exclaim/package.py index 5411864d..41c78060 100644 --- a/recipes/icon-dsl/25.12/gh200/repo/packages/icon-exclaim/package.py +++ b/recipes/icon-dsl/25.12/gh200/repo/packages/icon-exclaim/package.py @@ -377,7 +377,7 @@ class IconExclaim(Icon): description='Build with GT4Py dynamical core', multi=True) - depends_on("icon4py@phimuell__async_mpi_test", when="@0.3.0") + depends_on("icon4py@blueline_staging_2026-03-16", when="@0.3.0") for x in dsl_values: depends_on('icon4py', type="build", when=f"dsl={x}") From 69fdb4845f7d65c953f25fdb2c94d7056b1aa043 Mon Sep 17 00:00:00 2001 From: Mikael Simberg Date: Tue, 17 Mar 2026 15:12:43 +0100 Subject: [PATCH 15/32] Try older commit of ghex --- recipes/icon-dsl/25.12/gh200/environments.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/icon-dsl/25.12/gh200/environments.yaml b/recipes/icon-dsl/25.12/gh200/environments.yaml index fb2c037a..83ea5dab 100644 --- a/recipes/icon-dsl/25.12/gh200/environments.yaml +++ b/recipes/icon-dsl/25.12/gh200/environments.yaml @@ -11,7 +11,7 @@ icon: # icon4py deps - python@3.11 - py-cupy@13.3 +cuda cuda_arch=90 - - ghex@git.9c09f3c52d2d76816074cdff869e2f90d005137c=philip-async-mpi +python +cuda cuda_arch=90 + - ghex@git.a1de2a6a16b728ad08df7ec0793e30591e61e4c7=philip-async-mpi +python +cuda cuda_arch=90 - boost +thread - py-mpi4py - icon4py@git.bef46a7625773659ce81e249758ffe401005a92d=blueline_staging_2026-03-16 From ce473210332c1fd552f4cf00840b0b2d31a6e494 Mon Sep 17 00:00:00 2001 From: Mikael Simberg Date: Wed, 18 Mar 2026 12:08:38 +0100 Subject: [PATCH 16/32] Remove ghex version constraint --- recipes/icon-dsl/25.12/gh200/environments.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/recipes/icon-dsl/25.12/gh200/environments.yaml b/recipes/icon-dsl/25.12/gh200/environments.yaml index 83ea5dab..69bad148 100644 --- a/recipes/icon-dsl/25.12/gh200/environments.yaml +++ b/recipes/icon-dsl/25.12/gh200/environments.yaml @@ -11,7 +11,9 @@ icon: # icon4py deps - python@3.11 - py-cupy@13.3 +cuda cuda_arch=90 - - ghex@git.a1de2a6a16b728ad08df7ec0793e30591e61e4c7=philip-async-mpi +python +cuda cuda_arch=90 + - ghex + - oomph + - hwmalloc - boost +thread - py-mpi4py - icon4py@git.bef46a7625773659ce81e249758ffe401005a92d=blueline_staging_2026-03-16 From 4276806f7f60f97099e7e20db471c226920aaf25 Mon Sep 17 00:00:00 2001 From: Mikael Simberg Date: Wed, 18 Mar 2026 14:04:07 +0100 Subject: [PATCH 17/32] Update icon4py --- recipes/icon-dsl/25.12/gh200/environments.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/icon-dsl/25.12/gh200/environments.yaml b/recipes/icon-dsl/25.12/gh200/environments.yaml index 69bad148..9dec231e 100644 --- a/recipes/icon-dsl/25.12/gh200/environments.yaml +++ b/recipes/icon-dsl/25.12/gh200/environments.yaml @@ -16,7 +16,7 @@ icon: - hwmalloc - boost +thread - py-mpi4py - - icon4py@git.bef46a7625773659ce81e249758ffe401005a92d=blueline_staging_2026-03-16 + - icon4py@git.a967314dad2f83a9163ed7bd332f2c389837c6a8=main - icon-exclaim@git.5f0c6eed726a37ad5e6ca311284b2a43c259c1dc=0.3.0 %nvhpc dsl=substitute +grib2 +eccodes-definitions +ecrad ~emvorado +art +dace gpu=nvidia-90 +mpi-gpu +realloc-buf ~aes ~jsbach ~ocean ~coupling ~rte-rrtmgp ~loop-exchange ~async-io-rma ~cuda-graphs fflags="-traceback" From 8715551a74c04175103a8f20d9c67a8a3670adb8 Mon Sep 17 00:00:00 2001 From: Mikael Simberg Date: Wed, 18 Mar 2026 15:03:42 +0100 Subject: [PATCH 18/32] Remove more version constraints --- .../icon-dsl/25.12/gh200/repo/packages/icon-exclaim/package.py | 1 - 1 file changed, 1 deletion(-) diff --git a/recipes/icon-dsl/25.12/gh200/repo/packages/icon-exclaim/package.py b/recipes/icon-dsl/25.12/gh200/repo/packages/icon-exclaim/package.py index 41c78060..3b3f18fa 100644 --- a/recipes/icon-dsl/25.12/gh200/repo/packages/icon-exclaim/package.py +++ b/recipes/icon-dsl/25.12/gh200/repo/packages/icon-exclaim/package.py @@ -377,7 +377,6 @@ class IconExclaim(Icon): description='Build with GT4Py dynamical core', multi=True) - depends_on("icon4py@blueline_staging_2026-03-16", when="@0.3.0") for x in dsl_values: depends_on('icon4py', type="build", when=f"dsl={x}") From 091e1a73439ea6d88a3074d4aae8b7a166a28fe2 Mon Sep 17 00:00:00 2001 From: Mikael Simberg Date: Thu, 19 Mar 2026 11:00:33 +0100 Subject: [PATCH 19/32] Update icon-exclaim commit --- recipes/icon-dsl/25.12/gh200/environments.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/icon-dsl/25.12/gh200/environments.yaml b/recipes/icon-dsl/25.12/gh200/environments.yaml index 9dec231e..5723d6eb 100644 --- a/recipes/icon-dsl/25.12/gh200/environments.yaml +++ b/recipes/icon-dsl/25.12/gh200/environments.yaml @@ -17,7 +17,7 @@ icon: - boost +thread - py-mpi4py - icon4py@git.a967314dad2f83a9163ed7bd332f2c389837c6a8=main - - icon-exclaim@git.5f0c6eed726a37ad5e6ca311284b2a43c259c1dc=0.3.0 %nvhpc dsl=substitute +grib2 +eccodes-definitions +ecrad + - icon-exclaim@git.16094db329861582d7b19de54fd3e88ad86a3834=0.3.0 %nvhpc dsl=substitute +grib2 +eccodes-definitions +ecrad ~emvorado +art +dace gpu=nvidia-90 +mpi-gpu +realloc-buf ~aes ~jsbach ~ocean ~coupling ~rte-rrtmgp ~loop-exchange ~async-io-rma ~cuda-graphs fflags="-traceback" # icon deps From 3d66d181357d9b9be0429386febd73ca561329f3 Mon Sep 17 00:00:00 2001 From: Mikael Simberg Date: Thu, 26 Mar 2026 10:59:54 +0100 Subject: [PATCH 20/32] Update icon4py and icon-exclaim --- recipes/icon-dsl/25.12/gh200/environments.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/recipes/icon-dsl/25.12/gh200/environments.yaml b/recipes/icon-dsl/25.12/gh200/environments.yaml index 5723d6eb..0cf65ade 100644 --- a/recipes/icon-dsl/25.12/gh200/environments.yaml +++ b/recipes/icon-dsl/25.12/gh200/environments.yaml @@ -16,8 +16,8 @@ icon: - hwmalloc - boost +thread - py-mpi4py - - icon4py@git.a967314dad2f83a9163ed7bd332f2c389837c6a8=main - - icon-exclaim@git.16094db329861582d7b19de54fd3e88ad86a3834=0.3.0 %nvhpc dsl=substitute +grib2 +eccodes-definitions +ecrad + - icon4py@git.699c127007b82546bea1b765dac54f289e94d841=main + - icon-exclaim@git.a0be2c3e0448ec2dc92024e3b38ec635435ac0dd=0.3.0 %nvhpc dsl=substitute +grib2 +eccodes-definitions +ecrad ~emvorado +art +dace gpu=nvidia-90 +mpi-gpu +realloc-buf ~aes ~jsbach ~ocean ~coupling ~rte-rrtmgp ~loop-exchange ~async-io-rma ~cuda-graphs fflags="-traceback" # icon deps From e2c2efe3caac8ab1eff1b42a21575a5749de1d29 Mon Sep 17 00:00:00 2001 From: Mikael Simberg Date: Thu, 26 Mar 2026 11:43:01 +0100 Subject: [PATCH 21/32] Update icon4py build options in icon-exclaim package --- .../repo/packages/icon-exclaim/package.py | 40 +++++-------------- 1 file changed, 9 insertions(+), 31 deletions(-) diff --git a/recipes/icon-dsl/25.12/gh200/repo/packages/icon-exclaim/package.py b/recipes/icon-dsl/25.12/gh200/repo/packages/icon-exclaim/package.py index 3b3f18fa..059e3236 100644 --- a/recipes/icon-dsl/25.12/gh200/repo/packages/icon-exclaim/package.py +++ b/recipes/icon-dsl/25.12/gh200/repo/packages/icon-exclaim/package.py @@ -380,6 +380,13 @@ class IconExclaim(Icon): for x in dsl_values: depends_on('icon4py', type="build", when=f"dsl={x}") + + # TODO: Should this be set here or in the icon4py package? + # def setup_build_environment(self, env): + # TODO: Guard with dsl variant + # env.prepend_path("PATH", self.spec["icon4py"].prefix.share.venv.bin) + + def configure_args(self): raw_args = super().configure_args() @@ -403,21 +410,14 @@ def configure_args(self): dsl = self.spec.variants['dsl'].value if dsl != ('none', ): if 'substitute' in dsl: - args_flags.append('--enable-py2f=substitute') + args_flags.append('--enable-icon4py=substitute') elif 'verify' in dsl: - args_flags.append('--enable-py2f=verify') + args_flags.append('--enable-icon4py=verify') else: raise ValueError( f"Unknown DSL variant '{dsl}'. " f"Valid options are: {', '.join(('none',) + dsl_values)}") - # Add icon4py paths and libs - icon4py_prefix = self.spec["icon4py"].prefix - bindings_dir = os.path.join(icon4py_prefix, "src") - - ldflags.append(f"-L{bindings_dir} -Wl,-rpath,{bindings_dir}") - libs.append("-licon4py_bindings") - # Remove duplicates icon_ldflags = list(dict.fromkeys(icon_ldflags)) ldflags = list(dict.fromkeys(ldflags)) @@ -433,25 +433,3 @@ def configure_args(self): final_args.append("LIBS=" + " ".join(libs)) return final_args - - def build(self, spec, prefix): - # Check the variant - dsl = self.spec.variants['dsl'].value - if dsl != ('none', ): - file = "icon4py_bindings.f90" - - bindings_dir = os.path.join(self.spec["icon4py"].prefix, "src") - src_file = os.path.join(bindings_dir, file) - - build_py2f_dir = os.path.join(self.stage.source_path, "src", - "build_py2f") - os.makedirs(build_py2f_dir, exist_ok=True) - dest_file = os.path.join(build_py2f_dir, file) - - shutil.copy2(src_file, dest_file) - print( - f"Copied {src_file} to build directory {dest_file} because +dsl is enabled" - ) - - # Proceed with the normal build - super().build(spec, prefix) From 1956e5177c9c3af0935df2e88de751d1c4f5e9a6 Mon Sep 17 00:00:00 2001 From: Mikael Simberg Date: Thu, 26 Mar 2026 12:20:15 +0100 Subject: [PATCH 22/32] Try to set icon4py venv bin path in icon-exclaim --- .../25.12/gh200/repo/packages/icon-exclaim/package.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/recipes/icon-dsl/25.12/gh200/repo/packages/icon-exclaim/package.py b/recipes/icon-dsl/25.12/gh200/repo/packages/icon-exclaim/package.py index 059e3236..0364b477 100644 --- a/recipes/icon-dsl/25.12/gh200/repo/packages/icon-exclaim/package.py +++ b/recipes/icon-dsl/25.12/gh200/repo/packages/icon-exclaim/package.py @@ -382,9 +382,12 @@ class IconExclaim(Icon): # TODO: Should this be set here or in the icon4py package? - # def setup_build_environment(self, env): - # TODO: Guard with dsl variant - # env.prepend_path("PATH", self.spec["icon4py"].prefix.share.venv.bin) + def setup_build_environment(self, env): + if self.spec.variants['dsl'].value != ('none', ): + # TODO: clean up + print(f"adding {self.spec['icon4py'].prefix.share.venv.bin} to PATH for icon4py bindings because +dsl is enabled") + env.prepend_path("PATH", self.spec["icon4py"].prefix.share.venv.bin) + env.append_path("PATH", self.spec["icon4py"].prefix.share.venv.bin) def configure_args(self): From b1bb3d94c1e36b71ecd11398022a6e9b6f1846cb Mon Sep 17 00:00:00 2001 From: Mikael Simberg Date: Thu, 26 Mar 2026 14:25:30 +0100 Subject: [PATCH 23/32] Try to add dsl=verify --- .../icon-dsl/25.12/gh200/environments.yaml | 55 +++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/recipes/icon-dsl/25.12/gh200/environments.yaml b/recipes/icon-dsl/25.12/gh200/environments.yaml index 0cf65ade..967c26c1 100644 --- a/recipes/icon-dsl/25.12/gh200/environments.yaml +++ b/recipes/icon-dsl/25.12/gh200/environments.yaml @@ -50,3 +50,58 @@ icon: uenv: prefix_paths: LD_LIBRARY_PATH: [lib, lib64] +# TODO: What's the cleanest way to do this? We want both dsl=substitute and +# dsl=verify available in the uenv. dsl=verify does not have to be available +# easily. +icon-verify: + compiler: + - toolchain: gcc + spec: gcc + - toolchain: llvm + spec: nvhpc + mpi: + spec: cray-mpich@8.1.30%nvhpc + gpu: cuda + specs: + # icon4py deps + - python@3.11 + - py-cupy@13.3 +cuda cuda_arch=90 + - ghex + - oomph + - hwmalloc + - boost +thread + - py-mpi4py + - icon4py@git.699c127007b82546bea1b765dac54f289e94d841=main + - icon-exclaim@git.a0be2c3e0448ec2dc92024e3b38ec635435ac0dd=0.3.0 %nvhpc dsl=verify +grib2 +eccodes-definitions +ecrad + ~emvorado +art +dace gpu=nvidia-90 +mpi-gpu +realloc-buf ~aes ~jsbach ~ocean ~coupling + ~rte-rrtmgp ~loop-exchange ~async-io-rma ~cuda-graphs fflags="-traceback" + # icon deps + - cuda@12.6:12 + - eccodes@2.36.4%nvhpc +tools +fortran +aec +openmp jp2k=jasper + - cosmo-eccodes-definitions@2.36.0.3 + - hdf5%nvhpc +szip +hl +fortran +mpi + - netcdf-c@4.9.2%nvhpc + - netcdf-cxx4@4.3.1%nvhpc + - netcdf-fortran@4.6.1%nvhpc + - osu-micro-benchmarks@5.9%nvhpc + - openblas + # for validation + # - cdo # TODO: Enable? Currently broken. + # everything needed for nccl on SS11 + - nccl + - nccl-tests + # extras + - libfyaml + - zlib-ng + - cmake + unify: true + variants: + - +mpi + - +cuda + - cuda_arch=90 + views: + default-verify: + link: roots + uenv: + prefix_paths: + LD_LIBRARY_PATH: [lib, lib64] From ed982940ac39e819e8ce4376e6dca6d7ac0f58c3 Mon Sep 17 00:00:00 2001 From: Mikael Simberg Date: Fri, 27 Mar 2026 14:23:15 +0100 Subject: [PATCH 24/32] Add icon4py 0.1.0 and icon-exclaim 0.3.0 --- .../25.12/gh200/repo/packages/icon-exclaim/package.py | 2 +- recipes/icon-dsl/25.8/gh200/repo/packages/icon4py/package.py | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/recipes/icon-dsl/25.12/gh200/repo/packages/icon-exclaim/package.py b/recipes/icon-dsl/25.12/gh200/repo/packages/icon-exclaim/package.py index 0364b477..6bb3828f 100644 --- a/recipes/icon-dsl/25.12/gh200/repo/packages/icon-exclaim/package.py +++ b/recipes/icon-dsl/25.12/gh200/repo/packages/icon-exclaim/package.py @@ -365,7 +365,7 @@ class IconExclaim(Icon): version('develop', branch='icon-dsl', submodules=True) version("0.3.0", - commit="5f0c6eed726a37ad5e6ca311284b2a43c259c1dc", + commit="a0be2c3e0448ec2dc92024e3b38ec635435ac0dd", submodules=True) # EXCLAIM-GT4Py specific features: diff --git a/recipes/icon-dsl/25.8/gh200/repo/packages/icon4py/package.py b/recipes/icon-dsl/25.8/gh200/repo/packages/icon4py/package.py index 9ee413ec..e7a437f4 100644 --- a/recipes/icon-dsl/25.8/gh200/repo/packages/icon4py/package.py +++ b/recipes/icon-dsl/25.8/gh200/repo/packages/icon4py/package.py @@ -23,6 +23,11 @@ class Icon4py(Package): depends_on("py-cupy +cuda") depends_on("ghex +python +cuda") + version( + "0.1.0", + sha256="0d48d34234af32243fe899a9e86edd90bbd57890cb89bfda8de906589a70e273", + extension="zip", + ) version( "icon_20250328", sha256="8573ef031d207438f549511e859f522c60163ea660aafea93ef4991b9010739a", From 2cffb3a6fe09f666e4f3c8a3201232ef938fb1f8 Mon Sep 17 00:00:00 2001 From: Mikael Simberg Date: Fri, 27 Mar 2026 14:49:46 +0100 Subject: [PATCH 25/32] Update recipe with icon4py/icon-exclaim versions --- recipes/icon-dsl/25.12/gh200/environments.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/recipes/icon-dsl/25.12/gh200/environments.yaml b/recipes/icon-dsl/25.12/gh200/environments.yaml index 967c26c1..aa42109d 100644 --- a/recipes/icon-dsl/25.12/gh200/environments.yaml +++ b/recipes/icon-dsl/25.12/gh200/environments.yaml @@ -16,8 +16,8 @@ icon: - hwmalloc - boost +thread - py-mpi4py - - icon4py@git.699c127007b82546bea1b765dac54f289e94d841=main - - icon-exclaim@git.a0be2c3e0448ec2dc92024e3b38ec635435ac0dd=0.3.0 %nvhpc dsl=substitute +grib2 +eccodes-definitions +ecrad + - icon4py@0.1.0 + - icon-exclaim@0.3.0 %nvhpc dsl=substitute +grib2 +eccodes-definitions +ecrad ~emvorado +art +dace gpu=nvidia-90 +mpi-gpu +realloc-buf ~aes ~jsbach ~ocean ~coupling ~rte-rrtmgp ~loop-exchange ~async-io-rma ~cuda-graphs fflags="-traceback" # icon deps @@ -71,8 +71,8 @@ icon-verify: - hwmalloc - boost +thread - py-mpi4py - - icon4py@git.699c127007b82546bea1b765dac54f289e94d841=main - - icon-exclaim@git.a0be2c3e0448ec2dc92024e3b38ec635435ac0dd=0.3.0 %nvhpc dsl=verify +grib2 +eccodes-definitions +ecrad + - icon4py@0.1.0 + - icon-exclaim@0.3.0 %nvhpc dsl=verify +grib2 +eccodes-definitions +ecrad ~emvorado +art +dace gpu=nvidia-90 +mpi-gpu +realloc-buf ~aes ~jsbach ~ocean ~coupling ~rte-rrtmgp ~loop-exchange ~async-io-rma ~cuda-graphs fflags="-traceback" # icon deps From 5dde8bc687bfbd2a06d397f2bf2de374642b839c Mon Sep 17 00:00:00 2001 From: Mikael Simberg Date: Fri, 27 Mar 2026 15:11:12 +0100 Subject: [PATCH 26/32] Try to update icon-dsl/25.12/a100 recipe to match gh200 --- recipes/icon-dsl/25.12/a100/environments.yaml | 84 +++- recipes/icon-dsl/25.12/a100/repo | 1 + .../eccodes/cmake_install_rpath.patch | 11 - .../packages/eccodes/openjpeg_jasper.patch | 39 -- .../a100/repo/packages/eccodes/package.py | 385 --------------- .../a100/repo/packages/eccodes/readme.md | 1 - .../repo/packages/icon-exclaim/package.py | 458 ------------------ .../a100/repo/packages/py-cupy/package.py | 145 ------ 8 files changed, 71 insertions(+), 1053 deletions(-) create mode 120000 recipes/icon-dsl/25.12/a100/repo delete mode 100644 recipes/icon-dsl/25.12/a100/repo/packages/eccodes/cmake_install_rpath.patch delete mode 100644 recipes/icon-dsl/25.12/a100/repo/packages/eccodes/openjpeg_jasper.patch delete mode 100644 recipes/icon-dsl/25.12/a100/repo/packages/eccodes/package.py delete mode 100644 recipes/icon-dsl/25.12/a100/repo/packages/eccodes/readme.md delete mode 100755 recipes/icon-dsl/25.12/a100/repo/packages/icon-exclaim/package.py delete mode 100644 recipes/icon-dsl/25.12/a100/repo/packages/py-cupy/package.py diff --git a/recipes/icon-dsl/25.12/a100/environments.yaml b/recipes/icon-dsl/25.12/a100/environments.yaml index 48ada97b..da286701 100644 --- a/recipes/icon-dsl/25.12/a100/environments.yaml +++ b/recipes/icon-dsl/25.12/a100/environments.yaml @@ -1,26 +1,27 @@ icon: compiler: - - toolchain: gcc - spec: gcc - - toolchain: llvm - spec: nvhpc + - toolchain: gcc + spec: gcc + - toolchain: llvm + spec: nvhpc mpi: - spec: cray-mpich@8.1.30%nvhpc - gpu: cuda - unify: true + spec: cray-mpich@8.1.30%nvhpc + gpu: cuda specs: # icon4py deps - python@3.11 - - py-cupy@13.3.0 +cuda cuda_arch=80 - - ghex@async-mpi +python +cuda cuda_arch=80 + - py-cupy@13.3 +cuda cuda_arch=80 + - ghex + - oomph + - hwmalloc - boost +thread - py-mpi4py - - icon4py@0.0.15 - - icon-exclaim @0.3.0 %nvhpc dsl=substitute +grib2 +eccodes-definitions +ecrad + - icon4py@0.1.0 + - icon-exclaim@0.3.0 %nvhpc dsl=substitute +grib2 +eccodes-definitions +ecrad ~emvorado +art +dace gpu=nvidia-80 +mpi-gpu +realloc-buf ~aes ~jsbach ~ocean ~coupling ~rte-rrtmgp ~loop-exchange ~async-io-rma ~cuda-graphs fflags="-traceback" # icon deps - - cuda@12.4 + - cuda@12.6:12 - eccodes@2.36.4%nvhpc +tools +fortran +aec +openmp jp2k=jasper - cosmo-eccodes-definitions@2.36.0.3 - hdf5%nvhpc +szip +hl +fortran +mpi @@ -30,7 +31,7 @@ icon: - osu-micro-benchmarks@5.9%nvhpc - openblas # for validation - - cdo + # - cdo # TODO: Enable? Currently broken. # everything needed for nccl on SS11 - nccl - nccl-tests @@ -38,6 +39,7 @@ icon: - libfyaml - zlib-ng - cmake + unify: true variants: - +mpi - +cuda @@ -46,6 +48,60 @@ icon: default: link: roots uenv: - add_compilers: true + prefix_paths: + LD_LIBRARY_PATH: [lib, lib64] +# TODO: What's the cleanest way to do this? We want both dsl=substitute and +# dsl=verify available in the uenv. dsl=verify does not have to be available +# easily. +icon-verify: + compiler: + - toolchain: gcc + spec: gcc + - toolchain: llvm + spec: nvhpc + mpi: + spec: cray-mpich@8.1.30%nvhpc + gpu: cuda + specs: + # icon4py deps + - python@3.11 + - py-cupy@13.3 +cuda cuda_arch=80 + - ghex + - oomph + - hwmalloc + - boost +thread + - py-mpi4py + - icon4py@0.1.0 + - icon-exclaim@0.3.0 %nvhpc dsl=verify +grib2 +eccodes-definitions +ecrad + ~emvorado +art +dace gpu=nvidia-80 +mpi-gpu +realloc-buf ~aes ~jsbach ~ocean ~coupling + ~rte-rrtmgp ~loop-exchange ~async-io-rma ~cuda-graphs fflags="-traceback" + # icon deps + - cuda@12.6:12 + - eccodes@2.36.4%nvhpc +tools +fortran +aec +openmp jp2k=jasper + - cosmo-eccodes-definitions@2.36.0.3 + - hdf5%nvhpc +szip +hl +fortran +mpi + - netcdf-c@4.9.2%nvhpc + - netcdf-cxx4@4.3.1%nvhpc + - netcdf-fortran@4.6.1%nvhpc + - osu-micro-benchmarks@5.9%nvhpc + - openblas + # for validation + # - cdo # TODO: Enable? Currently broken. + # everything needed for nccl on SS11 + - nccl + - nccl-tests + # extras + - libfyaml + - zlib-ng + - cmake + unify: true + variants: + - +mpi + - +cuda + - cuda_arch=80 + views: + default-verify: + link: roots + uenv: prefix_paths: LD_LIBRARY_PATH: [lib, lib64] diff --git a/recipes/icon-dsl/25.12/a100/repo b/recipes/icon-dsl/25.12/a100/repo new file mode 120000 index 00000000..82cd72ee --- /dev/null +++ b/recipes/icon-dsl/25.12/a100/repo @@ -0,0 +1 @@ +gh200/repo/ \ No newline at end of file diff --git a/recipes/icon-dsl/25.12/a100/repo/packages/eccodes/cmake_install_rpath.patch b/recipes/icon-dsl/25.12/a100/repo/packages/eccodes/cmake_install_rpath.patch deleted file mode 100644 index 7e2b2508..00000000 --- a/recipes/icon-dsl/25.12/a100/repo/packages/eccodes/cmake_install_rpath.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/cmake/ecbuild_append_to_rpath.cmake -+++ b/cmake/ecbuild_append_to_rpath.cmake -@@ -31,7 +31,7 @@ function( _path_append var path ) - else() - list( FIND ${var} ${path} _found ) - if( _found EQUAL "-1" ) -- set( ${var} "${${var}}:${path}" PARENT_SCOPE ) -+ set( ${var} "${${var}};${path}" PARENT_SCOPE ) - endif() - endif() - endfunction() diff --git a/recipes/icon-dsl/25.12/a100/repo/packages/eccodes/openjpeg_jasper.patch b/recipes/icon-dsl/25.12/a100/repo/packages/eccodes/openjpeg_jasper.patch deleted file mode 100644 index 5793f568..00000000 --- a/recipes/icon-dsl/25.12/a100/repo/packages/eccodes/openjpeg_jasper.patch +++ /dev/null @@ -1,39 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -43,6 +43,18 @@ ecbuild_add_option( FEATURE JPG - DESCRIPTION "support for JPG decoding/encoding" - DEFAULT ON - ) -+# Options related to JPG. The Jasper and OpenJPEG libraries -+ecbuild_add_option( FEATURE JPG_LIBJASPER -+ DESCRIPTION "Support for JPG decoding/encoding with the Jasper library" -+ CONDITION ENABLE_JPG -+ DEFAULT ON -+) -+ecbuild_add_option( FEATURE JPG_LIBOPENJPEG -+ DESCRIPTION "Support for JPG decoding/encoding with the OpenJPEG library" -+ CONDITION ENABLE_JPG -+ DEFAULT ON -+) -+ - - ecbuild_add_option( FEATURE PNG - DESCRIPTION "support for PNG decoding/encoding" -@@ -144,7 +156,7 @@ if( ENABLE_JPG ) - - find_package( OpenJPEG ) - -- if( JASPER_FOUND ) -+ if( JASPER_FOUND AND ENABLE_JPG_LIBJASPER ) - list( APPEND ECCODES_TPLS Jasper ) - set( HAVE_JPEG 1 ) - set( HAVE_LIBJASPER 1 ) -@@ -152,7 +164,7 @@ if( ENABLE_JPG ) - string(REGEX REPLACE "^([0-9]+)\\.[0-9]+\\.[0-9]+.*" "\\1" JASPER_VERSION_MAJOR "${JASPER_VERSION_STRING}") - endif() - -- if( OPENJPEG_FOUND ) -+ if( OPENJPEG_FOUND AND ENABLE_JPG_LIBOPENJPEG ) - list( APPEND ECCODES_TPLS OpenJPEG ) - set( HAVE_JPEG 1 ) - set( HAVE_LIBOPENJPEG 1 ) diff --git a/recipes/icon-dsl/25.12/a100/repo/packages/eccodes/package.py b/recipes/icon-dsl/25.12/a100/repo/packages/eccodes/package.py deleted file mode 100644 index aeb46920..00000000 --- a/recipes/icon-dsl/25.12/a100/repo/packages/eccodes/package.py +++ /dev/null @@ -1,385 +0,0 @@ -# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other -# Spack Project Developers. See the top-level COPYRIGHT file for details. -# -# SPDX-License-Identifier: (Apache-2.0 OR MIT) - - -from spack.package import * - -_definitions = { - # German Meteorological Service (Deutscher Wetterdienst, DWD): - "edzw": { - "conflicts": {"when": "@:2.19.1,2.22.0,2.24.0:"}, - "resources": [ - { - "when": "@2.20.0", - "url": "http://opendata.dwd.de/weather/lib/grib/eccodes_definitions.edzw-2.20.0-1.tar.gz", - "sha256": "a92932f8a13c33cba65d3a33aa06c7fb4a37ed12a78e9abe2c5e966402b99af4", - }, - { - "when": "@2.21.0", - "url": "http://opendata.dwd.de/weather/lib/grib/eccodes_definitions.edzw-2.21.0-3.tar.bz2", - "sha256": "046f1f6450abb3b44c31dee6229f4aab06ca0d3576e27e93e05ccb7cd6e2d9d9", - }, - { - "when": "@2.22.1", - "url": "http://opendata.dwd.de/weather/lib/grib/eccodes_definitions.edzw-2.22.1-1.tar.bz2", - "sha256": "be73102a0dcabb236bacd2a70c7b5475f673fda91b49e34df61bef0fa5ad3389", - }, - { - "when": "@2.23.0", - "url": "http://opendata.dwd.de/weather/lib/grib/eccodes_definitions.edzw-2.23.0-4.tar.bz2", - "sha256": "c5db32861c7d23410aed466ffef3ca661410d252870a3949442d3ecb176aa338", - }, - ], - } -} - - -class Eccodes(CMakePackage): - """ecCodes is a package developed by ECMWF for processing meteorological - data in GRIB (1/2), BUFR (3/4) and GTS header formats.""" - - homepage = "https://software.ecmwf.int/wiki/display/ECC/ecCodes+Home" - url = "https://confluence.ecmwf.int/download/attachments/45757960/eccodes-2.2.0-Source.tar.gz?api=v2" - git = "https://github.com/ecmwf/eccodes.git" - list_url = "https://confluence.ecmwf.int/display/ECC/Releases" - - maintainers("skosukhin", "victoria-cherkas", "dominichofer", "climbfuji") - - license("Apache-2.0") - - version("develop", branch="develop") - version("2.36.4", - sha256="198ccb26e8df96544c668ea6853ea153535ab78b10c43339a678f271337aa0da", - url="https://github.com/ecmwf/eccodes/archive/refs/tags/2.36.4.tar.gz" - ) - version("2.34.0", sha256="3cd208c8ddad132789662cf8f67a9405514bfefcacac403c0d8c84507f303aba") - version("2.33.0", sha256="bdcec8ce63654ec6803400c507f01220a9aa403a45fa6b5bdff7fdcc44fd7daf") - version("2.32.1", sha256="ad2ac1bf36577b1d35c4a771b4d174a06f522a1e5ef6c1f5e53a795fb624863e") - version("2.32.0", sha256="b57e8eeb0eba0c05d66fda5527c4ffa84b5ab35c46bcbc9a2227142973ccb8e6") - version("2.31.0", sha256="808ecd2c11fbf2c3f9fc7a36f8c2965b343f3151011b58a1d6e7cc2e6b3cac5d") - version("2.25.0", sha256="8975131aac54d406e5457706fd4e6ba46a8cc9c7dd817a41f2aa64ce1193c04e") - version("2.24.2", sha256="c60ad0fd89e11918ace0d84c01489f21222b11d6cad3ff7495856a0add610403") - version("2.23.0", sha256="cbdc8532537e9682f1a93ddb03440416b66906a4cc25dec3cbd73940d194bf0c") - version("2.22.1", sha256="75c7ee96469bb30b0c8f7edbdc4429ece4415897969f75c36173545242bc9e85") - version("2.21.0", sha256="da0a0bf184bb436052e3eae582defafecdb7c08cdaab7216780476e49b509755") - version("2.20.0", sha256="207a3d7966e75d85920569b55a19824673e8cd0b50db4c4dac2d3d52eacd7985") - version("2.19.1", sha256="9964bed5058e873d514bd4920951122a95963128b12f55aa199d9afbafdd5d4b") - version("2.18.0", sha256="d88943df0f246843a1a062796edbf709ef911de7269648eef864be259e9704e3") - version("2.13.0", sha256="c5ce1183b5257929fc1f1c8496239e52650707cfab24f4e0e1f1a471135b8272") - version("2.5.0", sha256="18ab44bc444168fd324d07f7dea94f89e056f5c5cd973e818c8783f952702e4e") - version("2.2.0", sha256="1a4112196497b8421480e2a0a1164071221e467853486577c4f07627a702f4c3") - - # we are still using spack v0.21 v0.22, so comment these out for now - #depends_on("c", type="build") # generated - #depends_on("cxx", type="build") # generated - #depends_on("fortran", type="build") # generated - - variant("tools", default=False, description="Build the command line tools") - variant("netcdf", default=False, description="Enable GRIB to NetCDF conversion tool") - variant( - "jp2k", - default="openjpeg", - values=("openjpeg", "jasper", "none"), - description="Specify JPEG2000 decoding/encoding backend", - ) - variant("png", default=False, description="Enable PNG support for decoding/encoding") - variant( - "aec", default=True, description="Enable Adaptive Entropy Coding for decoding/encoding" - ) - variant("pthreads", default=False, description="Enable POSIX threads") - variant("openmp", default=False, description="Enable OpenMP threads") - variant( - "memfs", default=False, description="Enable memory based access to definitions/samples" - ) - variant("fortran", default=False, description="Enable the Fortran support") - variant("shared", default=True, description="Build shared versions of the libraries") - - variant( - "extra_definitions", - values=any_combination_of(*_definitions.keys()), - description="List of extra definitions to install", - ) - - depends_on("netcdf-c", when="+netcdf") - # Cannot be built with openjpeg@2.0.x. - depends_on("openjpeg@1.5.0:1.5,2.1.0:2.3", when="jp2k=openjpeg") - # Additional constraint for older versions. - depends_on("openjpeg@:2.1", when="@:2.16 jp2k=openjpeg") - - with when("jp2k=jasper"): - depends_on("jasper") - # jasper 3.x compat from commit 86f0b35f1a8492cb16f82fb976a0a5acd2986ac2 - depends_on("jasper@:2", when="@:2.25.0") - - depends_on("libpng", when="+png") - depends_on("libaec", when="+aec") - # Can be built with Python 2 or Python 3. - depends_on("python", when="+memfs", type="build") - - depends_on("cmake@3.6:", type="build") - depends_on("cmake@3.12:", when="@2.19:", type="build") - - # TODO: ecbuild was only used for the @develop branch - # however, testing 2.36.4, it appears to be a requirement. - # this might be because they package the software differently in GitHub - # (they normally provide releases as tar balls on Confluence) - depends_on("ecbuild", type="build") - #depends_on("ecbuild", type="build", when="@develop") - - conflicts("+openmp", when="+pthreads", msg="Cannot enable both POSIX threads and OMP") - - conflicts( - "+netcdf", - when="~tools", - msg="Cannot enable the NetCDF conversion tool " "when the command line tools are disabled", - ) - - conflicts( - "~tools", - when="@:2.18.0", - msg="The command line tools can be disabled " "only starting version 2.19.0", - ) - - for center, definitions in _definitions.items(): - kwargs = definitions.get("conflicts", None) - if kwargs: - conflicts("extra_definitions={0}".format(center), **kwargs) - for kwargs in definitions.get("resources", []): - resource( - name=center, - destination="spack-definitions", - placement="definitions.{0}".format(center), - **kwargs, - ) - - # Enforce linking against the specified JPEG2000 backend, see also - # https://github.com/ecmwf/eccodes/commit/2c10828495900ff3d80d1e570fe96c1df16d97fb - patch("openjpeg_jasper.patch", when="@:2.16") - - # CMAKE_INSTALL_RPATH must be a semicolon-separated list. - patch("cmake_install_rpath.patch", when="@:2.10") - - # Fix a bug preventing cmake from finding NetCDF: - patch( - "https://github.com/ecmwf/ecbuild/commit/3916c7d22575c45166fcc89edcbe02a6e9b81aa2.patch?full_index=1", - sha256="9dcc4affaaa850d4b7247baa939d0f9ffedea132369f1afc3f248dbf720386c9", - when="@:2.4.0+netcdf", - ) - - @when("%nag+fortran") - def patch(self): - # A number of Fortran source files assume that the kinds of integer and - # real variables are specified in bytes. However, the NAG compiler - # accepts such code only with an additional compiler flag -kind=byte. - # We do not simply add the flag because all user applications would - # have to be compiled with this flag too, which goes against one of the - # purposes of using the NAG compiler: make sure the code does not - # contradict the Fortran standards. The following logic could have been - # implemented as regular patch files, which would, however, be quite - # large. We would also have to introduce several versions of each patch - # file to support different versions of the package. - - patch_kind_files = [ - "fortran/eccodes_f90_head.f90", - "fortran/eccodes_f90_tail.f90", - "fortran/grib_f90_head.f90", - "fortran/grib_f90_tail.f90", - "fortran/grib_types.f90", - ] - - patch_unix_ext_files = [] - - if self.run_tests: - patch_kind_files.extend( - [ - "examples/F90/grib_print_data.f90", - "examples/F90/grib_print_data_static.f90", - # Files that need patching only when the extended regression - # tests are enabled, which we disable unconditionally: - # 'examples/F90/bufr_attributes.f90', - # 'examples/F90/bufr_expanded.f90', - # 'examples/F90/bufr_get_keys.f90', - # 'examples/F90/bufr_read_scatterometer.f90', - # 'examples/F90/bufr_read_synop.f90', - # 'examples/F90/bufr_read_temp.f90', - # 'examples/F90/bufr_read_tempf.f90', - # 'examples/F90/bufr_read_tropical_cyclone.f90', - # 'examples/F90/grib_clone.f90', - # 'examples/F90/grib_get_data.f90', - # 'examples/F90/grib_nearest.f90', - # 'examples/F90/grib_precision.f90', - # 'examples/F90/grib_read_from_file.f90', - # 'examples/F90/grib_samples.f90', - # 'examples/F90/grib_set_keys.f90' - ] - ) - - patch_unix_ext_files.extend( - [ - "examples/F90/bufr_ecc-1284.f90", - "examples/F90/grib_set_data.f90", - "examples/F90/grib_set_packing.f90", - # Files that need patching only when the extended regression - # tests are enabled, which we disable unconditionally: - # 'examples/F90/bufr_copy_data.f90', - # 'examples/F90/bufr_get_string_array.f90', - # 'examples/F90/bufr_keys_iterator.f90', - # 'examples/F90/get_product_kind.f90', - # 'examples/F90/grib_count_messages_multi.f90' - ] - ) - - kwargs = {"string": False, "backup": False, "ignore_absent": True} - - # Return the kind and not the size: - filter_file( - r"(^\s*kind_of_double\s*=\s*)(\d{1,2})(\s*$)", - "\\1kind(real\\2)\\3", - "fortran/grib_types.f90", - **kwargs, - ) - filter_file( - r"(^\s*kind_of_\w+\s*=\s*)(\d{1,2})(\s*$)", - "\\1kind(x\\2)\\3", - "fortran/grib_types.f90", - **kwargs, - ) - - # Replace integer kinds: - for size, r in [(2, 4), (4, 9), (8, 18)]: - filter_file( - r"(^\s*integer\((?:kind=)?){0}(\).*)".format(size), - "\\1selected_int_kind({0})\\2".format(r), - *patch_kind_files, - **kwargs, - ) - - # Replace real kinds: - for size, p, r in [(4, 6, 37), (8, 15, 307)]: - filter_file( - r"(^\s*real\((?:kind=)?){0}(\).*)".format(size), - "\\1selected_real_kind({0}, {1})\\2".format(p, r), - *patch_kind_files, - **kwargs, - ) - - # Enable getarg and exit subroutines: - filter_file( - r"(^\s*program\s+\w+)(\s*$)", - "\\1; use f90_unix_env; use f90_unix_proc\\2", - *patch_unix_ext_files, - **kwargs, - ) - - @property - def libs(self): - libraries = [] - - query_parameters = self.spec.last_query.extra_parameters - - if "shared" in query_parameters: - shared = True - elif "static" in query_parameters: - shared = False - else: - shared = "+shared" in self.spec - - # Return Fortran library if requested: - return_fortran = "fortran" in query_parameters - # Return C library if either requested or the Fortran library is not - # requested (to avoid overlinking) or the static libraries are - # requested: - return_c = "c" in query_parameters or not (return_fortran and shared) - # Return MEMFS library only if enabled and the static libraries are - # requested: - return_memfs = "+memfs" in self.spec and not shared - - if return_fortran: - libraries.append("libeccodes_f90") - - if return_c: - libraries.append("libeccodes") - - if return_memfs: - libraries.append("libeccodes_memfs") - - libs = find_libraries(libraries, root=self.prefix, shared=shared, recursive=True) - - if libs and len(libs) == len(libraries): - return libs - - msg = "Unable to recursively locate {0} {1} libraries in {2}" - raise spack.error.NoLibrariesError( - msg.format("shared" if shared else "static", self.spec.name, self.spec.prefix) - ) - - @run_before("cmake") - def check_fortran(self): - if "+fortran" in self.spec and self.compiler.fc is None: - raise InstallError("Fortran interface requires a Fortran compiler!") - - def cmake_args(self): - jp2k = self.spec.variants["jp2k"].value - - args = [ - self.define_from_variant("ENABLE_BUILD_TOOLS", "tools"), - self.define_from_variant("ENABLE_NETCDF", "netcdf"), - self.define("ENABLE_JPG", jp2k != "none"), - self.define("ENABLE_JPG_LIBJASPER", jp2k == "jasper"), - self.define("ENABLE_JPG_LIBOPENJPEG", jp2k == "openjpeg"), - self.define_from_variant("ENABLE_PNG", "png"), - self.define_from_variant("ENABLE_AEC", "aec"), - self.define_from_variant("ENABLE_ECCODES_THREADS", "pthreads"), - self.define_from_variant("ENABLE_ECCODES_OMP_THREADS", "openmp"), - self.define_from_variant("ENABLE_MEMFS", "memfs"), - self.define( - "ENABLE_PYTHON{0}".format("2" if self.spec.satisfies("@2.20.0:") else ""), False - ), - self.define_from_variant("ENABLE_FORTRAN", "fortran"), - self.define("BUILD_SHARED_LIBS", "BOTH" if "+shared" in self.spec else "OFF"), - self.define("ENABLE_TESTS", self.run_tests), - # Examples are not installed and are just part of the test suite: - self.define("ENABLE_EXAMPLES", self.run_tests), - # Unconditionally disable the extended regression tests, since they - # download additional data (~134MB): - self.define("ENABLE_EXTRA_TESTS", False), - ] - - if self.spec.satisfies("+netcdf"): - # Prevent possible overriding by environment variables NETCDF_ROOT, NETCDF_DIR, and - # NETCDF_PATH: - args.append(self.define("NETCDF_PATH", self.spec["netcdf-c"].prefix)) - # Prevent overriding by environment variable HDF5_ROOT (starting version 2.14.0, - # ecCodes is shipped with ecBuild 3.1.0+, which does not seem to rely on the HDF5_ROOT - # variable): - if self.spec.satisfies("@:2.13"): - args.append(self.define("HDF5_ROOT", self.spec["hdf5"].prefix)) - - if jp2k == "openjpeg": - args.append(self.define("OPENJPEG_PATH", self.spec["openjpeg"].prefix)) - - if self.spec.satisfies("+png"): - args.append(self.define("ZLIB_ROOT", self.spec["zlib-api"].prefix)) - - if self.spec.satisfies("+aec"): - # Prevent overriding by environment variables AEC_DIR and AEC_PATH: - args.append(self.define("AEC_DIR", self.spec["libaec"].prefix)) - - return args - - @run_after("install") - def install_extra_definitions(self): - for center in self.spec.variants["extra_definitions"].value: - if center != "none": - center_dir = "definitions.{0}".format(center) - install_tree( - join_path(self.stage.source_path, "spack-definitions", center_dir), - join_path(self.prefix.share.eccodes, center_dir), - ) - - def check(self): - # https://confluence.ecmwf.int/display/ECC/ecCodes+installation - with working_dir(self.build_directory): - ctest() diff --git a/recipes/icon-dsl/25.12/a100/repo/packages/eccodes/readme.md b/recipes/icon-dsl/25.12/a100/repo/packages/eccodes/readme.md deleted file mode 100644 index 9678342a..00000000 --- a/recipes/icon-dsl/25.12/a100/repo/packages/eccodes/readme.md +++ /dev/null @@ -1 +0,0 @@ -copied from mainline spack November 5 2024 so that we can add eccodes 2.36.0 for mch production diff --git a/recipes/icon-dsl/25.12/a100/repo/packages/icon-exclaim/package.py b/recipes/icon-dsl/25.12/a100/repo/packages/icon-exclaim/package.py deleted file mode 100755 index c1b83ff6..00000000 --- a/recipes/icon-dsl/25.12/a100/repo/packages/icon-exclaim/package.py +++ /dev/null @@ -1,458 +0,0 @@ -from spack.pkg.builtin.icon import Icon as SpackIcon -import os -import re -import glob -from collections import defaultdict -from llnl.util import tty -from spack.util.environment import is_system_path -import spack.error as error - -import shutil -import re -from collections import defaultdict - -def check_variant_fcgroup(fcgroup): - pattern = re.compile(r"^[A-Z]+\..+\..") - # fcgroup is False as default - if pattern.match(fcgroup) or fcgroup == 'none': - return True - else: - tty.warn('Variant fcgroup needs format GROUP.files.flag') - return False - - -def check_variant_extra_config_args(extra_config_arg): - pattern = re.compile(r'--(enable|disable)-\S+') - if pattern.match(extra_config_arg) or extra_config_arg == 'none': - return True - else: - tty.warn( - f'The value "{extra_config_arg}" for the extra_config_args variant must follow the format "--enable-arg" or "--disable-arg"' - ) - return False - - -class Icon(SpackIcon): - git = 'git@gitlab.dkrz.de:icon/icon-nwp.git' - - maintainers('jonasjucker', 'huppd') - - version('develop', submodules=True) - version("2024.10", - tag="icon-2024.10", - git='git@gitlab.dkrz.de:icon/icon.git', - submodules=True) - version("2024.01-1", - tag="icon-2024.01-1", - git='git@gitlab.dkrz.de:icon/icon.git', - submodules=True) - version('2.6.6-mch2b', tag='icon-nwp/icon-2.6.6-mch2b', submodules=True) - version('2.6.6-mch2a', tag='icon-nwp/icon-2.6.6-mch2a', submodules=True) - version('nwp-master', submodules=True) - - # The variants' default follow those of ICON - # as described here - # https://gitlab.dkrz.de/icon/icon/-/blob/icon-2024.01/configure?ref_type=tags#L1492-1638 - - # Model Features: - variant('dace', - default=False, - description='Enable the DACE modules for data assimilation') - requires("+mpi", when="+dace") - - variant('emvorado', - default=False, - description='Enable the radar forward operator EMVORADO') - requires("+mpi", when="+emvorado") - - variant('art-gpl', - default=False, - description='Enable GPL-licensed code parts of the ART component') - variant( - 'acm-license', - default=False, - description= - 'Enable code parts that require accepting the ACM Software License') - - # Infrastructural Features: - variant( - 'active-target-sync', - default=False, - description= - 'Enable MPI active target mode (otherwise, passive target mode is used)' - ) - variant('async-io-rma', - default=True, - description='Enable remote memory access (RMA) for async I/O') - variant('realloc-buf', - default=False, - description='Enable reallocatable communication buffer') - variant('sct', default=False, description='Enable the SCT timer') - variant( - 'extra-config-args', - default='none', - multi=True, - values=check_variant_extra_config_args, - description= - 'Inject any configure argument not yet available as variant\nUse this feature cautiously, as injecting non-variant configure arguments may potentially disrupt the build process' - ) - - # Optimization Features: - variant('loop-exchange', default=False, description='Enable loop exchange') - variant('vectorized-lrtm', - default=False, - description='Enable the parallelization-invariant version of LRTM') - variant( - 'pgi-inlib', - default=False, - description= - 'Enable PGI/NVIDIA cross-file function inlining via an inline library') - variant('nccl', default=False, description='Enable NCCL for communication') - - variant('cuda-graphs', default=False, description='Enable CUDA graphs.') - requires('%nvhpc@23.3:', when='+cuda-graphs') - - variant( - 'fcgroup', - default='none', - multi=True, - values=check_variant_fcgroup, - description= - 'Create a Fortran compile group: GROUP;files;flag \nNote: flag can only be one single value, i.e. -O1' - ) - - # verbosity - variant('silent-rules', - default=True, - description='Enable silent-rules for build-process') - variant( - 'eccodes-definitions', - default=False, - description= - 'Enable extension of eccodes with center specific definition files') - - depends_on('cosmo-eccodes-definitions', - type='run', - when='+eccodes-definitions') - - with when('+emvorado'): - depends_on('eccodes +fortran') - depends_on('hdf5 +szip +hl +fortran') - depends_on('zlib-ng') - # WORKAROUND: A build and link dependency should imply that the same compiler is used. This enforces it. - depends_on('eccodes %nvhpc', when='%nvhpc') - depends_on('eccodes %gcc', when='%gcc') - - # WORKAROUND: A build and link dependency should imply that the same compiler is used. This enforces it. - for __x in SpackIcon.serialization_values: - depends_on('serialbox+fortran %nvhpc', - when='serialization={0} %nvhpc'.format(__x)) - depends_on('serialbox+fortran %gcc', - when='serialization={0} %gcc'.format(__x)) - - # WORKAROUND: A build and link dependency should imply that the same compiler is used. This enforces it. - depends_on('netcdf-fortran %nvhpc', when='%nvhpc') - depends_on('netcdf-fortran %gcc', when='%gcc') - - depends_on('hdf5 +szip', when='+sct') - - # patch_libtool is a function from Autotoolspackage. - # For BB we cannot use it because it finds all files - # named "libtool". spack-c2sm is cloned into icon-repo, - # therefore this function detects not only "libtool" files, but - # also the folder where libtool package itself is installed. - patch_libtool = False - - def configure_args(self): - args = super().configure_args() - super_libs = args.pop() - - libs = LibraryList([]) - flags = defaultdict(list) - - for x in [ - 'dace', - 'emvorado', - 'art-gpl', - 'acm-license', - 'active-target-sync', - 'async-io-rma', - 'realloc-buf', - 'parallel-netcdf', - 'sct', - 'loop-exchange', - 'vectorized-lrtm', - 'pgi-inlib', - 'nccl', - 'cuda-graphs', - 'silent-rules', - ]: - args += self.enable_or_disable(x) - - if '+emvorado' in self.spec: - libs += self.spec['eccodes:fortran'].libs - libs += self.spec['hdf5:fortran,hl'].libs - libs += self.spec['zlib-ng'].libs - - if '+sct' in self.spec: - libs += self.spec['hdf5'].libs - - fcgroup = self.spec.variants['fcgroup'].value - # ('none',) is the values spack assign if fcgroup is not set - if fcgroup != ('none', ): - args.extend(self.fcgroup_to_config_arg()) - flags.update(self.fcgroup_to_config_var()) - - # add configure arguments not yet available as variant - extra_config_args = self.spec.variants['extra-config-args'].value - if extra_config_args != ('none', ): - for x in extra_config_args: - # prevent configure-args already available as variant - # to be set through variant extra_config_args - self.validate_extra_config_args(x) - args.append(x) - tty.warn( - 'You use variant extra-config-args. Injecting non-variant configure arguments may potentially disrupt the build process!' - ) - - # Help the libtool scripts of the bundled libraries find the correct - # paths to the external libraries. Specify the library search (-L) flags - # in the reversed order - # (see https://gitlab.dkrz.de/icon/icon#icon-dependencies): - # and for non-system directories only: - flags['LDFLAGS'].extend([ - '-L{0}'.format(d) for d in reversed(libs.directories) - if not is_system_path(d) - ]) - - # Temporary back port fix from upstream package for building comin on cpu - # See https://github.com/spack/spack-packages/commit/b992c44bb52d034fe57637f3da42483501442af3 - # TODO: Remove this dupplicate once spack-c2sm points to an upstream spack containing the fix. - if self.spec.variants[ - "gpu"].value in self.nvidia_targets or self.spec.satisfies( - "+comin"): - flags["ICON_LDFLAGS"].extend(self.compiler.stdcxx_libs) - - args.extend([ - "{0}={1}".format(name, " ".join(value)) - for name, value in flags.items() - ]) - args.append(f"{super_libs} {libs.link_flags}") - return args - - def fcgroup_to_config_arg(self): - arg = [] - for group in self.spec.variants['fcgroup'].value: - name = group.split('.')[0] - files = group.split('.')[1] - arg.append(f'--enable-fcgroup-{name}={files}') - return arg - - def fcgroup_to_config_var(self): - var = {} - for group in self.spec.variants['fcgroup'].value: - name = group.split('.')[0] - flag = group.split('.')[2] - # Note: flag needs to be a list - var[f'ICON_{name}_FCFLAGS'] = [flag] - return var - - def strip_variant_prefix(self, variant_string): - prefixes = ["--enable-", "--disable-"] - - for prefix in prefixes: - if variant_string.startswith(prefix): - return variant_string[len(prefix):] - - raise ValueError - - def validate_extra_config_args(self, arg): - variant_from_arg = self.strip_variant_prefix(arg) - if variant_from_arg in self.spec.variants: - raise error.SpecError( - f'The value "{arg}" for the extra_config_args variant conflicts ' - f'with the existing variant {variant_from_arg}. Set this variant instead.' - ) - - def configure(self, spec, prefix): - if os.path.exists( - os.path.join(self.build_directory, - 'icon.mk')) and self.build_uses_same_spec(): - tty.warn( - 'icon.mk already present -> skip configure stage', - '\t delete "icon.mk" or run "make distclean" to not skip configure' - ) - return - - # Call configure of Autotools - super().configure(spec, prefix) - - def build_uses_same_spec(self): - """ - Ensure that configure is rerun in case spec has changed, - otherwise for the case below - - $ spack dev-build icon @develop ~dace - $ spack dev-build icon @develop +dace - - configure is skipped for the latter. - """ - - is_same_spec = False - - previous_spec = os.path.join(self.build_directory, - '.previous_spec.yaml') - - # not the first build in self.build_directory - if os.path.exists(previous_spec): - with open(previous_spec, mode='r') as f: - if self.spec == Spec.from_yaml(f): - is_same_spec = True - else: - is_same_spec = False - tty.warn( - 'Cannot skip configure phase because spec changed') - - # first build in self.build_directory, no worries - else: - is_same_spec = True - - # dump spec of new build - with open(previous_spec, mode='w') as f: - f.write(self.spec.to_yaml()) - - return is_same_spec - - @run_after('configure') - def copy_runscript_related_input_files(self): - with working_dir(self.build_directory): - icon_dir = self.configure_directory - # only synchronize if out-of-source build - if os.path.abspath(icon_dir) != os.path.abspath( - self.build_directory): - Rsync = which('rsync', required=True) - Rsync("-uavz", f"{icon_dir}/run", ".", "--exclude=*.in", - "--exclude=.*", "--exclude=standard_*") - Rsync("-uavz", f"{icon_dir}/externals", ".", "--exclude=.git", - "--exclude=*.f90", "--exclude=*.F90", "--exclude=*.c", - "--exclude=*.h", "--exclude=*.Po", "--exclude=tests", - "--exclude=*.mod", "--exclude=*.o") - Rsync("-uavz", f"{icon_dir}/make_runscripts", ".") - - Ln = which('ln', required=True) - dirs = glob.glob(f"{icon_dir}/run/standard_*") - for dir in dirs: - Ln("-sf", "-t", "run/", f"{dir}") - Ln("-sf", f"{icon_dir}/data") - Ln("-sf", f"{icon_dir}/vertical_coord_tables") - Ln("-sf", f"{icon_dir}/scripts") - - - -def validate_variant_dsl(pkg, name, value): - set_mutual_excl = set(['substitute', 'verify', 'serialize']) - set_input_var = set(value) - if len(set_mutual_excl.intersection(set_input_var)) > 1: - raise error.SpecError( - 'Cannot have more than one of (substitute, verify, serialize) in the same build' - ) - - -class IconExclaim(Icon): - git = 'git@github.com:C2SM/icon-exclaim.git' - - maintainers('jonasjucker', 'huppd') - - version('develop', branch='icon-dsl', submodules=True) - version("0.3.0", - commit="5c5b742a969af2bd491e26cd0a05a35838f121c4", - submodules=True) - - # EXCLAIM-GT4Py specific features: - dsl_values = ('substitute', 'verify') - variant('dsl', - default='none', - validator=validate_variant_dsl, - values=('none', ) + dsl_values, - description='Build with GT4Py dynamical core', - multi=True) - - depends_on("icon4py@0.0.15", when="@0.3.0") - for x in dsl_values: - depends_on('icon4py', type="build", when=f"dsl={x}") - - def configure_args(self): - raw_args = super().configure_args() - - # Split into categories - args_flags = [] - icon_ldflags = [] - ldflags = [] - libs = [] - - for a in raw_args: - if a.startswith("LIBS="): - libs.append(a.split("=", 1)[1].strip()) - elif a.startswith("ICON_LDFLAGS="): - icon_ldflags.append(a.split("=", 1)[1].strip()) - elif a.startswith("LDFLAGS="): - ldflags.append(a.split("=", 1)[1].strip()) - else: - args_flags.append(a) - - # Handle DSL variants - dsl = self.spec.variants['dsl'].value - if dsl != ('none', ): - if 'substitute' in dsl: - args_flags.append('--enable-py2f=substitute') - elif 'verify' in dsl: - args_flags.append('--enable-py2f=verify') - else: - raise ValueError( - f"Unknown DSL variant '{dsl}'. " - f"Valid options are: {', '.join(('none',) + dsl_values)}") - - # Add icon4py paths and libs - icon4py_prefix = self.spec["icon4py"].prefix - bindings_dir = os.path.join(icon4py_prefix, "src") - - ldflags.append(f"-L{bindings_dir} -Wl,-rpath,{bindings_dir}") - libs.append("-licon4py_bindings") - - # Remove duplicates - icon_ldflags = list(dict.fromkeys(icon_ldflags)) - ldflags = list(dict.fromkeys(ldflags)) - libs = list(dict.fromkeys(libs)) - - # Reconstruct final configure args - final_args = args_flags - if icon_ldflags: - final_args.append("ICON_LDFLAGS=" + " ".join(icon_ldflags)) - if ldflags: - final_args.append("LDFLAGS=" + " ".join(ldflags)) - if libs: - final_args.append("LIBS=" + " ".join(libs)) - - return final_args - - def build(self, spec, prefix): - # Check the variant - dsl = self.spec.variants['dsl'].value - if dsl != ('none', ): - file = "icon4py_bindings.f90" - - bindings_dir = os.path.join(self.spec["icon4py"].prefix, "src") - src_file = os.path.join(bindings_dir, file) - - build_py2f_dir = os.path.join(self.stage.source_path, "src", - "build_py2f") - os.makedirs(build_py2f_dir, exist_ok=True) - dest_file = os.path.join(build_py2f_dir, file) - - shutil.copy2(src_file, dest_file) - print( - f"Copied {src_file} to build directory {dest_file} because +dsl is enabled" - ) - - # Proceed with the normal build - super().build(spec, prefix) diff --git a/recipes/icon-dsl/25.12/a100/repo/packages/py-cupy/package.py b/recipes/icon-dsl/25.12/a100/repo/packages/py-cupy/package.py deleted file mode 100644 index e2be01ef..00000000 --- a/recipes/icon-dsl/25.12/a100/repo/packages/py-cupy/package.py +++ /dev/null @@ -1,145 +0,0 @@ -# Copyright Spack Project Developers. See COPYRIGHT file for details. -# -# SPDX-License-Identifier: (Apache-2.0 OR MIT) - -import os - -from spack.package import * - - -class PyCupy(PythonPackage, CudaPackage, ROCmPackage): - """CuPy is an open-source array library accelerated with - NVIDIA CUDA. CuPy provides GPU accelerated computing with - Python. CuPy uses CUDA-related libraries including cuBLAS, - cuRand, cuSolver, cuSPARSE, cuFFT and NCCL to make - full use of the GPU architecture. - - This version does not use CudNN.""" - - homepage = "https://cupy.dev/" - pypi = "cupy/cupy-8.0.0.tar.gz" - - # version( - # "13.5.1", - # sha256="3dba2f30258463482d52deb420862fbbbaf2c446165a5e8d67377ac6cb5c0870", - # ) - version( - "13.1.0", - sha256="5caf62288481a27713384523623045380ff42e618be4245f478238ed1786f32d", - ) - version( - "12.1.0", - sha256="f6d31989cdb2d96581da12822e28b102f29e254427195c2017eac327869b7320", - ) - version( - "12.0.0", - sha256="61ddbbef73d50d606bd5087570645f3c91ec9176c2566784c1d486d6a3404545", - ) - version( - "11.6.0", - sha256="53dbb840072bb32d4bfbaa6bfa072365a30c98b1fcd1f43e48969071ad98f1a7", - ) - version( - "11.5.0", - sha256="4bc8565bded22cc89b210fd9fb48a5d5316f30701e12bb23852a60314e1f9f6e", - ) - version( - "11.4.0", - sha256="03d52b2626e02a3a2b46d714c1cd03e702c8fe33915fcca6ed8de5c539964f49", - ) - version( - "11.3.0", - sha256="d057cc2f73ecca06fae8b9c270d9e14116203abfd211a704810cc50a453b4c9e", - ) - version( - "11.2.0", - sha256="c33361f117a347a63f6996ea97446d17f1c038f1a1f533e502464235076923e2", - ) - - variant( - "all", default=False, description="Enable optional py-scipy, optuna, and cython" - ) - - depends_on("cxx", type="build") # generated - - depends_on("python@3.7:", when="@:11", type=("build", "run")) - depends_on("python@3.8:", when="@12:", type=("build", "run")) - depends_on("py-setuptools", type="build") - depends_on("py-cython@0.29.22:2", type="build") - depends_on("py-fastrlock@0.5:", type=("build", "run")) - depends_on("py-numpy@1.20:1.25", when="@:11", type=("build", "run")) - depends_on("py-numpy@1.20:1.26", when="@12:", type=("build", "run")) - depends_on("py-numpy@1.22:1.28", when="@13:", type=("build", "run")) - - depends_on("py-scipy@1.6:1.12", when="@:12+all", type=("build", "run")) - depends_on("py-scipy@1.7:1.13", when="@13:+all", type=("build", "run")) - depends_on("py-cython@0.29.22:2", when="+all", type=("build", "run")) - depends_on("py-optuna@2:", when="+all", type=("build", "run")) - - # Based on https://github.com/cupy/cupy/releases - depends_on("cuda@:11.9", when="@:11 +cuda") - depends_on("cuda@:12.1", when="@12:12.1.0 +cuda") - depends_on("cuda@:12.4", when="@13:13.4.1 +cuda") - depends_on("cuda@:12.9", when="@13.5.1: +cuda") - - for a in CudaPackage.cuda_arch_values: - depends_on( - "nccl +cuda cuda_arch={0}".format(a), when="+cuda cuda_arch={0}".format(a) - ) - - depends_on("cutensor", when="@:12.1.0 +cuda") - depends_on("cutensor@2.0.1.2", when="@13.1: +cuda") - - for _arch in ROCmPackage.amdgpu_targets: - arch_str = "amdgpu_target={0}".format(_arch) - rocm_str = "+rocm {0}".format(arch_str) - depends_on("rocprim {0}".format(arch_str), when=rocm_str, type=("link")) - depends_on("rocsolver {0}".format(arch_str), when=rocm_str, type=("link")) - depends_on("rocthrust {0}".format(arch_str), when=rocm_str, type=("link")) - depends_on("rocrand {0}".format(arch_str), when=rocm_str, type=("link")) - depends_on("hipcub {0}".format(rocm_str), when=rocm_str, type=("link")) - depends_on("hipblas {0}".format(rocm_str), when=rocm_str, type=("link")) - depends_on("hiprand {0}".format(rocm_str), when=rocm_str, type=("link")) - depends_on("hipsparse {0}".format(rocm_str), when=rocm_str, type=("link")) - depends_on("hipfft {0}".format(rocm_str), when=rocm_str, type=("link")) - - depends_on("rccl", when="+rocm", type=("link")) - depends_on("roctracer-dev", when="+rocm", type=("link")) - depends_on("rocprofiler-dev", when="+rocm", type=("link")) - - conflicts("~cuda ~rocm") - conflicts("+cuda +rocm") - conflicts("+cuda cuda_arch=none") - - def setup_build_environment(self, env): - env.set("CUPY_NUM_BUILD_JOBS", make_jobs) - if self.spec.satisfies("+cuda"): - cuda_arch = self.spec.variants["cuda_arch"].value - arch_str = ";".join( - "arch=compute_{0},code=sm_{0}".format(i) for i in cuda_arch - ) - env.set("CUPY_NVCC_GENERATE_CODE", arch_str) - elif self.spec.satisfies("+rocm"): - spec = self.spec - - incs = { - "roctracer-dev": ["include/roctracer"], - "hiprand": ["include"], - "rocrand": ["include"], - "rocthrust": ["include"], - "rocprim": ["include"], - "hip": ["include", "include/hip"], - } - - inc_dirs = [] - for pkg, ds in incs.items(): - for d in ds: - p = os.path.join(spec[pkg].prefix, d) - if os.path.exists(p): - inc_dirs.append(p) - - env.set("CUPY_INCLUDE_PATH", ":".join(inc_dirs)) - - env.set("HIPCC", self.spec["hip"].hipcc) - env.set("ROCM_HOME", self.spec["hipcub"].prefix) - env.set("CUPY_INSTALL_USE_HIP", 1) From 22775e972bf8ff13278d5e6c7db6949f1199bd38 Mon Sep 17 00:00:00 2001 From: Mikael Simberg Date: Fri, 27 Mar 2026 15:14:37 +0100 Subject: [PATCH 27/32] No symlink for repo --- recipes/icon-dsl/25.12/a100/repo | 1 - .../eccodes/cmake_install_rpath.patch | 11 + .../packages/eccodes/openjpeg_jasper.patch | 39 ++ .../a100/repo/packages/eccodes/package.py | 385 +++++++++++++++ .../a100/repo/packages/eccodes/readme.md | 1 + .../repo/packages/icon-exclaim/package.py | 438 ++++++++++++++++++ .../a100/repo/packages/py-cupy/package.py | 137 ++++++ 7 files changed, 1011 insertions(+), 1 deletion(-) delete mode 120000 recipes/icon-dsl/25.12/a100/repo create mode 100644 recipes/icon-dsl/25.12/a100/repo/packages/eccodes/cmake_install_rpath.patch create mode 100644 recipes/icon-dsl/25.12/a100/repo/packages/eccodes/openjpeg_jasper.patch create mode 100644 recipes/icon-dsl/25.12/a100/repo/packages/eccodes/package.py create mode 100644 recipes/icon-dsl/25.12/a100/repo/packages/eccodes/readme.md create mode 100644 recipes/icon-dsl/25.12/a100/repo/packages/icon-exclaim/package.py create mode 100644 recipes/icon-dsl/25.12/a100/repo/packages/py-cupy/package.py diff --git a/recipes/icon-dsl/25.12/a100/repo b/recipes/icon-dsl/25.12/a100/repo deleted file mode 120000 index 82cd72ee..00000000 --- a/recipes/icon-dsl/25.12/a100/repo +++ /dev/null @@ -1 +0,0 @@ -gh200/repo/ \ No newline at end of file diff --git a/recipes/icon-dsl/25.12/a100/repo/packages/eccodes/cmake_install_rpath.patch b/recipes/icon-dsl/25.12/a100/repo/packages/eccodes/cmake_install_rpath.patch new file mode 100644 index 00000000..7e2b2508 --- /dev/null +++ b/recipes/icon-dsl/25.12/a100/repo/packages/eccodes/cmake_install_rpath.patch @@ -0,0 +1,11 @@ +--- a/cmake/ecbuild_append_to_rpath.cmake ++++ b/cmake/ecbuild_append_to_rpath.cmake +@@ -31,7 +31,7 @@ function( _path_append var path ) + else() + list( FIND ${var} ${path} _found ) + if( _found EQUAL "-1" ) +- set( ${var} "${${var}}:${path}" PARENT_SCOPE ) ++ set( ${var} "${${var}};${path}" PARENT_SCOPE ) + endif() + endif() + endfunction() diff --git a/recipes/icon-dsl/25.12/a100/repo/packages/eccodes/openjpeg_jasper.patch b/recipes/icon-dsl/25.12/a100/repo/packages/eccodes/openjpeg_jasper.patch new file mode 100644 index 00000000..5793f568 --- /dev/null +++ b/recipes/icon-dsl/25.12/a100/repo/packages/eccodes/openjpeg_jasper.patch @@ -0,0 +1,39 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -43,6 +43,18 @@ ecbuild_add_option( FEATURE JPG + DESCRIPTION "support for JPG decoding/encoding" + DEFAULT ON + ) ++# Options related to JPG. The Jasper and OpenJPEG libraries ++ecbuild_add_option( FEATURE JPG_LIBJASPER ++ DESCRIPTION "Support for JPG decoding/encoding with the Jasper library" ++ CONDITION ENABLE_JPG ++ DEFAULT ON ++) ++ecbuild_add_option( FEATURE JPG_LIBOPENJPEG ++ DESCRIPTION "Support for JPG decoding/encoding with the OpenJPEG library" ++ CONDITION ENABLE_JPG ++ DEFAULT ON ++) ++ + + ecbuild_add_option( FEATURE PNG + DESCRIPTION "support for PNG decoding/encoding" +@@ -144,7 +156,7 @@ if( ENABLE_JPG ) + + find_package( OpenJPEG ) + +- if( JASPER_FOUND ) ++ if( JASPER_FOUND AND ENABLE_JPG_LIBJASPER ) + list( APPEND ECCODES_TPLS Jasper ) + set( HAVE_JPEG 1 ) + set( HAVE_LIBJASPER 1 ) +@@ -152,7 +164,7 @@ if( ENABLE_JPG ) + string(REGEX REPLACE "^([0-9]+)\\.[0-9]+\\.[0-9]+.*" "\\1" JASPER_VERSION_MAJOR "${JASPER_VERSION_STRING}") + endif() + +- if( OPENJPEG_FOUND ) ++ if( OPENJPEG_FOUND AND ENABLE_JPG_LIBOPENJPEG ) + list( APPEND ECCODES_TPLS OpenJPEG ) + set( HAVE_JPEG 1 ) + set( HAVE_LIBOPENJPEG 1 ) diff --git a/recipes/icon-dsl/25.12/a100/repo/packages/eccodes/package.py b/recipes/icon-dsl/25.12/a100/repo/packages/eccodes/package.py new file mode 100644 index 00000000..aeb46920 --- /dev/null +++ b/recipes/icon-dsl/25.12/a100/repo/packages/eccodes/package.py @@ -0,0 +1,385 @@ +# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + + +from spack.package import * + +_definitions = { + # German Meteorological Service (Deutscher Wetterdienst, DWD): + "edzw": { + "conflicts": {"when": "@:2.19.1,2.22.0,2.24.0:"}, + "resources": [ + { + "when": "@2.20.0", + "url": "http://opendata.dwd.de/weather/lib/grib/eccodes_definitions.edzw-2.20.0-1.tar.gz", + "sha256": "a92932f8a13c33cba65d3a33aa06c7fb4a37ed12a78e9abe2c5e966402b99af4", + }, + { + "when": "@2.21.0", + "url": "http://opendata.dwd.de/weather/lib/grib/eccodes_definitions.edzw-2.21.0-3.tar.bz2", + "sha256": "046f1f6450abb3b44c31dee6229f4aab06ca0d3576e27e93e05ccb7cd6e2d9d9", + }, + { + "when": "@2.22.1", + "url": "http://opendata.dwd.de/weather/lib/grib/eccodes_definitions.edzw-2.22.1-1.tar.bz2", + "sha256": "be73102a0dcabb236bacd2a70c7b5475f673fda91b49e34df61bef0fa5ad3389", + }, + { + "when": "@2.23.0", + "url": "http://opendata.dwd.de/weather/lib/grib/eccodes_definitions.edzw-2.23.0-4.tar.bz2", + "sha256": "c5db32861c7d23410aed466ffef3ca661410d252870a3949442d3ecb176aa338", + }, + ], + } +} + + +class Eccodes(CMakePackage): + """ecCodes is a package developed by ECMWF for processing meteorological + data in GRIB (1/2), BUFR (3/4) and GTS header formats.""" + + homepage = "https://software.ecmwf.int/wiki/display/ECC/ecCodes+Home" + url = "https://confluence.ecmwf.int/download/attachments/45757960/eccodes-2.2.0-Source.tar.gz?api=v2" + git = "https://github.com/ecmwf/eccodes.git" + list_url = "https://confluence.ecmwf.int/display/ECC/Releases" + + maintainers("skosukhin", "victoria-cherkas", "dominichofer", "climbfuji") + + license("Apache-2.0") + + version("develop", branch="develop") + version("2.36.4", + sha256="198ccb26e8df96544c668ea6853ea153535ab78b10c43339a678f271337aa0da", + url="https://github.com/ecmwf/eccodes/archive/refs/tags/2.36.4.tar.gz" + ) + version("2.34.0", sha256="3cd208c8ddad132789662cf8f67a9405514bfefcacac403c0d8c84507f303aba") + version("2.33.0", sha256="bdcec8ce63654ec6803400c507f01220a9aa403a45fa6b5bdff7fdcc44fd7daf") + version("2.32.1", sha256="ad2ac1bf36577b1d35c4a771b4d174a06f522a1e5ef6c1f5e53a795fb624863e") + version("2.32.0", sha256="b57e8eeb0eba0c05d66fda5527c4ffa84b5ab35c46bcbc9a2227142973ccb8e6") + version("2.31.0", sha256="808ecd2c11fbf2c3f9fc7a36f8c2965b343f3151011b58a1d6e7cc2e6b3cac5d") + version("2.25.0", sha256="8975131aac54d406e5457706fd4e6ba46a8cc9c7dd817a41f2aa64ce1193c04e") + version("2.24.2", sha256="c60ad0fd89e11918ace0d84c01489f21222b11d6cad3ff7495856a0add610403") + version("2.23.0", sha256="cbdc8532537e9682f1a93ddb03440416b66906a4cc25dec3cbd73940d194bf0c") + version("2.22.1", sha256="75c7ee96469bb30b0c8f7edbdc4429ece4415897969f75c36173545242bc9e85") + version("2.21.0", sha256="da0a0bf184bb436052e3eae582defafecdb7c08cdaab7216780476e49b509755") + version("2.20.0", sha256="207a3d7966e75d85920569b55a19824673e8cd0b50db4c4dac2d3d52eacd7985") + version("2.19.1", sha256="9964bed5058e873d514bd4920951122a95963128b12f55aa199d9afbafdd5d4b") + version("2.18.0", sha256="d88943df0f246843a1a062796edbf709ef911de7269648eef864be259e9704e3") + version("2.13.0", sha256="c5ce1183b5257929fc1f1c8496239e52650707cfab24f4e0e1f1a471135b8272") + version("2.5.0", sha256="18ab44bc444168fd324d07f7dea94f89e056f5c5cd973e818c8783f952702e4e") + version("2.2.0", sha256="1a4112196497b8421480e2a0a1164071221e467853486577c4f07627a702f4c3") + + # we are still using spack v0.21 v0.22, so comment these out for now + #depends_on("c", type="build") # generated + #depends_on("cxx", type="build") # generated + #depends_on("fortran", type="build") # generated + + variant("tools", default=False, description="Build the command line tools") + variant("netcdf", default=False, description="Enable GRIB to NetCDF conversion tool") + variant( + "jp2k", + default="openjpeg", + values=("openjpeg", "jasper", "none"), + description="Specify JPEG2000 decoding/encoding backend", + ) + variant("png", default=False, description="Enable PNG support for decoding/encoding") + variant( + "aec", default=True, description="Enable Adaptive Entropy Coding for decoding/encoding" + ) + variant("pthreads", default=False, description="Enable POSIX threads") + variant("openmp", default=False, description="Enable OpenMP threads") + variant( + "memfs", default=False, description="Enable memory based access to definitions/samples" + ) + variant("fortran", default=False, description="Enable the Fortran support") + variant("shared", default=True, description="Build shared versions of the libraries") + + variant( + "extra_definitions", + values=any_combination_of(*_definitions.keys()), + description="List of extra definitions to install", + ) + + depends_on("netcdf-c", when="+netcdf") + # Cannot be built with openjpeg@2.0.x. + depends_on("openjpeg@1.5.0:1.5,2.1.0:2.3", when="jp2k=openjpeg") + # Additional constraint for older versions. + depends_on("openjpeg@:2.1", when="@:2.16 jp2k=openjpeg") + + with when("jp2k=jasper"): + depends_on("jasper") + # jasper 3.x compat from commit 86f0b35f1a8492cb16f82fb976a0a5acd2986ac2 + depends_on("jasper@:2", when="@:2.25.0") + + depends_on("libpng", when="+png") + depends_on("libaec", when="+aec") + # Can be built with Python 2 or Python 3. + depends_on("python", when="+memfs", type="build") + + depends_on("cmake@3.6:", type="build") + depends_on("cmake@3.12:", when="@2.19:", type="build") + + # TODO: ecbuild was only used for the @develop branch + # however, testing 2.36.4, it appears to be a requirement. + # this might be because they package the software differently in GitHub + # (they normally provide releases as tar balls on Confluence) + depends_on("ecbuild", type="build") + #depends_on("ecbuild", type="build", when="@develop") + + conflicts("+openmp", when="+pthreads", msg="Cannot enable both POSIX threads and OMP") + + conflicts( + "+netcdf", + when="~tools", + msg="Cannot enable the NetCDF conversion tool " "when the command line tools are disabled", + ) + + conflicts( + "~tools", + when="@:2.18.0", + msg="The command line tools can be disabled " "only starting version 2.19.0", + ) + + for center, definitions in _definitions.items(): + kwargs = definitions.get("conflicts", None) + if kwargs: + conflicts("extra_definitions={0}".format(center), **kwargs) + for kwargs in definitions.get("resources", []): + resource( + name=center, + destination="spack-definitions", + placement="definitions.{0}".format(center), + **kwargs, + ) + + # Enforce linking against the specified JPEG2000 backend, see also + # https://github.com/ecmwf/eccodes/commit/2c10828495900ff3d80d1e570fe96c1df16d97fb + patch("openjpeg_jasper.patch", when="@:2.16") + + # CMAKE_INSTALL_RPATH must be a semicolon-separated list. + patch("cmake_install_rpath.patch", when="@:2.10") + + # Fix a bug preventing cmake from finding NetCDF: + patch( + "https://github.com/ecmwf/ecbuild/commit/3916c7d22575c45166fcc89edcbe02a6e9b81aa2.patch?full_index=1", + sha256="9dcc4affaaa850d4b7247baa939d0f9ffedea132369f1afc3f248dbf720386c9", + when="@:2.4.0+netcdf", + ) + + @when("%nag+fortran") + def patch(self): + # A number of Fortran source files assume that the kinds of integer and + # real variables are specified in bytes. However, the NAG compiler + # accepts such code only with an additional compiler flag -kind=byte. + # We do not simply add the flag because all user applications would + # have to be compiled with this flag too, which goes against one of the + # purposes of using the NAG compiler: make sure the code does not + # contradict the Fortran standards. The following logic could have been + # implemented as regular patch files, which would, however, be quite + # large. We would also have to introduce several versions of each patch + # file to support different versions of the package. + + patch_kind_files = [ + "fortran/eccodes_f90_head.f90", + "fortran/eccodes_f90_tail.f90", + "fortran/grib_f90_head.f90", + "fortran/grib_f90_tail.f90", + "fortran/grib_types.f90", + ] + + patch_unix_ext_files = [] + + if self.run_tests: + patch_kind_files.extend( + [ + "examples/F90/grib_print_data.f90", + "examples/F90/grib_print_data_static.f90", + # Files that need patching only when the extended regression + # tests are enabled, which we disable unconditionally: + # 'examples/F90/bufr_attributes.f90', + # 'examples/F90/bufr_expanded.f90', + # 'examples/F90/bufr_get_keys.f90', + # 'examples/F90/bufr_read_scatterometer.f90', + # 'examples/F90/bufr_read_synop.f90', + # 'examples/F90/bufr_read_temp.f90', + # 'examples/F90/bufr_read_tempf.f90', + # 'examples/F90/bufr_read_tropical_cyclone.f90', + # 'examples/F90/grib_clone.f90', + # 'examples/F90/grib_get_data.f90', + # 'examples/F90/grib_nearest.f90', + # 'examples/F90/grib_precision.f90', + # 'examples/F90/grib_read_from_file.f90', + # 'examples/F90/grib_samples.f90', + # 'examples/F90/grib_set_keys.f90' + ] + ) + + patch_unix_ext_files.extend( + [ + "examples/F90/bufr_ecc-1284.f90", + "examples/F90/grib_set_data.f90", + "examples/F90/grib_set_packing.f90", + # Files that need patching only when the extended regression + # tests are enabled, which we disable unconditionally: + # 'examples/F90/bufr_copy_data.f90', + # 'examples/F90/bufr_get_string_array.f90', + # 'examples/F90/bufr_keys_iterator.f90', + # 'examples/F90/get_product_kind.f90', + # 'examples/F90/grib_count_messages_multi.f90' + ] + ) + + kwargs = {"string": False, "backup": False, "ignore_absent": True} + + # Return the kind and not the size: + filter_file( + r"(^\s*kind_of_double\s*=\s*)(\d{1,2})(\s*$)", + "\\1kind(real\\2)\\3", + "fortran/grib_types.f90", + **kwargs, + ) + filter_file( + r"(^\s*kind_of_\w+\s*=\s*)(\d{1,2})(\s*$)", + "\\1kind(x\\2)\\3", + "fortran/grib_types.f90", + **kwargs, + ) + + # Replace integer kinds: + for size, r in [(2, 4), (4, 9), (8, 18)]: + filter_file( + r"(^\s*integer\((?:kind=)?){0}(\).*)".format(size), + "\\1selected_int_kind({0})\\2".format(r), + *patch_kind_files, + **kwargs, + ) + + # Replace real kinds: + for size, p, r in [(4, 6, 37), (8, 15, 307)]: + filter_file( + r"(^\s*real\((?:kind=)?){0}(\).*)".format(size), + "\\1selected_real_kind({0}, {1})\\2".format(p, r), + *patch_kind_files, + **kwargs, + ) + + # Enable getarg and exit subroutines: + filter_file( + r"(^\s*program\s+\w+)(\s*$)", + "\\1; use f90_unix_env; use f90_unix_proc\\2", + *patch_unix_ext_files, + **kwargs, + ) + + @property + def libs(self): + libraries = [] + + query_parameters = self.spec.last_query.extra_parameters + + if "shared" in query_parameters: + shared = True + elif "static" in query_parameters: + shared = False + else: + shared = "+shared" in self.spec + + # Return Fortran library if requested: + return_fortran = "fortran" in query_parameters + # Return C library if either requested or the Fortran library is not + # requested (to avoid overlinking) or the static libraries are + # requested: + return_c = "c" in query_parameters or not (return_fortran and shared) + # Return MEMFS library only if enabled and the static libraries are + # requested: + return_memfs = "+memfs" in self.spec and not shared + + if return_fortran: + libraries.append("libeccodes_f90") + + if return_c: + libraries.append("libeccodes") + + if return_memfs: + libraries.append("libeccodes_memfs") + + libs = find_libraries(libraries, root=self.prefix, shared=shared, recursive=True) + + if libs and len(libs) == len(libraries): + return libs + + msg = "Unable to recursively locate {0} {1} libraries in {2}" + raise spack.error.NoLibrariesError( + msg.format("shared" if shared else "static", self.spec.name, self.spec.prefix) + ) + + @run_before("cmake") + def check_fortran(self): + if "+fortran" in self.spec and self.compiler.fc is None: + raise InstallError("Fortran interface requires a Fortran compiler!") + + def cmake_args(self): + jp2k = self.spec.variants["jp2k"].value + + args = [ + self.define_from_variant("ENABLE_BUILD_TOOLS", "tools"), + self.define_from_variant("ENABLE_NETCDF", "netcdf"), + self.define("ENABLE_JPG", jp2k != "none"), + self.define("ENABLE_JPG_LIBJASPER", jp2k == "jasper"), + self.define("ENABLE_JPG_LIBOPENJPEG", jp2k == "openjpeg"), + self.define_from_variant("ENABLE_PNG", "png"), + self.define_from_variant("ENABLE_AEC", "aec"), + self.define_from_variant("ENABLE_ECCODES_THREADS", "pthreads"), + self.define_from_variant("ENABLE_ECCODES_OMP_THREADS", "openmp"), + self.define_from_variant("ENABLE_MEMFS", "memfs"), + self.define( + "ENABLE_PYTHON{0}".format("2" if self.spec.satisfies("@2.20.0:") else ""), False + ), + self.define_from_variant("ENABLE_FORTRAN", "fortran"), + self.define("BUILD_SHARED_LIBS", "BOTH" if "+shared" in self.spec else "OFF"), + self.define("ENABLE_TESTS", self.run_tests), + # Examples are not installed and are just part of the test suite: + self.define("ENABLE_EXAMPLES", self.run_tests), + # Unconditionally disable the extended regression tests, since they + # download additional data (~134MB): + self.define("ENABLE_EXTRA_TESTS", False), + ] + + if self.spec.satisfies("+netcdf"): + # Prevent possible overriding by environment variables NETCDF_ROOT, NETCDF_DIR, and + # NETCDF_PATH: + args.append(self.define("NETCDF_PATH", self.spec["netcdf-c"].prefix)) + # Prevent overriding by environment variable HDF5_ROOT (starting version 2.14.0, + # ecCodes is shipped with ecBuild 3.1.0+, which does not seem to rely on the HDF5_ROOT + # variable): + if self.spec.satisfies("@:2.13"): + args.append(self.define("HDF5_ROOT", self.spec["hdf5"].prefix)) + + if jp2k == "openjpeg": + args.append(self.define("OPENJPEG_PATH", self.spec["openjpeg"].prefix)) + + if self.spec.satisfies("+png"): + args.append(self.define("ZLIB_ROOT", self.spec["zlib-api"].prefix)) + + if self.spec.satisfies("+aec"): + # Prevent overriding by environment variables AEC_DIR and AEC_PATH: + args.append(self.define("AEC_DIR", self.spec["libaec"].prefix)) + + return args + + @run_after("install") + def install_extra_definitions(self): + for center in self.spec.variants["extra_definitions"].value: + if center != "none": + center_dir = "definitions.{0}".format(center) + install_tree( + join_path(self.stage.source_path, "spack-definitions", center_dir), + join_path(self.prefix.share.eccodes, center_dir), + ) + + def check(self): + # https://confluence.ecmwf.int/display/ECC/ecCodes+installation + with working_dir(self.build_directory): + ctest() diff --git a/recipes/icon-dsl/25.12/a100/repo/packages/eccodes/readme.md b/recipes/icon-dsl/25.12/a100/repo/packages/eccodes/readme.md new file mode 100644 index 00000000..9678342a --- /dev/null +++ b/recipes/icon-dsl/25.12/a100/repo/packages/eccodes/readme.md @@ -0,0 +1 @@ +copied from mainline spack November 5 2024 so that we can add eccodes 2.36.0 for mch production diff --git a/recipes/icon-dsl/25.12/a100/repo/packages/icon-exclaim/package.py b/recipes/icon-dsl/25.12/a100/repo/packages/icon-exclaim/package.py new file mode 100644 index 00000000..6bb3828f --- /dev/null +++ b/recipes/icon-dsl/25.12/a100/repo/packages/icon-exclaim/package.py @@ -0,0 +1,438 @@ +from spack.pkg.builtin.icon import Icon as SpackIcon +import os +import re +import glob +from collections import defaultdict +from llnl.util import tty +from spack.util.environment import is_system_path +import spack.error as error + +import shutil +import re +from collections import defaultdict + +def check_variant_fcgroup(fcgroup): + pattern = re.compile(r"^[A-Z]+\..+\..") + # fcgroup is False as default + if pattern.match(fcgroup) or fcgroup == 'none': + return True + else: + tty.warn('Variant fcgroup needs format GROUP.files.flag') + return False + + +def check_variant_extra_config_args(extra_config_arg): + pattern = re.compile(r'--(enable|disable)-\S+') + if pattern.match(extra_config_arg) or extra_config_arg == 'none': + return True + else: + tty.warn( + f'The value "{extra_config_arg}" for the extra_config_args variant must follow the format "--enable-arg" or "--disable-arg"' + ) + return False + + +class Icon(SpackIcon): + git = 'git@gitlab.dkrz.de:icon/icon-nwp.git' + + maintainers('jonasjucker', 'huppd') + + version('develop', submodules=True) + version("2024.10", + tag="icon-2024.10", + git='git@gitlab.dkrz.de:icon/icon.git', + submodules=True) + version("2024.01-1", + tag="icon-2024.01-1", + git='git@gitlab.dkrz.de:icon/icon.git', + submodules=True) + version('2.6.6-mch2b', tag='icon-nwp/icon-2.6.6-mch2b', submodules=True) + version('2.6.6-mch2a', tag='icon-nwp/icon-2.6.6-mch2a', submodules=True) + version('nwp-master', submodules=True) + + # The variants' default follow those of ICON + # as described here + # https://gitlab.dkrz.de/icon/icon/-/blob/icon-2024.01/configure?ref_type=tags#L1492-1638 + + # Model Features: + variant('dace', + default=False, + description='Enable the DACE modules for data assimilation') + requires("+mpi", when="+dace") + + variant('emvorado', + default=False, + description='Enable the radar forward operator EMVORADO') + requires("+mpi", when="+emvorado") + + variant('art-gpl', + default=False, + description='Enable GPL-licensed code parts of the ART component') + variant( + 'acm-license', + default=False, + description= + 'Enable code parts that require accepting the ACM Software License') + + # Infrastructural Features: + variant( + 'active-target-sync', + default=False, + description= + 'Enable MPI active target mode (otherwise, passive target mode is used)' + ) + variant('async-io-rma', + default=True, + description='Enable remote memory access (RMA) for async I/O') + variant('realloc-buf', + default=False, + description='Enable reallocatable communication buffer') + variant('sct', default=False, description='Enable the SCT timer') + variant( + 'extra-config-args', + default='none', + multi=True, + values=check_variant_extra_config_args, + description= + 'Inject any configure argument not yet available as variant\nUse this feature cautiously, as injecting non-variant configure arguments may potentially disrupt the build process' + ) + + # Optimization Features: + variant('loop-exchange', default=False, description='Enable loop exchange') + variant('vectorized-lrtm', + default=False, + description='Enable the parallelization-invariant version of LRTM') + variant( + 'pgi-inlib', + default=False, + description= + 'Enable PGI/NVIDIA cross-file function inlining via an inline library') + variant('nccl', default=False, description='Enable NCCL for communication') + + variant('cuda-graphs', default=False, description='Enable CUDA graphs.') + requires('%nvhpc@23.3:', when='+cuda-graphs') + + variant( + 'fcgroup', + default='none', + multi=True, + values=check_variant_fcgroup, + description= + 'Create a Fortran compile group: GROUP;files;flag \nNote: flag can only be one single value, i.e. -O1' + ) + + # verbosity + variant('silent-rules', + default=True, + description='Enable silent-rules for build-process') + variant( + 'eccodes-definitions', + default=False, + description= + 'Enable extension of eccodes with center specific definition files') + + depends_on('cosmo-eccodes-definitions', + type='run', + when='+eccodes-definitions') + + with when('+emvorado'): + depends_on('eccodes +fortran') + depends_on('hdf5 +szip +hl +fortran') + depends_on('zlib-ng') + # WORKAROUND: A build and link dependency should imply that the same compiler is used. This enforces it. + depends_on('eccodes %nvhpc', when='%nvhpc') + depends_on('eccodes %gcc', when='%gcc') + + # WORKAROUND: A build and link dependency should imply that the same compiler is used. This enforces it. + for __x in SpackIcon.serialization_values: + depends_on('serialbox+fortran %nvhpc', + when='serialization={0} %nvhpc'.format(__x)) + depends_on('serialbox+fortran %gcc', + when='serialization={0} %gcc'.format(__x)) + + # WORKAROUND: A build and link dependency should imply that the same compiler is used. This enforces it. + depends_on('netcdf-fortran %nvhpc', when='%nvhpc') + depends_on('netcdf-fortran %gcc', when='%gcc') + + depends_on('hdf5 +szip', when='+sct') + + # patch_libtool is a function from Autotoolspackage. + # For BB we cannot use it because it finds all files + # named "libtool". spack-c2sm is cloned into icon-repo, + # therefore this function detects not only "libtool" files, but + # also the folder where libtool package itself is installed. + patch_libtool = False + + def configure_args(self): + args = super().configure_args() + super_libs = args.pop() + + libs = LibraryList([]) + flags = defaultdict(list) + + for x in [ + 'dace', + 'emvorado', + 'art-gpl', + 'acm-license', + 'active-target-sync', + 'async-io-rma', + 'realloc-buf', + 'parallel-netcdf', + 'sct', + 'loop-exchange', + 'vectorized-lrtm', + 'pgi-inlib', + 'nccl', + 'cuda-graphs', + 'silent-rules', + ]: + args += self.enable_or_disable(x) + + if '+emvorado' in self.spec: + libs += self.spec['eccodes:fortran'].libs + libs += self.spec['hdf5:fortran,hl'].libs + libs += self.spec['zlib-ng'].libs + + if '+sct' in self.spec: + libs += self.spec['hdf5'].libs + + fcgroup = self.spec.variants['fcgroup'].value + # ('none',) is the values spack assign if fcgroup is not set + if fcgroup != ('none', ): + args.extend(self.fcgroup_to_config_arg()) + flags.update(self.fcgroup_to_config_var()) + + # add configure arguments not yet available as variant + extra_config_args = self.spec.variants['extra-config-args'].value + if extra_config_args != ('none', ): + for x in extra_config_args: + # prevent configure-args already available as variant + # to be set through variant extra_config_args + self.validate_extra_config_args(x) + args.append(x) + tty.warn( + 'You use variant extra-config-args. Injecting non-variant configure arguments may potentially disrupt the build process!' + ) + + # Help the libtool scripts of the bundled libraries find the correct + # paths to the external libraries. Specify the library search (-L) flags + # in the reversed order + # (see https://gitlab.dkrz.de/icon/icon#icon-dependencies): + # and for non-system directories only: + flags['LDFLAGS'].extend([ + '-L{0}'.format(d) for d in reversed(libs.directories) + if not is_system_path(d) + ]) + + # Temporary back port fix from upstream package for building comin on cpu + # See https://github.com/spack/spack-packages/commit/b992c44bb52d034fe57637f3da42483501442af3 + # TODO: Remove this dupplicate once spack-c2sm points to an upstream spack containing the fix. + if self.spec.variants[ + "gpu"].value in self.nvidia_targets or self.spec.satisfies( + "+comin"): + flags["ICON_LDFLAGS"].extend(self.compiler.stdcxx_libs) + + args.extend([ + "{0}={1}".format(name, " ".join(value)) + for name, value in flags.items() + ]) + args.append(f"{super_libs} {libs.link_flags}") + return args + + def fcgroup_to_config_arg(self): + arg = [] + for group in self.spec.variants['fcgroup'].value: + name = group.split('.')[0] + files = group.split('.')[1] + arg.append(f'--enable-fcgroup-{name}={files}') + return arg + + def fcgroup_to_config_var(self): + var = {} + for group in self.spec.variants['fcgroup'].value: + name = group.split('.')[0] + flag = group.split('.')[2] + # Note: flag needs to be a list + var[f'ICON_{name}_FCFLAGS'] = [flag] + return var + + def strip_variant_prefix(self, variant_string): + prefixes = ["--enable-", "--disable-"] + + for prefix in prefixes: + if variant_string.startswith(prefix): + return variant_string[len(prefix):] + + raise ValueError + + def validate_extra_config_args(self, arg): + variant_from_arg = self.strip_variant_prefix(arg) + if variant_from_arg in self.spec.variants: + raise error.SpecError( + f'The value "{arg}" for the extra_config_args variant conflicts ' + f'with the existing variant {variant_from_arg}. Set this variant instead.' + ) + + def configure(self, spec, prefix): + if os.path.exists( + os.path.join(self.build_directory, + 'icon.mk')) and self.build_uses_same_spec(): + tty.warn( + 'icon.mk already present -> skip configure stage', + '\t delete "icon.mk" or run "make distclean" to not skip configure' + ) + return + + # Call configure of Autotools + super().configure(spec, prefix) + + def build_uses_same_spec(self): + """ + Ensure that configure is rerun in case spec has changed, + otherwise for the case below + + $ spack dev-build icon @develop ~dace + $ spack dev-build icon @develop +dace + + configure is skipped for the latter. + """ + + is_same_spec = False + + previous_spec = os.path.join(self.build_directory, + '.previous_spec.yaml') + + # not the first build in self.build_directory + if os.path.exists(previous_spec): + with open(previous_spec, mode='r') as f: + if self.spec == Spec.from_yaml(f): + is_same_spec = True + else: + is_same_spec = False + tty.warn( + 'Cannot skip configure phase because spec changed') + + # first build in self.build_directory, no worries + else: + is_same_spec = True + + # dump spec of new build + with open(previous_spec, mode='w') as f: + f.write(self.spec.to_yaml()) + + return is_same_spec + + @run_after('configure') + def copy_runscript_related_input_files(self): + with working_dir(self.build_directory): + icon_dir = self.configure_directory + # only synchronize if out-of-source build + if os.path.abspath(icon_dir) != os.path.abspath( + self.build_directory): + Rsync = which('rsync', required=True) + Rsync("-uavz", f"{icon_dir}/run", ".", "--exclude=*.in", + "--exclude=.*", "--exclude=standard_*") + Rsync("-uavz", f"{icon_dir}/externals", ".", "--exclude=.git", + "--exclude=*.f90", "--exclude=*.F90", "--exclude=*.c", + "--exclude=*.h", "--exclude=*.Po", "--exclude=tests", + "--exclude=*.mod", "--exclude=*.o") + Rsync("-uavz", f"{icon_dir}/make_runscripts", ".") + + Ln = which('ln', required=True) + dirs = glob.glob(f"{icon_dir}/run/standard_*") + for dir in dirs: + Ln("-sf", "-t", "run/", f"{dir}") + Ln("-sf", f"{icon_dir}/data") + Ln("-sf", f"{icon_dir}/vertical_coord_tables") + Ln("-sf", f"{icon_dir}/scripts") + + + +def validate_variant_dsl(pkg, name, value): + set_mutual_excl = set(['substitute', 'verify', 'serialize']) + set_input_var = set(value) + if len(set_mutual_excl.intersection(set_input_var)) > 1: + raise error.SpecError( + 'Cannot have more than one of (substitute, verify, serialize) in the same build' + ) + + +class IconExclaim(Icon): + git = 'git@github.com:C2SM/icon-exclaim.git' + + maintainers('jonasjucker', 'huppd') + + version('develop', branch='icon-dsl', submodules=True) + version("0.3.0", + commit="a0be2c3e0448ec2dc92024e3b38ec635435ac0dd", + submodules=True) + + # EXCLAIM-GT4Py specific features: + dsl_values = ('substitute', 'verify') + variant('dsl', + default='none', + validator=validate_variant_dsl, + values=('none', ) + dsl_values, + description='Build with GT4Py dynamical core', + multi=True) + + for x in dsl_values: + depends_on('icon4py', type="build", when=f"dsl={x}") + + + # TODO: Should this be set here or in the icon4py package? + def setup_build_environment(self, env): + if self.spec.variants['dsl'].value != ('none', ): + # TODO: clean up + print(f"adding {self.spec['icon4py'].prefix.share.venv.bin} to PATH for icon4py bindings because +dsl is enabled") + env.prepend_path("PATH", self.spec["icon4py"].prefix.share.venv.bin) + env.append_path("PATH", self.spec["icon4py"].prefix.share.venv.bin) + + + def configure_args(self): + raw_args = super().configure_args() + + # Split into categories + args_flags = [] + icon_ldflags = [] + ldflags = [] + libs = [] + + for a in raw_args: + if a.startswith("LIBS="): + libs.append(a.split("=", 1)[1].strip()) + elif a.startswith("ICON_LDFLAGS="): + icon_ldflags.append(a.split("=", 1)[1].strip()) + elif a.startswith("LDFLAGS="): + ldflags.append(a.split("=", 1)[1].strip()) + else: + args_flags.append(a) + + # Handle DSL variants + dsl = self.spec.variants['dsl'].value + if dsl != ('none', ): + if 'substitute' in dsl: + args_flags.append('--enable-icon4py=substitute') + elif 'verify' in dsl: + args_flags.append('--enable-icon4py=verify') + else: + raise ValueError( + f"Unknown DSL variant '{dsl}'. " + f"Valid options are: {', '.join(('none',) + dsl_values)}") + + # Remove duplicates + icon_ldflags = list(dict.fromkeys(icon_ldflags)) + ldflags = list(dict.fromkeys(ldflags)) + libs = list(dict.fromkeys(libs)) + + # Reconstruct final configure args + final_args = args_flags + if icon_ldflags: + final_args.append("ICON_LDFLAGS=" + " ".join(icon_ldflags)) + if ldflags: + final_args.append("LDFLAGS=" + " ".join(ldflags)) + if libs: + final_args.append("LIBS=" + " ".join(libs)) + + return final_args diff --git a/recipes/icon-dsl/25.12/a100/repo/packages/py-cupy/package.py b/recipes/icon-dsl/25.12/a100/repo/packages/py-cupy/package.py new file mode 100644 index 00000000..c7f06e0c --- /dev/null +++ b/recipes/icon-dsl/25.12/a100/repo/packages/py-cupy/package.py @@ -0,0 +1,137 @@ +# Copyright Spack Project Developers. See COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +import os + +from spack.package import * + + +class PyCupy(PythonPackage, CudaPackage, ROCmPackage): + """CuPy is an open-source array library accelerated with + NVIDIA CUDA. CuPy provides GPU accelerated computing with + Python. CuPy uses CUDA-related libraries including cuBLAS, + cuRand, cuSolver, cuSPARSE, cuFFT and NCCL to make + full use of the GPU architecture. + + This version does not use CudNN.""" + + homepage = "https://cupy.dev/" + pypi = "cupy/cupy-8.0.0.tar.gz" + version("13.5.1", sha256="3dba2f30258463482d52deb420862fbbbaf2c446165a5e8d67377ac6cb5c0870") + version("13.4.0", sha256="d4b60e5a1d3b89be40fad0845bb9fc467a653abe8660f752416fd38d24ab7fdb") + version("13.3.0", sha256="9a2a17af2b99cce91dd1366939c3805e3f51f9de5046df64f29ccbad3bdf78ed") + version("13.2.0", sha256="e4dbd2b2ed4159a5cc0c0f98a710a014950eb2c16eeb455e956128f3b3bd0d51") + version("13.1.0", sha256="5caf62288481a27713384523623045380ff42e618be4245f478238ed1786f32d") + version("12.1.0", sha256="f6d31989cdb2d96581da12822e28b102f29e254427195c2017eac327869b7320") + version("12.0.0", sha256="61ddbbef73d50d606bd5087570645f3c91ec9176c2566784c1d486d6a3404545") + version("11.6.0", sha256="53dbb840072bb32d4bfbaa6bfa072365a30c98b1fcd1f43e48969071ad98f1a7") + version("11.5.0", sha256="4bc8565bded22cc89b210fd9fb48a5d5316f30701e12bb23852a60314e1f9f6e") + version("11.4.0", sha256="03d52b2626e02a3a2b46d714c1cd03e702c8fe33915fcca6ed8de5c539964f49") + version("11.3.0", sha256="d057cc2f73ecca06fae8b9c270d9e14116203abfd211a704810cc50a453b4c9e") + version("11.2.0", sha256="c33361f117a347a63f6996ea97446d17f1c038f1a1f533e502464235076923e2") + + + variant( + "all", default=False, description="Enable optional py-scipy, optuna, and cython" + ) + + depends_on("cxx", type="build") # generated + + depends_on("python@3.7:", when="@:11", type=("build", "run")) + depends_on("python@3.8:3.11", when="@12", type=("build", "run")) + depends_on("python@3.9:3.13", when="@13", type=("build", "run")) + depends_on("python@3.10:", when="@14", type=("build", "run")) + depends_on("py-setuptools", type="build") + depends_on("py-setuptools@:73", when="@:13.3", type="build") + depends_on("py-cython@0.29.22:0.29", type="build", when="@:13.3") + depends_on( + "py-cython@3:3.0.10,3.0.12:", type="build", when="@13.4:" + ) # 3.0.11 broken likely because of cython#6335, fixed in 3.0.12 + depends_on("py-cython@0.29.22:0.29", when="@:13.3 +all", type=("build", "run")) + depends_on("py-cython@3:", when="@13.4: +all", type=("build", "run")) + depends_on("py-fastrlock@0.5:", type=("build", "run")) + depends_on("py-numpy@1.20:1.25", when="@:11", type=("build", "run")) + depends_on("py-numpy@1.20:1.26", when="@12", type=("build", "run")) + depends_on("py-numpy@1.22:1", when="@13.1", type=("build", "run")) + depends_on("py-numpy@1.22:2.0", when="@13.2", type=("build", "run")) + depends_on("py-numpy@1.22:2.2", when="@13.4", type=("build", "run")) + depends_on("py-numpy@1.22:2.3", when="@13.5", type=("build", "run")) + depends_on("py-numpy@1.24:2", when="@14", type=("build", "run")) + depends_on("py-scipy@1.6:1.11", when="@:12+all", type=("build", "run")) + depends_on("py-scipy@1.7:1.16", when="@13+all", type=("build", "run")) + depends_on("py-scipy@1.10:1.16", when="@14+all", type=("build", "run")) + depends_on("py-optuna@2:", when="+all", type=("build", "run")) + depends_on("py-optuna@3:", when="@12:+all", type=("build", "run")) + + # Based on https://github.com/cupy/cupy/releases + depends_on("cuda@:11.9", when="@:11 +cuda") + depends_on("cuda@:12.1", when="@12:12.1.0 +cuda") + depends_on("cuda@:12.1", when="@13.0 +cuda") + depends_on("cuda@:12.4", when="@13.1:13.2 +cuda") + depends_on("cuda@:12.6", when="@13.3 +cuda") + depends_on("cuda@:12.8", when="@13.4 +cuda") + depends_on("cuda@:12.9", when="@13.5 +cuda") + + for a in CudaPackage.cuda_arch_values: + depends_on("nccl +cuda cuda_arch={0}".format(a), when="+cuda cuda_arch={0}".format(a)) + depends_on( + "nccl@2.16:2.26 +cuda cuda_arch={0}".format(a), when="@13+cuda cuda_arch={0}".format(a) + ) + + depends_on("cutensor", when="@:12.1.0 +cuda") + depends_on("cutensor@2.0", when="@13.1: +cuda") + + for _arch in ROCmPackage.amdgpu_targets: + arch_str = "amdgpu_target={0}".format(_arch) + rocm_str = "+rocm {0}".format(arch_str) + depends_on("rocprim {0}".format(arch_str), when=rocm_str, type=("link")) + depends_on("rocsolver {0}".format(arch_str), when=rocm_str, type=("link")) + depends_on("rocthrust {0}".format(arch_str), when=rocm_str, type=("link")) + depends_on("rocrand {0}".format(arch_str), when=rocm_str, type=("link")) + depends_on("hipcub {0}".format(rocm_str), when=rocm_str, type=("link")) + depends_on("hipblas {0}".format(rocm_str), when=rocm_str, type=("link")) + depends_on("hiprand {0}".format(rocm_str), when=rocm_str, type=("link")) + depends_on("hipsparse {0}".format(rocm_str), when=rocm_str, type=("link")) + depends_on("hipfft {0}".format(rocm_str), when=rocm_str, type=("link")) + + depends_on("rccl", when="+rocm", type=("link")) + depends_on("roctracer-dev", when="+rocm", type=("link")) + depends_on("rocprofiler-dev", when="+rocm", type=("link")) + + conflicts("~cuda ~rocm") + conflicts("+cuda +rocm") + conflicts("+cuda cuda_arch=none") + + def setup_build_environment(self, env): + env.set("CUPY_NUM_BUILD_JOBS", make_jobs) + if self.spec.satisfies("+cuda"): + cuda_arch = self.spec.variants["cuda_arch"].value + arch_str = ";".join( + "arch=compute_{0},code=sm_{0}".format(i) for i in cuda_arch + ) + env.set("CUPY_NVCC_GENERATE_CODE", arch_str) + elif self.spec.satisfies("+rocm"): + spec = self.spec + + incs = { + "roctracer-dev": ["include/roctracer"], + "hiprand": ["include"], + "rocrand": ["include"], + "rocthrust": ["include"], + "rocprim": ["include"], + "hip": ["include", "include/hip"], + } + + inc_dirs = [] + for pkg, ds in incs.items(): + for d in ds: + p = os.path.join(spec[pkg].prefix, d) + if os.path.exists(p): + inc_dirs.append(p) + + env.set("CUPY_INCLUDE_PATH", ":".join(inc_dirs)) + + env.set("HIPCC", self.spec["hip"].hipcc) + env.set("ROCM_HOME", self.spec["hipcub"].prefix) + env.set("CUPY_INSTALL_USE_HIP", 1) From 8dc0fbc9906fd5ea1c9136243353e36a04d334e4 Mon Sep 17 00:00:00 2001 From: Mikael Simberg Date: Fri, 27 Mar 2026 17:14:14 +0100 Subject: [PATCH 28/32] Update pre-install for icon-dsl/25.12/a100 --- recipes/icon-dsl/25.12/a100/pre-install | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/recipes/icon-dsl/25.12/a100/pre-install b/recipes/icon-dsl/25.12/a100/pre-install index cc24e1f8..c6a72771 100644 --- a/recipes/icon-dsl/25.12/a100/pre-install +++ b/recipes/icon-dsl/25.12/a100/pre-install @@ -11,10 +11,18 @@ packages=( "oomph" "uv" "icon4py" - # "icon" + "libfabric" + "nccl" + "libcxi" + "cxi-driver" + "cassini-headers" + "aws-ofi-nccl" + "gdrcopy" + "gettext" + "libfuse" # "icon-exclaim" ) -SPACK_C2SM_TAG="v0.22.2.6" +SPACK_C2SM_TAG="sc-nccl" echo "----------------------------------------" echo "SPACK C2SM Setup Script" From fc007a24ccc73b4abf8cd1df343c625c3bdfe641 Mon Sep 17 00:00:00 2001 From: Mikael Simberg Date: Wed, 15 Apr 2026 13:49:09 +0200 Subject: [PATCH 29/32] Bring in backported network stack --- ci/ci.yml | 3 ++- recipes/icon-dsl/25.12/a100/environments.yaml | 12 ++++++++++-- recipes/icon-dsl/25.12/gh200/environments.yaml | 12 ++++++++++-- recipes/icon-dsl/25.12/gh200/pre-install | 11 ++++++++++- .../gh200/repo/packages/icon-exclaim/package.py | 7 +++++++ .../25.12/gh200/repo/packages/py-cupy/package.py | 6 +++--- 6 files changed, 42 insertions(+), 9 deletions(-) diff --git a/ci/ci.yml b/ci/ci.yml index 7fbe0d46..4a2c4f4b 100644 --- a/ci/ci.yml +++ b/ci/ci.yml @@ -7,7 +7,8 @@ pipeline-configure: tags: [languard-k8s-lightweight] image: docker.io/python:latest script: - - git clone https://github.com/eth-cscs/uenv-pipeline.git + - git clone https://github.com/msimberg/uenv-pipeline.git + - git -C ./uenv-pipeline checkout v5-libfabric-buildable - ./uenv-pipeline/configure-pipeline -c./config.yaml -r./recipes -s$system -u$uenv -a$uarch -o./pipeline.yml artifacts: paths: diff --git a/recipes/icon-dsl/25.12/a100/environments.yaml b/recipes/icon-dsl/25.12/a100/environments.yaml index da286701..e958d078 100644 --- a/recipes/icon-dsl/25.12/a100/environments.yaml +++ b/recipes/icon-dsl/25.12/a100/environments.yaml @@ -5,10 +5,14 @@ icon: - toolchain: llvm spec: nvhpc mpi: - spec: cray-mpich@8.1.30%nvhpc + spec: cray-mpich@8.1.32%nvhpc gpu: cuda specs: # icon4py deps + - libfabric@2.4.0 +cuda +gdrcopy fabrics=cxi,rxm,tcp + - libcxi@13.0.0 + - cxi-driver@13.0.0 + - cassini-headers@13.0.0 - python@3.11 - py-cupy@13.3 +cuda cuda_arch=80 - ghex @@ -60,10 +64,14 @@ icon-verify: - toolchain: llvm spec: nvhpc mpi: - spec: cray-mpich@8.1.30%nvhpc + spec: cray-mpich@8.1.32%nvhpc gpu: cuda specs: # icon4py deps + - libfabric@2.4.0 +cuda +gdrcopy fabrics=cxi,rxm,tcp + - libcxi@13.0.0 + - cxi-driver@13.0.0 + - cassini-headers@13.0.0 - python@3.11 - py-cupy@13.3 +cuda cuda_arch=80 - ghex diff --git a/recipes/icon-dsl/25.12/gh200/environments.yaml b/recipes/icon-dsl/25.12/gh200/environments.yaml index aa42109d..9ec7019d 100644 --- a/recipes/icon-dsl/25.12/gh200/environments.yaml +++ b/recipes/icon-dsl/25.12/gh200/environments.yaml @@ -5,10 +5,14 @@ icon: - toolchain: llvm spec: nvhpc mpi: - spec: cray-mpich@8.1.30%nvhpc + spec: cray-mpich@8.1.32%nvhpc gpu: cuda specs: # icon4py deps + - libfabric@2.4.0 +cuda +gdrcopy fabrics=cxi,rxm,tcp + - libcxi@13.0.0 + - cxi-driver@13.0.0 + - cassini-headers@13.0.0 - python@3.11 - py-cupy@13.3 +cuda cuda_arch=90 - ghex @@ -60,10 +64,14 @@ icon-verify: - toolchain: llvm spec: nvhpc mpi: - spec: cray-mpich@8.1.30%nvhpc + spec: cray-mpich@8.1.32%nvhpc gpu: cuda specs: # icon4py deps + - libfabric@2.4.0 +cuda +gdrcopy fabrics=cxi,rxm,tcp + - libcxi@13.0.0 + - cxi-driver@13.0.0 + - cassini-headers@13.0.0 - python@3.11 - py-cupy@13.3 +cuda cuda_arch=90 - ghex diff --git a/recipes/icon-dsl/25.12/gh200/pre-install b/recipes/icon-dsl/25.12/gh200/pre-install index c4b7cd53..c6a72771 100644 --- a/recipes/icon-dsl/25.12/gh200/pre-install +++ b/recipes/icon-dsl/25.12/gh200/pre-install @@ -11,9 +11,18 @@ packages=( "oomph" "uv" "icon4py" + "libfabric" + "nccl" + "libcxi" + "cxi-driver" + "cassini-headers" + "aws-ofi-nccl" + "gdrcopy" + "gettext" + "libfuse" # "icon-exclaim" ) -SPACK_C2SM_TAG="tmp_wait_for_compilation" +SPACK_C2SM_TAG="sc-nccl" echo "----------------------------------------" echo "SPACK C2SM Setup Script" diff --git a/recipes/icon-dsl/25.12/gh200/repo/packages/icon-exclaim/package.py b/recipes/icon-dsl/25.12/gh200/repo/packages/icon-exclaim/package.py index 6bb3828f..08e6636b 100644 --- a/recipes/icon-dsl/25.12/gh200/repo/packages/icon-exclaim/package.py +++ b/recipes/icon-dsl/25.12/gh200/repo/packages/icon-exclaim/package.py @@ -108,10 +108,13 @@ class Icon(SpackIcon): description= 'Enable PGI/NVIDIA cross-file function inlining via an inline library') variant('nccl', default=False, description='Enable NCCL for communication') + depends_on('nccl', when='+nccl') variant('cuda-graphs', default=False, description='Enable CUDA graphs.') requires('%nvhpc@23.3:', when='+cuda-graphs') + variant('cuda-mempool', default=False, description='Enable CUDA memory pool.') + variant( 'fcgroup', default='none', @@ -238,6 +241,10 @@ def configure_args(self): for name, value in flags.items() ]) args.append(f"{super_libs} {libs.link_flags}") + + if self.spec.satisfies("+cuda-mempool"): + args.append("ICON_FCFLAGS=-cuda") + return args def fcgroup_to_config_arg(self): diff --git a/recipes/icon-dsl/25.12/gh200/repo/packages/py-cupy/package.py b/recipes/icon-dsl/25.12/gh200/repo/packages/py-cupy/package.py index c7f06e0c..93b86492 100644 --- a/recipes/icon-dsl/25.12/gh200/repo/packages/py-cupy/package.py +++ b/recipes/icon-dsl/25.12/gh200/repo/packages/py-cupy/package.py @@ -75,9 +75,9 @@ class PyCupy(PythonPackage, CudaPackage, ROCmPackage): for a in CudaPackage.cuda_arch_values: depends_on("nccl +cuda cuda_arch={0}".format(a), when="+cuda cuda_arch={0}".format(a)) - depends_on( - "nccl@2.16:2.26 +cuda cuda_arch={0}".format(a), when="@13+cuda cuda_arch={0}".format(a) - ) + # depends_on( + # "nccl@2.16:2.26 +cuda cuda_arch={0}".format(a), when="@13+cuda cuda_arch={0}".format(a) + # ) depends_on("cutensor", when="@:12.1.0 +cuda") depends_on("cutensor@2.0", when="@13.1: +cuda") From e2659977c566a68d32336b9e3740579ff0a5c5d2 Mon Sep 17 00:00:00 2001 From: Mikael Simberg Date: Wed, 15 Apr 2026 13:51:41 +0200 Subject: [PATCH 30/32] Use cuda-mempool variant --- recipes/icon-dsl/25.12/gh200/environments.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/recipes/icon-dsl/25.12/gh200/environments.yaml b/recipes/icon-dsl/25.12/gh200/environments.yaml index 9ec7019d..df254741 100644 --- a/recipes/icon-dsl/25.12/gh200/environments.yaml +++ b/recipes/icon-dsl/25.12/gh200/environments.yaml @@ -21,9 +21,9 @@ icon: - boost +thread - py-mpi4py - icon4py@0.1.0 - - icon-exclaim@0.3.0 %nvhpc dsl=substitute +grib2 +eccodes-definitions +ecrad + - icon-exclaim@git.431778e44a9283107d94282a6735cf1fd8e616dd=0.3.0 %nvhpc dsl=substitute +grib2 +eccodes-definitions +ecrad ~emvorado +art +dace gpu=nvidia-90 +mpi-gpu +realloc-buf ~aes ~jsbach ~ocean ~coupling - ~rte-rrtmgp ~loop-exchange ~async-io-rma ~cuda-graphs fflags="-traceback" + ~rte-rrtmgp ~loop-exchange ~async-io-rma ~cuda-graphs fflags="-traceback" +cuda-mempool # icon deps - cuda@12.6:12 - eccodes@2.36.4%nvhpc +tools +fortran +aec +openmp jp2k=jasper @@ -80,9 +80,9 @@ icon-verify: - boost +thread - py-mpi4py - icon4py@0.1.0 - - icon-exclaim@0.3.0 %nvhpc dsl=verify +grib2 +eccodes-definitions +ecrad + - icon-exclaim@git.431778e44a9283107d94282a6735cf1fd8e616dd=0.3.0 %nvhpc dsl=verify +grib2 +eccodes-definitions +ecrad ~emvorado +art +dace gpu=nvidia-90 +mpi-gpu +realloc-buf ~aes ~jsbach ~ocean ~coupling - ~rte-rrtmgp ~loop-exchange ~async-io-rma ~cuda-graphs fflags="-traceback" + ~rte-rrtmgp ~loop-exchange ~async-io-rma ~cuda-graphs fflags="-traceback" +cuda-mempool # icon deps - cuda@12.6:12 - eccodes@2.36.4%nvhpc +tools +fortran +aec +openmp jp2k=jasper From 2ad68e11e54aa745642fe2f4708c8c1e39c9d4b4 Mon Sep 17 00:00:00 2001 From: Mikael Simberg Date: Wed, 15 Apr 2026 13:53:02 +0200 Subject: [PATCH 31/32] Update cray-mpich --- recipes/icon-dsl/25.12/gh200/environments.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/recipes/icon-dsl/25.12/gh200/environments.yaml b/recipes/icon-dsl/25.12/gh200/environments.yaml index df254741..d9a695e8 100644 --- a/recipes/icon-dsl/25.12/gh200/environments.yaml +++ b/recipes/icon-dsl/25.12/gh200/environments.yaml @@ -5,7 +5,7 @@ icon: - toolchain: llvm spec: nvhpc mpi: - spec: cray-mpich@8.1.32%nvhpc + spec: cray-mpich@9.0.0%nvhpc gpu: cuda specs: # icon4py deps @@ -64,7 +64,7 @@ icon-verify: - toolchain: llvm spec: nvhpc mpi: - spec: cray-mpich@8.1.32%nvhpc + spec: cray-mpich@9.0.0%nvhpc gpu: cuda specs: # icon4py deps From 198bda93a180bfbe38fd5bff46f54349c8030edd Mon Sep 17 00:00:00 2001 From: Mikael Simberg Date: Wed, 27 May 2026 11:23:56 +0200 Subject: [PATCH 32/32] Use cxi packages that match SHS on system --- recipes/icon-dsl/25.12/gh200/environments.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/recipes/icon-dsl/25.12/gh200/environments.yaml b/recipes/icon-dsl/25.12/gh200/environments.yaml index d9a695e8..96cab840 100644 --- a/recipes/icon-dsl/25.12/gh200/environments.yaml +++ b/recipes/icon-dsl/25.12/gh200/environments.yaml @@ -10,9 +10,9 @@ icon: specs: # icon4py deps - libfabric@2.4.0 +cuda +gdrcopy fabrics=cxi,rxm,tcp - - libcxi@13.0.0 - - cxi-driver@13.0.0 - - cassini-headers@13.0.0 + - libcxi@12.0.2 + - cxi-driver@12.0.2 + - cassini-headers@12.0.2 - python@3.11 - py-cupy@13.3 +cuda cuda_arch=90 - ghex @@ -69,9 +69,9 @@ icon-verify: specs: # icon4py deps - libfabric@2.4.0 +cuda +gdrcopy fabrics=cxi,rxm,tcp - - libcxi@13.0.0 - - cxi-driver@13.0.0 - - cassini-headers@13.0.0 + - libcxi@12.0.2 + - cxi-driver@12.0.2 + - cassini-headers@12.0.2 - python@3.11 - py-cupy@13.3 +cuda cuda_arch=90 - ghex