Skip to content

yambo: improve Yambo recipe and add new DeviceXlib recipe both with GPU support#4923

Draft
nicspalla wants to merge 9 commits into
spack:developfrom
nicspalla:develop
Draft

yambo: improve Yambo recipe and add new DeviceXlib recipe both with GPU support#4923
nicspalla wants to merge 9 commits into
spack:developfrom
nicspalla:develop

Conversation

@nicspalla
Copy link
Copy Markdown

Summary

This PR significantly extends and modernizes the Spack recipes for Yambo and add the recipe for DeviceXlib, improving GPU support, compiler compatibility, dependency handling, and portability across HPC systems.

Main developments

GPU accelerated compilation with CUDA-Fortran

Added support for GPU-enabled Yambo builds using CUDA-Fortran:

  • CUDA-related variants and dependency handling,
  • CUDA architecture selection,
  • CUDA runtime selection for NVHPC builds,
  • compiler and version conflict checks,
  • compatibility patches for CUDA runtime detection.

DeviceXlib integration

Added DeviceXlib as a dependency of Yambo.

DeviceXlib is a library developed by the Yambo team that provides wrappers for accelerator-oriented routines and abstracts device-specific operations.

The recipe now supports both CPU-only and GPU-enabled configurations with automatic DeviceXlib integration.

Compiler and HPC library support

Improved support for:

  • GCC,
  • NVHPC,
  • Intel classic compilers,
  • Intel oneAPI compilers.

Added optional support for:

  • ScaLAPACK,
  • PETSc,
  • SLEPc,
  • OpenMP-enabled numerical libraries,
  • parallel HDF5 I/O.

Additional improvements

  • added variants for optional Yambo projects (ph, rt, sc, nl),
  • improved dependency version handling,
  • added configure-time and linking fixes,
  • improved sanity checks and build compatibility,
  • extended support for multiple Yambo versions and HPC environments.

* add CUDA-Fortran support for GPU-accelerated Yambo builds
* add DeviceXlib dependency and integration
* extend compiler support (NVHPC, GCC, Intel, oneAPI)
* add optional ScaLAPACK, PETSc, and SLEPc support
* improve MPI/OpenMP and parallel I/O handling
* add variants for optional Yambo projects (ph, rt, sc, nl)
* improve dependency management, patches, and build compatibility across HPC systems
@spackbot-triage spackbot-triage Bot requested a review from LydDeb May 21, 2026 11:37
@nicspalla nicspalla changed the title Improve Yambo and DeviceXlib Spack recipes with GPU support yambo: improve Yambo recipe and add new DeviceXlib recipe both with GPU support May 21, 2026
@alalazo alalazo self-assigned this May 22, 2026
@alalazo
Copy link
Copy Markdown
Member

alalazo commented May 27, 2026

@spackbot fix style

@spackbot-app
Copy link
Copy Markdown

spackbot-app Bot commented May 27, 2026

Let me see if I can fix that for you!

@spackbot-app
Copy link
Copy Markdown

spackbot-app Bot commented May 27, 2026

I was able to run spack style --fix for you!

spack style --fix
repos/spack_repo/builtin/packages/devicexlib/package.py
repos/spack_repo/builtin/packages/yambo/package.py
�[1;34m==> �[0mrunning ruff format
2 files reformatted
�[1;34m==> �[0mrunning ruff check
Found 2 errors (2 fixed, 0 remaining).
�[1;34m==> �[0mstyle checks passed
Keep in mind that I cannot fix your flake8 or mypy errors, so if you have any you'll need to fix them and update the pull request. If I was able to push to your branch, if you make further changes you will need to pull from your updated branch before pushing again.

I've updated the branch with style fixes.

Copy link
Copy Markdown
Member

@alalazo alalazo left a comment

Choose a reason for hiding this comment

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

Started reviewing. I have a first batch of comments. Let me know if anything is unclear.

Comment thread repos/spack_repo/builtin/packages/devicexlib/package.py Outdated
Comment thread repos/spack_repo/builtin/packages/yambo/package.py Outdated
Comment thread repos/spack_repo/builtin/packages/yambo/package.py
Comment thread repos/spack_repo/builtin/packages/devicexlib/package.py Outdated
with when("+cuda"):
variant(
"cuda_rt",
values=str,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Hmm, a generic string seems a bit too broad for this variant.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

do you think that float is better?

Comment thread repos/spack_repo/builtin/packages/devicexlib/package.py Outdated
Comment on lines +166 to +180
if "%nvhpc" in spec:
env.set("CC", "nvc")
env.set("FC", "nvfortran")
env.set("F90", "nvfortran")
env.set("CPP", "cpp -E")
env.set("FPP", "nvfortran -Mpreprocess -E")
env.set("F90SUFFIX", ".f90")

if "%gcc" in spec:
env.set("CC", "gcc")
env.set("FC", "gfortran")
env.set("F90", "gfortran")
env.set("CPP", "gcc -E -P")
env.set("FPP", "gfortran -E -P")
env.set("F90SUFFIX", ".f90")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

These are wrong in the current model. Spack allows to use %c=gcc and fortran=nvfortran etc. You can't assume that the toolchain is always homogeneous.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

ok, so do you suggest to simply remove them? or substitute them with something else?

Comment thread repos/spack_repo/builtin/packages/devicexlib/package.py Outdated
Comment thread repos/spack_repo/builtin/packages/yambo/package.py Outdated
Comment thread repos/spack_repo/builtin/packages/yambo/package.py Outdated
@nicspalla nicspalla marked this pull request as draft June 6, 2026 12:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants