Closed dpad closed 1 month ago
Note that the patch for macOS mirrors what is already happening in Linux:
Since I think that the files get put into the install directory by pip, instead of running some cmake generated installation command, it might be the best possible without really fiddling with how pip is installing the files.
Howdy @dpad and @sassy-asjp , thanks for posting this issue and discussion. We have been building wheels on our Linux distribution only so far for use with BSK-RL tools. If you need me to test a branch on my macOS systems, let me know.
@schaubh
We've tested our fix on our side and think it works generally well. We think our fix seems kinda hacky, but a similar trick has been used on the Linux side already, so probably does make sense. If the open source project is happy with it, we can open up a pull request for it.
Howdy @sassy-asjp , I'm open to including this approach. We are calling the wheel generation a beta feature for now, so we can explore some of these solutions.
To summarize, you are looking to add
set(CMAKE_INSTALL_RPATH "\$ORIGIN/../../")
to the macOS cmake settings, not use the "@loader_path/../.."
solution @dpad had?
@dpad , any thoughts on @sassy-asjp approach?
@schaubh I believe what @sassy-asjp is saying is that "@loader_path/../.."
is the MacOS equivalent of the Linux "\$ORIGIN/../.."
option (the latter of which is already present in the current Basilisk build system, but the former is not yet). So we're suggesting to add the "@loader_path/../.."
to the MacOS RPATH option, so that it matches the Linux option and works for the cases I mentioned.
Ok, thanks for the clarification. I'm open to try this on a PR branch. As long as this doesn't break our current build systems we should be fine.
Describe the bug The current settings for the RPATH (path where the linker tries to find linked libraries) seem to be hard-coded to the absolute build directory for MacOS builds. This affects
pip
-based installation for MacOS, in particular for cases wherepip
copies the source code into the temporary build directory. The following cases are affected (on MacOS only):pip install .
-- works because the source code is not copied and points to the local build directorydist3
pip install Basilisk*.tar.gz
-- i.e. installing source distribution does not work, becausepip
will unzip the source into a temporary directorypip install git+https://github.com/AVSLab/basilisk.git
-- as aboveI'm not 100% sure what the correct fix is for setting the RPATH appropriately, but the following patch at least seems to work when I asked someone with a MacOS to test it.
To reproduce Steps to reproduce the behavior:
pip install git+https://github.com/AVSLab/basilisk.git
Desktop (please complete the following information):