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

Define CABLE science library Spack variant. #178

Closed
bschroeter opened this issue Dec 8, 2024 · 14 comments · Fixed by #181
Closed

Define CABLE science library Spack variant. #178

bschroeter opened this issue Dec 8, 2024 · 14 comments · Fixed by #181
Assignees

Comments

@bschroeter
Copy link
Contributor

Further to the PR here:
CABLE-LSM/CABLE#479

We need a Spack variant that can build just the .a library object itself for use elsewhere.

My understanding is that I need to define a new variant in the following class to add the CABLE_LIBRARY flag to the cmake build:

https://github.com/ACCESS-NRI/spack-packages/blob/main/packages/cable/package.py

Which seems pretty straightforward so I will go ahead and do that once I have further info.

However, I'll need to call on the wisdom of someone familiar with the Spack CI infra (@harshula, @CodeGat?) as to how to actually activate the library build in Actions as the build appears traverse multiple repositories and I am unsure where to make changes.

One extra point to not is that the way it is set up, we may need to have build run both the mpi and library options as the CmakeLists.txt file in CABLE-LSM/CABLE#479 uses the cmake variable CABLE_MPI to set some additional compiler flags.

Any advice is greatly appreciated, apologies if anything is unclear!

@bschroeter bschroeter self-assigned this Dec 8, 2024
@CodeGat
Copy link
Member

CodeGat commented Dec 9, 2024

Hmm, as in, how to test whether the variant will install (which would be covered under build-ci)? Or how to have a build of CABLE with the variant on Gadi for your own tests (which is under build-cd)?

@bschroeter
Copy link
Contributor Author

Based on your comment, I would say both - at least that is my understanding.

We'd like to be able to test as part of our CI Action that the library builds as expected, but it is equally likely that we would like to have the library object deployed somewhere on Gadi so that users need not acquire the library via build artefacts just to put it on Gadi.

@ccarouge, can you confirm please?

@CodeGat
Copy link
Member

CodeGat commented Dec 9, 2024

For the former, I will need to fix ACCESS-NRI/build-ci#183
For the latter, ACCESS-NRI/CABLE-standalone could possibly be used?

@ccarouge
Copy link
Member

Well it depends how we want the deployment of the coupled models to go. This library is to be used with ESM1.6 and AM/CM/ESM3 possibly. From what I see of the deployment of the coupled models, they use the deployment of the components (if they are already deployed). So I'm guessing @CodeGat is right and we should use ACCESS-NRI/CABLE-standalone. Although the name of the repository does not work anymore... But that's a minor inconvenience.

@bschroeter
Copy link
Contributor Author

OK @CodeGat, I'll go ahead and implement the variant option in the package.py but I am guessing I won't be able to test until that issue is resolved.

Let me know if there is anything I can do on my end.

@CodeGat
Copy link
Member

CodeGat commented Dec 15, 2024

No worries, I'll work on it now and let you know when it's resolved

@bschroeter
Copy link
Contributor Author

Thanks @CodeGat , changes in branch https://github.com/ACCESS-NRI/spack-packages/tree/178-define-cable-science-library-spack-variant.

I've made the changes following my discussion with @micaeljtoliveira last week. Please let me know if I have botched the syntax. Untested as yet.

@CodeGat
Copy link
Member

CodeGat commented Dec 16, 2024

Thanks @bschroeter - I think @harshula is the person you need for spack-packages syntax stuff, though!

@harshula
Copy link
Collaborator

Hi @bschroeter , It looks OK. Have you tested it?

@ccarouge
Copy link
Member

@bschroeter I would assume you can test it on your own install without waiting for the CI to be updated. We still want the CI to be updated so breaking changes are spotted.

@bschroeter bschroeter linked a pull request Dec 18, 2024 that will close this issue
@harshula
Copy link
Collaborator

Hi @CodeGat , spack-packages has a new tag 2024.12.2 and that contains the updated cable SPR with the variant library. Can you please help @bschroeter set-up the model deployment repository's spack.yaml? Start by building without the library variant. Ben still has some work to do on the CMakeLists.txt before the library variant will work.

@CodeGat
Copy link
Member

CodeGat commented Dec 18, 2024

Sure thing. In this case, the Model Deployment Repository will be ACCESS-NRI/CABLE-standalone?

@harshula
Copy link
Collaborator

Sure thing. In this case, the Model Deployment Repository will be ACCESS-NRI/CABLE-standalone?

Hi @ccarouge , What's your preference regarding @CodeGat 's question?

@ccarouge
Copy link
Member

Sure thing. In this case, the Model Deployment Repository will be ACCESS-NRI/CABLE-standalone?

@CodeGat Yes, that's the one.

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 a pull request may close this issue.

4 participants