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

Fixes for running coupled on macOS #526

Merged
merged 5 commits into from
Oct 19, 2023

Conversation

mathomp4
Copy link
Member

@mathomp4 mathomp4 commented Oct 19, 2023

This PR is an attempt to fix running the coupled model on macOS. Note that this is most likely a kludge than a real fix (which might be internal to the ocean layers and how they call MAPL, cc @tclune).

To wit, runs by @sanAkel on macOS found that when you tried to run MOM6 + CICE4, it instead called CICE6. Testing found three fixes would let things run:

  1. Use DYLD_INSERT_LIBRARIES instead of LD_PRELOAD as the former is The Right Way™ on macOS
  2. Call mpirun directly rather than through esma_mpirun.1
  3. Use DYLD_LIBRARY_PATH instead of LD_LIBRARY_PATH

My hope is all this doesn't change anything on Linux, just on macOS. And my guess is all of this has to do with SIP which is the bane of my life with dynamic loading on macOS. For more reference see:

I did try using codesign to add the entitlements, but even with the entitlements in, it made no difference. But, well, I'm not an XCode developer so it was just me and ChatGPT trying things out.2

Footnotes

  1. This assumes macOS GEOS will use Open MPI (or other stack that uses mpirun as the launcher...which is most). Fixing this in future is not hard, just more tedious

  2. Maybe someday @scivision will make a blog post and all this can be fixed more elegantly inside CMake with a post-install step. 😄

@mathomp4 mathomp4 added the 0 diff The changes in this pull request have verified to be zero-diff with the target branch. label Oct 19, 2023
@mathomp4 mathomp4 self-assigned this Oct 19, 2023
sdrabenh
sdrabenh previously approved these changes Oct 19, 2023
Copy link
Collaborator

@sdrabenh sdrabenh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I trust the fix by @mathomp4

@sanAkel
Copy link
Collaborator

sanAkel commented Oct 19, 2023

The latest commits worked for me on macOS:

  • ✅ uncoupled run.
  • ✅ coupled with MOM6 + CICE4.

@mathomp4 mathomp4 marked this pull request as ready for review October 19, 2023 19:00
@mathomp4 mathomp4 requested a review from a team as a code owner October 19, 2023 19:00
@mathomp4
Copy link
Member Author

Okay. I think this now doesn't break on Discover (well, Linux).

Honestly, I'm surprised the CI didn't go haywire...though maybe it did and I just didn't notice.

@mathomp4 mathomp4 requested a review from sdrabenh October 19, 2023 19:01
@sdrabenh sdrabenh merged commit d3c0b4b into develop Oct 19, 2023
5 checks passed
@sdrabenh sdrabenh deleted the bugfix/mathomp4/fix-coupled-darwin branch October 19, 2023 19:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0 diff The changes in this pull request have verified to be zero-diff with the target branch.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants