-
Notifications
You must be signed in to change notification settings - Fork 63
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
Add SoilMoistureProfile and SoilFreeThaw as git submodule in ngen ext… #412
Changes from 1 commit
42e9cc6
273eb84
61ef183
a1a7691
6c2cf14
e4d923d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# SFT Submodule Library Build Instructions for use in the Next Generation Water Resources Modeling Framework | ||
|
||
**These build instructions are specific to running SoilFreezeThaw in the [Next Generation Water Resources Modeling Framework](https://github.com/NOAA-OWP/ngen)** | ||
|
||
First, cd into the outer directory containing the submodule: | ||
|
||
cd extern/SoilFreezeThaw/SoilFreezeThaw | ||
|
||
Before library files can be built, a CMake build system must be generated. E.g.: | ||
|
||
cmake -B cmake_build -S . | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Apparently for this module the command needs to be:
Otherwise the library tries to find There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I added -DNGEN=1 for both SoilFreezeThaw and SoilMoistureProfiles INSTALL.md. |
||
|
||
Note that when there is an existing directory, it may sometimes be necessary to clear it and regenerate, especially if any changes were made to the [CMakeLists.txt](CMakeLists.txt) file. | ||
|
||
After there is build system directory, the shared library can be built using the `sftbmi` CMake target. For example, the SFT shared library file (i.e., the build config's `sftbmi` target) can be built using: | ||
|
||
cmake --build cmake_build --target sftbmi -- -j 2 | ||
|
||
This will build a `cmake_build/libsftbmi.<version>.<ext>` file, where the version is configured within the CMake config, and the extension depends on the local machine's operating system. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# SFT Submodule | ||
|
||
## About | ||
|
||
This directory wraps the *sft* Git submodule repo, which contains a clone of the repo for the OWP SFT module library that implements BMI. From here, the shared library file for the SFT module can be built for use in NGen. This is configured with the [CMakeLists.txt](CMakeLists.txt) and other files in this outer directory. | ||
|
||
#### Extra Outer Directory | ||
|
||
Currently there are two directory layers beneath the top-level *extern/* directory. While this module has its CMakeLists.txt within the submodule, at present this extra directory exists primarily to be consistent with other modules which have their CMakeLists.txt files in the interstitial directory (this may change in the future). | ||
|
||
## Working with the Submodule | ||
|
||
Some simple explanations of several command actions are included below. To better understand what these things are doing, consult the [Git Submodule documentation](https://git-scm.com/book/en/v2/Git-Tools-Submodules). | ||
|
||
### Getting the Latest Changes | ||
|
||
There are two steps to getting upstream submodule changes fully | ||
1. fetching and locally checking out the changes from the remote | ||
2. committing the new checkout revision for the submodule | ||
|
||
To fetch and check out the latest revision (for the [currently used branch](#viewing-the-current-branch)): | ||
|
||
git submodule update --init -- extern/SoilFreezeThaw | ||
|
||
To commit the current submodule checkout revision to the NGen repo: | ||
|
||
git add extern/SoilFreezeThaw | ||
git commit | ||
|
||
### Viewing the Commit Hash | ||
|
||
Git submodule configurations include the specific commit to be checked out (or an implicit default). The current commit can be view with `git submodule status`: | ||
|
||
git submodule status -- extern/SoilFreezeThaw/ | ||
|
||
This will show the **commit**, **submodule local path**, and the git description for the **commit**. The specific configuration, including the configured branch, is set in the _.gitmodules_ file in the NGen project root. | ||
|
||
### Changing the Commit Branch | ||
|
||
The latest commit in the configured branch can be brought in as described here. If it is ever necessary to change to a different branch, the following will do so: | ||
|
||
git config -f .gitmodules "submodule.extern/SoilFreezeThaw/SoilFreezeThaw.branch" <branchName> | ||
|
||
Note that this will be done in the NGen repo configuration, so it can then be committed and push to remotes. It is also possible to do something similar in just the local clone of a repo, by configuring `.git/config` instead of `.gitmodules`. See the Git documentation for more on how that works if needed. | ||
|
||
# Usage | ||
|
||
## Building Libraries | ||
|
||
The instructions on how to build the submodule libraries can be found in extern/SoilFreezeThaw/INSTALL.md after the submodule has been downloaded. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# SMP Submodule Library Build Instructions for use in the Next Generation Water Resources Modeling Framework | ||
|
||
**These build instructions are specific to running SoilMoistureProfiles in the [Next Generation Water Resources Modeling Framework](https://github.com/NOAA-OWP/ngen)** | ||
|
||
First, cd into the outer directory containing the submodule: | ||
|
||
cd extern/SoilMoistureProfiles/SoilMoistureProfiles | ||
|
||
Before library files can be built, a CMake build system must be generated. E.g.: | ||
|
||
cmake -B cmake_build -S . | ||
|
||
Note that when there is an existing directory, it may sometimes be necessary to clear it and regenerate, especially if any changes were made to the [CMakeLists.txt](CMakeLists.txt) file. | ||
|
||
After there is build system directory, the shared library can be built using the `smpbmi` CMake target. For example, the SMP shared library file (i.e., the build config's `smpbmi` target) can be built using: | ||
|
||
cmake --build cmake_build --target smpbmi -- -j 2 | ||
|
||
This will build a `cmake_build/libsmpbmi.<version>.<ext>` file, where the version is configured within the CMake config, and the extension depends on the local machine's operating system. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# SMP Submodule | ||
|
||
## About | ||
|
||
This directory wraps the *smp* Git submodule repo, which contains a clone of the repo for the OWP SMP module library that implements BMI. From here, the shared library file for the SMP module can be built for use in NGen. This is configured with the [CMakeLists.txt](CMakeLists.txt) and other files in this outer directory. | ||
|
||
#### Extra Outer Directory | ||
|
||
Currently there are two directory layers beneath the top-level *extern/* directory. While this module has its CMakeLists.txt within the submodule, at present this extra directory exists primarily to be consistent with other modules which have their CMakeLists.txt files in the interstitial directory (this may change in the future). | ||
|
||
## Working with the Submodule | ||
|
||
Some simple explanations of several command actions are included below. To better understand what these things are doing, consult the [Git Submodule documentation](https://git-scm.com/book/en/v2/Git-Tools-Submodules). | ||
|
||
### Getting the Latest Changes | ||
|
||
There are two steps to getting upstream submodule changes fully | ||
1. fetching and locally checking out the changes from the remote | ||
2. committing the new checkout revision for the submodule | ||
|
||
To fetch and check out the latest revision (for the [currently used branch](#viewing-the-current-branch)): | ||
|
||
git submodule update --init -- extern/SoilMoistureProfiles | ||
|
||
To commit the current submodule checkout revision to the NGen repo: | ||
|
||
git add extern/SoilMoistureProfiles | ||
git commit | ||
|
||
### Viewing the Commit Hash | ||
|
||
Git submodule configurations include the specific commit to be checked out (or an implicit default). The current commit can be view with `git submodule status`: | ||
|
||
git submodule status -- extern/SoilMoistureProfiles/ | ||
mattw-nws marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
This will show the **commit**, **submodule local path**, and the git description for the **commit**. The specific configuration, including the configured branch, is set in the _.gitmodules_ file in the NGen project root. | ||
|
||
### Changing the Commit Branch | ||
|
||
The latest commit in the configured branch can be brought in as described here. If it is ever necessary to change to a different branch, the following will do so: | ||
|
||
git config -f .gitmodules "submodule.extern/SoilMoistureProfiles/SoilMoistureProfiles.branch" <branchName> | ||
|
||
Note that this will be done in the NGen repo configuration, so it can then be committed and push to remotes. It is also possible to do something similar in just the local clone of a repo, by configuring `.git/config` instead of `.gitmodules`. See the Git documentation for more on how that works if needed. | ||
|
||
# Usage | ||
|
||
## Building Libraries | ||
|
||
The instructions on how to build the submodule libraries can be found in extern/SoilMoistureProfiles/INSTALL.md after the submodule has been downloaded. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is likely to lead to confusion... let's make these all
SoilMoistureProfiles
(with ans
), since that is apparently the name of the repo.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Notably, the submodule addition itself probably needs to be changed--I am not sure that just changing the path in this file will suffice...and I'm not sure how to otherwise edit it, it may need to be removed and re-added. (?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed and re-added SoilMoistureProfiles.