Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better support for multi-compiler environments. #188

Merged
merged 4 commits into from
Jun 28, 2024

Conversation

bcumming
Copy link
Member

Recipe authors are not able to set a "default" compiler when using more than one compiler toolchain to build packages in an environment. As a result, the spec list for such environments can be messy because the author has to explicitly set the compiler for many packages to override the compiler chosen by the concretizer.

For example, the following sample that explicitly sets %gcc from the MCH recipe:

  - [email protected]%nvhpc
  - [email protected]%nvhpc +szip +hl +fortran +mpi
  - [email protected]%nvhpc
  - [email protected]%nvhpc
  # Explicitly concretise the packages below with gcc as they shouldn't be
  # built with nvhpc.
  - ca-certificates-mozilla%gcc
  - jasper%gcc
  - libaec%gcc
  - libiconv%gcc

This PR makes the first compiler in the toolchain the default, and only overrides that choice for specs that explicitly specify the second compiler. For example, the following compiler settings would build with the gcc toolchain by default:

  compiler:
    - toolchain: gcc
      spec: gcc
    - toolchain: llvm
      spec: nvhpc

@simonpintarelli
Copy link
Member

the gcc first policy is also applied to cray-mpich. Should it be made automatic? Any environment using nvhpc must most likely use cray-mpich%nvhpc. Or it should be enforced that in mpi.spec there is always either %gcc or %nvhpc.

@bcumming
Copy link
Member Author

the gcc first policy is also applied to cray-mpich. Should it be made automatic? Any environment using nvhpc must most likely use cray-mpich%nvhpc. Or it should be enforced that in mpi.spec there is always either %gcc or %nvhpc.

The compiler for cray-mpich can be explicitly provided in the mpi: field, like it is for the MCH recipe:

https://github.com/eth-cscs/alps-uenv/blob/main/recipes/wcp/icon/v1/gh200/environments.yaml#L9

@simonpintarelli simonpintarelli self-requested a review June 27, 2024 06:40
Copy link
Member

@simonpintarelli simonpintarelli left a comment

Choose a reason for hiding this comment

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

Looks good to me. One possible improvement would be to ensure that the compiler for cray-mpich has been set explicitly. Not sure it is possible with the current schema.

@bcumming bcumming merged commit dbbda0b into master Jun 28, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants