created devclean.sh#415
Conversation
a script to clean all the SRW builds in subdirectories, bin/exec directory
danielabdi-noaa
left a comment
There was a problem hiding this comment.
@natalie-perlin This looks good to me! I've left a few minor suggestions.
| rm -rf share | ||
| rm -rf include | ||
| rm -rf lib |
There was a problem hiding this comment.
If an install location is specified as is the case for test/build.sh, this will not works since it assumes the install location is HOMEdir
There was a problem hiding this comment.
The updated script uses current directory as a SRW_DIR, where build directory is located by default; installation directory is SRW_DIR by default
MichaelLueken
left a comment
There was a problem hiding this comment.
@natalie-perlin I was able to clone your develop_1 branch on Hera, checkout the externals, and build the app (following modifications to the Hera modulefile due to updates made on HPC-stack this afternoon). I had to use chmod 755 on devclean.sh, but after that, I was able to run the new devclean script. The script performs well and does exactly as described.
After making modifications from @danielabdi-noaa, please use:
git add --chmod=+x devclean.sh
This command should add the file to be staged for commit and update the permissions on the file at the same time.
Also, I have executed the Jenkins workflow tests. The build on Hera will fail due to the update made to the HPC-stack on the machine. Your changes should be fine to merge in once the rest of the jobs run.
|
@MichaelLueken - an updated devclean.sh has been uploaded with the correct permissions in place (Thank you for the tip on using |
|
@natalie-perlin Thanks for addressing my suggestion! It looks good to me so approving. |
MichaelLueken
left a comment
There was a problem hiding this comment.
@natalie-perlin Thank you for updating the permissions for the devclean.sh script! I was able to test it and it works well. I did have a minor comment. If the line is not necessary, please remove it.
| printf '%s\n' "Removing submodules ..." | ||
| declare -a submodules='()' | ||
| submodules=(${SRW_DIR}/sorc/*) | ||
| # echo " submodules are: ${submodules[@]} (total of ${#submodules[@]}) " |
There was a problem hiding this comment.
@natalie-perlin Is the commented out debug write on line 133 required? If it isn't, please remove it.
a script to clean all the SRW App builds, including submodules, binaries directory (bin or exec), submodules themselves.
DESCRIPTION OF CHANGES:
A script that allows cleaning up the builds of the SRW App, including main build directory and any ./build/ subdirectories in the submodules, a binaries directory, and submodules themselves if requested.
./devclean.sh -hprovides a summary of the options-h, --helpshow this help guide
-a, --allremoves "bin", "build" directories, and other build artifacts
--removeremoves the "build" directory, keeps the "bin", "lib" and other build artifacts intact
--cleanremoves "bin", "build" directories, and other build artifacts (same as "-a", "--all")
--install-dir=INSTALL_DIRinstallation directory name (${SRW_DIR} by default)
--build-dir=BUILD_DIRmain build directory, absolute path (${SRW_DIR}/build/ by default)
--bin-dir=BIN_DIRbinary directory name ("exec" by default); full path is ${INSTALL_DIR}/${BIN_DIR})
--sub-modulesremove sub-module directories. They will need to be checked out again by sourcing "${SRW_DIR}/manage_externals/checkout_externals" before attempting subsequent builds
-v, --verboseprovide more verbose output
Type of change
TESTS CONDUCTED:
Post-build tests conducted to clean up the build and the submodules, in case of non-standard customized installation directory, build, and bin directories. The SRW app was built successfully after the cleanup. Additional cleanup was performed to remove the sub-modules; the submodules were checked out again (./manage_externals/checkout_externals) and the SRW App was built successfully after that.
Tested on the following platforms:
[x] Hera
[x] Gaea
[x] Jet
[x] Orion
[x] Cheyenne.
DOCUMENTATION:
[x] documentation update needed for this additional cleanup option
ISSUE:
This PR resolves the issue mentioned in [SRW-Issues/?]
CHECKLIST
LABELS (optional):
A Code Manager needs to add the following labels to this PR:
CONTRIBUTORS (optional):
@ Bruce Kropp - provided an initial script draft