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

Fix build of libesmftrace_preload.dylib on Darwin-openmpi #221

Merged
merged 2 commits into from
Feb 6, 2024

Conversation

billsacks
Copy link
Member

With Darwin-openmpi, we use a Fortran linker for libesmftrace_preload.dylib. But the link command was using flags appropriate for a C++ linker rather than a Fortran linker. This PR changes the link flags to be appropriate for a Fortran linker in this case.

I have tested this on my Mac (green, with gfortranclang+openmpi) and confirmed that this resolves the build issues I was running into.

I have also tested this on catania and derecho to ensure that this doesn't break the build / test on other systems.

@theurich I'd welcome a quick look.

I had removed `$(ESMF_F90LINKPATHS) $(ESMF_F90LINKLIBS)` from
`ESMF_SL_LIBLIBS` because it was redundant. But since then, Gerhard
added some code that set `ESMF_F90LINKPATHS += -L$(dir
$(ESMF_LIBSTDCXX))` and `ESMF_F90LINKLIBS += -lm -lc++`, so now they are
no longer redundant.
Previously, C++ flags / libs were used regardless of whether a C++ or
Fortran linker was being used. This commit changes this behavior to use
F90 flags when using an F90 linker.
@billsacks billsacks requested a review from theurich February 2, 2024 00:40
Copy link
Member

@theurich theurich left a comment

Choose a reason for hiding this comment

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

This looks really nice and clean. Thank you @billsacks for cleaning up this mess!

@billsacks billsacks merged commit 977d04e into develop Feb 6, 2024
2 checks passed
@billsacks billsacks deleted the fix/darwin_gfortranclang_openmpi_preload branch February 6, 2024 01:06
billsacks added a commit that referenced this pull request Feb 7, 2024
…h/8.6.1

This is equivalent to pull request #221 but for the patch/8.6.1 branch

Fix build of libesmftrace_preload.dylib on Darwin-openmpi

With Darwin-openmpi, we use a Fortran linker for libesmftrace_preload.dylib. But the link command was using flags appropriate for a C++ linker rather than a Fortran linker. This PR changes the link flags to be appropriate for a Fortran linker in this case.

In the context of the develop branch:
- I have tested this on my Mac (green, with gfortranclang+openmpi) and confirmed that this resolves the build issues I was running into.
- I have also tested this on catania and derecho to ensure that this doesn't break the build / test on other systems.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants