Unable to set rpath of python library when building from source
- Dominant language
- C++
- Stars
- 14k
- Forks
- 2.6k
- Avg merge
- 5d 18h
- Merged PRs (30d)
- 6
Description
### Checklist
- [X] I have searched for [similar issues](https://github.com/isl-org/Open3D/issues).
- [X] For Python issues, I have tested with the [latest development wheel](http://www.open3d.org/docs/latest/getting_started.html#development-version-pip).
- [X] I have checked the [release documentation](http://www.open3d.org/docs/release/) and the [latest documentation](http://www.open3d.org/docs/latest/) (for `master` branch).
### Steps to reproduce the issue
Build from source with one of the non-header only 3rd party libs installed in a non-standard location while activating the USE_SYSTEM_XXX flag. The prefix location of the system 3rd party lib is provided to cmake via CMAKE_PREFIX_PATH, desired rpath is provided via CMAKE_INSTALL_RPATH, and the library is located by cmake at configure time. In my case use JSONCPP as an example.
Make install-pip-package target.
### Error message
```shell
Upon importing open3d in python:
undefined symbol: <...>
readelf shows desired rpath provided by CMAKE_INSTALL_RPATH is not reflected in the lib RUNPATH.
```
### Open3D, Python and System information
```markdown
- Operating system: Ubuntu 20.04
- Python version: Python 3.9
- Open3D version: 0.15.1
- System architecture: x86
- Is this a remote workstation?: no
- How did you install Open3D?: build from source
- Compiler version (if built from source): gcc 9.4
```
### Additional information
Build process of python lib does not appear to respect CMAKE_INSTALL_RPATH provided by user. This does not appear to be an issue when using system versions of header only 3rd party libs (e.g. Eigen, pybind11, etc.).
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.