westonpace commented on issue #35577:
URL: https://github.com/apache/arrow/issues/35577#issuecomment-1551865779
> I think that conda activate or something sets related environments such as
LD_LIBRARY_PATH and PKG_CONFIG_PATH automatically.
That's not quite accurate. conda-build configures the origin / loader_path
of shared libraries:
```
Relative links require a special variable in the link itself:
On Linux, the $ORIGIN variable allows you to specify "relative to this
file as it is being executed".
On macOS, the variables are:
@rpath---Allows you to set relative links from the system load paths.
@loader_path---Equivalent to $ORIGIN.
@executable_path---Supports the Apple .app directory approach, where
libraries know where they live relative to their calling application.
Conda-build uses @loader_path on macOS and $ORIGIN on Linux because we
install into a common root directory and can assume that other libraries are
also installed into that root. The use of the variables allows you to build
relocatable binaries that can be built on one system and sent everywhere.
On Linux, conda-build modifies any shared libraries or generated executables
to use a relative dynamic link by calling the patchelf tool. On macOS, the
install_name_tool tool is used.
```
However, that is the responsibility of conda-build and not the package being
built (e.g. building arrow directly shouldn't configure the rpath but
conda-forge's arrow recipe should). This does mean, if you are building and
installing into conda directly by setting `CMAKE_INSTALL_PREFIX` (I do this
myself), then you either need to set the rpath manually (to emulate
conda-build) or set `LD_LIBRARY_PATH`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]