-
Notifications
You must be signed in to change notification settings - Fork 119
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
[develop] Added environment variable LDFLAGS on macOS as requested by the corresponding module file #729
[develop] Added environment variable LDFLAGS on macOS as requested by the corresponding module file #729
Changes from 1 commit
3677147
eb77115
82f1276
a1c2543
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 |
---|---|---|
|
@@ -450,7 +450,7 @@ else | |
module use ${SRW_DIR}/modulefiles | ||
module load ${MODULE_FILE} | ||
if [[ "${MODULE_FILE}" == "build_macos_gnu" ]]; then | ||
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. Suggesting the following for the line 452: 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. Thanks for your comments. The modifications are committed as you suggested. Please review them again. |
||
export LDFLAGS="-L$MPI_ROOT/lib " | ||
export LDFLAGS+=" -L$MPI_ROOT/lib " | ||
fi | ||
fi | ||
module list | ||
|
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.
Suggesting changes to the modulefile build_macos_gnu.lua instead of adding conditionals to devbuild.sh
Lines 59-65 of build_macos_gnu.lua to be changed to a single line adding a flag to the existing ones (note "+=" instead of "=", and spaces before "L" and after "lib")
export LDFLAGS+=" -L$MPI_ROOT/lib "
Another change that is needed for build_macos_gnu.lua in lines 49-50:
instead of "macos.<compiler>".
The ufs-weather-model expects "macosx.<compiler>" as a platform name, and it has
ufs-weather-model/cmake/configure_macosx.gnu.cmake
andconfigure_macosx.intel.cmake
platform-dependent configuration files.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.
export LDFLAGS+=" -L$MPI_ROOT/lib "
does not work in a Lua module file. Note that it is a shell command.build_macos_gnu.lua
, the file name should also be changed tobuild_macosx_gnu.lua
to be consistent. And all other scripts that mentionedbuild_macos_gnu
should also be changed.It will be involved too many modifications and is error prone. I prefer to leaving it to the next major version update? My current modification is not perfect, but it requests the minimal changes that make the script
devbuild.sh
work on the macOS platform.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.
@ywangwof -
Thank you for your responses!
append_path (”LDFLAGS”, “ -L$MPI_ROOT/lib ", “ ”)
it will not work either, because the $MPI_ROOT could only be expanded after the modulefile is loaded; it is not yet available inside the modulefile.
Your solution to modify devbuild.sh is then a good option. My only suggestion is to use a conditional based on a $PLATFORM variable, because we may have other compilers Intel, Clang. The line 452 in devbuild.sh then would be:
if [[ "${PLATFORM}" == "macos" ]]; then
Agree. If a platform+compiler naming for the SRW differs from that for the UFS-WM, but still works for the SRW system, it's OK to leave it unchanged.
Modulefiles build_macos_gnu.lua may still need a correction to the syntax for the export LDFLAGS string, suggesting: