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

Ensure the RPATH does not get blanked out during ESMX_App installation. #178

Merged
merged 1 commit into from
Aug 14, 2023

Conversation

theurich
Copy link
Member

This PR ensures that the RPATH that is correctly encoded during the ESMX_App build process is not blanked out during the installation step. The CMake default is to remove the encoded RPATH in executables during installation. I assume this is to support LD_LIBRARY_PATH setting during run-time. However, for ESMF applications, and therefore ESMX, this is not a good idea. You typically encode the RPATH into the executable for good reason, so the correct shared library is found during loading without relying on LD_LIBRARY_PATH.

@theurich theurich self-assigned this Aug 14, 2023
Copy link
Member

@danrosen25 danrosen25 left a comment

Choose a reason for hiding this comment

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

This is fine with me. How did you encounter the issue? I'm brainstorming on the ESMX application prototypes and testing.

@theurich
Copy link
Member Author

I was working on a toy code that itself has a dependency on PnetCDF. I satisfied this dependency in the toy model's CMakeLists.txt file (since my local ESMF build was not done with PnetCDF). The PnetCDF on my system is a shared library, and everything all the way up to linking the build/esmx_app was fine, setting the appropriate RPATH in the executable. However, during the install step into install/bin/esmx_app, the RPATH was blanked out.
The result was that build/esmx_app could execute fine, while install/bin/esmx_app was not finding the PnetCDF library during loading.
The proposed change keeps the RPATH intact during for install/bin/esmx_app.

@theurich theurich merged commit 42d4814 into develop Aug 14, 2023
2 checks passed
@theurich theurich deleted the fix/esmx-rpath branch August 14, 2023 21:27
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