Skip to content

Add ICON easyblock - #4206

Open
JarneRenders wants to merge 3 commits into
easybuilders:developfrom
JarneRenders:develop
Open

Add ICON easyblock#4206
JarneRenders wants to merge 3 commits into
easybuilders:developfrom
JarneRenders:develop

Conversation

@JarneRenders

@JarneRenders JarneRenders commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Move the configopts for ICON into an easyblock. In particular this is necessary for nicely including the CUDAFLAGS:

-gencode arch=compute_XX code=sm_XX

for each cuda compute capability. See easybuilders/easybuild-easyconfigs#26615.

Claude (Sonnet 5) was used to write and iterate on this easyblock under my direction and review; I verified claims against ICON's own configure.ac/autoconf macros and NVIDIA's nvcc documentation and ran all three (NVHPC/foss/intel) builds to completion to confirm correctness.

Comment thread easybuild/easyblocks/i/icon.py Outdated
Comment thread easybuild/easyblocks/i/icon.py Outdated
Comment on lines +20 to +33
if comp_fam in (toolchain.GCC, toolchain.INTELCOMP):
# LIBS is identical for foss and intel (no CUDA libraries, both need
# -Wl,--disable-new-dtags); NVHPC sets its own LIBS below.
self.cfg.update('configopts', (
'LIBS="'
' -Wl,--disable-new-dtags -Wl,--as-needed'
' -lxml2'
' -lfyaml'
' -leccodes_f90 -leccodes'
' $LIBLAPACK'
' -lnetcdff -lnetcdf'
' -lstdc++'
'"'
))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this can be confusing for people touching the EB after.
Here i would do something like

gcc_libs = ...
intel_libs = gcc_libs
nvhpc_libs = ...

and then do a self.cfg.update in the respective if blocks so that we have only one if/elseif/else chahin

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also since we are writing an EB we can also add checks so that the required dependencies for the libraries specified here are actually loaded

More generically we should bring all the options that are now in the EC here and enable them when the appropriate dependency or toolchain + toolchain options are set

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved all configopts to the easyblock. Checking the necessary dependencies are present for the libraries. Also checking now for dependencies which would replace the installation via git submodules (one slightly strange thing here is that I had to infer the names of such a dependency even though no easyconfigs for those exist yet.) Is this what you had in mind?

nvcc_gencode = ' '.join(
f'-gencode arch=compute_{cc},code=sm_{cc}' for cc in cuda_ccs.split(',')
)
self.cfg.update('configopts', f'CUDAFLAGS="-ccbin=$CXX -O3 {nvcc_gencode}"')

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here and also for the other places i think we should try to respect the optimization flags passed by the TChain

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Passed them in the other places, but not here as I am not sure we have appropriate CUDAFLAGS for nvcc anywhere in easybuild. (CFLAGS is only compatible with nvc and not with nvcc.)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do in https://github.com/easybuilders/easybuild-framework/blob/develop/easybuild/toolchains/compiler/cuda.py, but we might need to initialize a separate TC inside the EB to extract this info, i am wondering if this should not somehow be part of the nvidia-compilers TC as well

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that makes more sense to me to add it to nvidia-compilers.

Comment thread easybuild/easyblocks/i/icon.py
@Crivella Crivella added the AI-assisted AI-assisted contributions label Aug 17, 2026
@boegel boegel added the new label Aug 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI-assisted AI-assisted contributions new

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants