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

Configure runtime path linking when using shared libraries #698

Merged
merged 2 commits into from
Mar 29, 2021

Conversation

rafmudaf
Copy link
Collaborator

Feature or improvement description
This pull request configures the RPATH setting in CMake to configure where executables look for shared libraries when compiled with the BUILD_SHARED_LIBS setting enabled.

Related issue, if one exists
#430
#441

Impacted areas of the software
Any targets compiled with shared libraries

@rafmudaf rafmudaf merged commit 7557145 into OpenFAST:dev Mar 29, 2021
@andrew-platt
Copy link
Collaborator

Does this allow for dylibs to be ported between systems?

@rafmudaf rafmudaf deleted the rpath branch March 29, 2021 15:45
@rafmudaf
Copy link
Collaborator Author

The libraries would still have to be available in the destination-system's rpath, but otherwise yes. This removes the hard-coded path to dynamically linked libraries in executables.

@andrew-platt
Copy link
Collaborator

I'll check to see if this fixes the issues with the Simulink builds

@andrew-platt
Copy link
Collaborator

andrew-platt commented Mar 31, 2021

this doesn't seem to work out of the box for Mac OSX 10.15.7 with MATLAB 2020a

Caused by:
    Error using Run_OpenLoop (line 12)
    Invalid MEX-file '/Users/aplatt/software-development/GitHub/openfast-2/install/lib/FAST_SFunc.mexmaci64':
    dlopen(/Users/aplatt/software-development/GitHub/openfast-2/install/lib/FAST_SFunc.mexmaci64, 6): Library not loaded: @rpath/libopenfastlib.dylib
      Referenced from: /Users/aplatt/software-development/GitHub/openfast-2/install/lib/FAST_SFunc.mexmaci64
      Reason: image not found

However, if I setup the build directory with the cmake flags -DCMAKE_INSTALL_NAME_DIR=@loader_path -DCMAKE_MACOSX_RPATH=ON it works (sets @loader_path instead of @rpath).

@rafmudaf rafmudaf mentioned this pull request May 12, 2021
11 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants