NCAR / musica

Multi-Scale Infrastructure for Chemistry Modeling
https://ncar.github.io/musica/
Apache License 2.0
6 stars 3 forks source link

Parameterize dependencies to allow for easier testing against PRs, branches. #124

Closed WardF closed 4 months ago

WardF commented 4 months ago

If this does not fit the style or overall design aesthetic, please feel free to reject it with no hurt feelings. I've added this to make my life easier, in a way that will hopefully help other developers XD.

I've parameterized the stanzas in dependencies.cmake, to allow for easier testing against a branch/fork/PR without changing local files. This will reduce the overhead of keeping track of local changes if testing against a change in a dependency, and will reduce the chances of incorrect dependency versions leaking into the development branch.

I've added a set of new environmental variables, [DEPENDENCY]_GIT_REPOSITORY and [DEPENDENCY_GIT_TAG]. These are currently set to the default values in main. They can be overridden when need be. For example:

$ cmake .. -DTUVX_GIT_REPOSITORY="https://github.com/WardF/tuv-x.git" -DTUVX_GIT_TAG=9e4ad

Instead of making these variables options, and muddying the water, I've left them as environmental variables. I've cut down on a lot of redundant code by adding a function at the top of dependencies.cmake, set_git_default().

Feedback welcome! Hopefully this will prove useful, and it will save time on my end by letting me (and others) more easily test musica against changes in dependencies.

WardF commented 4 months ago

looks good to me!

Should we add some developer instructions for how to point to a specific repo/commit, maybe in the README or documentation? Or we can create a separate issue for this.

I'm happy to write up a how-to/syntax overview, if you point me to where you'd like it. If you confirm the README.md, or point me to a different file, I'll go ahead and amend this PR with documentation :). Thanks!

mattldawson commented 4 months ago

looks good to me! Should we add some developer instructions for how to point to a specific repo/commit, maybe in the README or documentation? Or we can create a separate issue for this.

I'm happy to write up a how-to/syntax overview, if you point me to where you'd like it. If you confirm the README.md, or point me to a different file, I'll go ahead and amend this PR with documentation :). Thanks!

I think the README should be fine for now, since the codebase is still in early development. David set up some documentation that we could eventually move some of the README info to, but I think it will only be built with our first release.

WardF commented 4 months ago

Sounds good, change incoming momentarily and then swapping context to other writing!! :)

WardF commented 4 months ago

I put something in the README.md; feel free to copy edit, reorganize, and change for style and/or content :). Thanks!

mattldawson commented 4 months ago

I put something in the README.md; feel free to copy edit, reorganize, and change for style and/or content :). Thanks!

Looks great! Thanks!

WardF commented 4 months ago

Thanks! I'll merge, since both reviewers have approved it!