# '-Wl,-rpath' not executed when building version 8.2.0

**URL:** https://discourse.vtk.org/t/wl-rpath-not-executed-when-building-version-8-2-0/2383
**Category:** Support
**Created:** [January 6, 2020, 3:55pm UTC](https://discourse.vtk.org/t/wl-rpath-not-executed-when-building-version-8-2-0/2383 "2020-01-06T15:55:28Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Rigel](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/r/8e7dd6/32.png) [@Rigel](https://discourse.vtk.org/u/Rigel)
#### Post date: [January 6, 2020, 3:55pm UTC](https://discourse.vtk.org/t/wl-rpath-not-executed-when-building-version-8-2-0/2383/1 "2020-01-06T15:55:28Z")

</div>

Hi,

I downloaded version 8.2.0 of VTK from the website and CMaked it with default settings (the only flag being `CMAKE_INSTALL_PREFIX`; CMake version 3.10.2 on Ubuntu 18.04.3 LTS). Now, running e.g.:

`ldd -r ${HOME}/VTK/8.2.0/install/lib/libvtkRenderingOpenGL2-8.2.so`

yields many `undefined symbol`s: indeed it cannot find the VTK libraries it depends on, what suggests `-Wl,-rpath` was not included when building them.

However, if I build an executable (the only flag being `VTK_DIR`), `-Wl,-rpath` is included by default and adds to the binary the VTK libraries it immediately depends on, but these have their dependencies themselves and they remain undefined. A minimum `CMakeLists.txt` is used to build the executable:

```
cmake_minimum_required(VERSION 2.8.7)
project(example)
find_package(VTK REQUIRED)
include(${VTK_USE_FILE})
set(SOURCES example.cpp)
add_executable(example ${SOURCES})
target_link_libraries(example ${VTK_LIBRARIES})

```

Is this a desired behaviour in VTK installation? Is there a way to install it with cross-knowledge between its libraries’ locations?

Thank you very much,

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.vtk.org/u/ben.boeckel)
#### Post date: [January 6, 2020, 6:20pm UTC](https://discourse.vtk.org/t/wl-rpath-not-executed-when-building-version-8-2-0/2383/2 "2020-01-06T18:20:32Z")

</div>

This has been fixed on `master` and will be part of 9.0.

Note that RPATH entries may be different between the build and install trees, but there are CMake settings to control them at the distributor level (it’s not something the VTK source tree can dictate because things differ between various ways of distributing VTK). The `RPATH`-containing variables in [this list](https://cmake.org/cmake/help/latest/manual/cmake-variables.7.html) would be the place to start.

---

<div class="post-metadata">

### Author: ![Rigel](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/r/8e7dd6/32.png) [@Rigel](https://discourse.vtk.org/u/Rigel)
#### Post date: [January 7, 2020, 8:24am UTC](https://discourse.vtk.org/t/wl-rpath-not-executed-when-building-version-8-2-0/2383/3 "2020-01-07T08:24:18Z")

</div>

Thanks Ben. Do you know which version of ParaView / Catalyst will inherit this change?

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.vtk.org/u/ben.boeckel)
#### Post date: [January 7, 2020, 4:21pm UTC](https://discourse.vtk.org/t/wl-rpath-not-executed-when-building-version-8-2-0/2383/4 "2020-01-07T16:21:02Z")

</div>

ParaView 5.7 should have the RPATH fix, but I can’t remember exactly if all the RPATH stuff was in by then. If not, 5.8 (due out within a month; rc1 is Friday) will have it.

---

<div class="post-metadata">

### Author: ![estan](https://discourse.vtk.org/user_avatar/discourse.vtk.org/estan/32/460_2.png) [@estan](https://discourse.vtk.org/u/estan)
#### Post date: [January 8, 2020, 7:52am UTC](https://discourse.vtk.org/t/wl-rpath-not-executed-when-building-version-8-2-0/2383/5 "2020-01-08T07:52:14Z")

</div>

When I build and install VTK 8.2.0 into a non-standard location, I pass `-DCMAKE_INSTALL_RPATH=<install prefix>/lib` to CMake.

---

<div class="post-metadata">

### Author: ![Rigel](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/r/8e7dd6/32.png) [@Rigel](https://discourse.vtk.org/u/Rigel)
#### Post date: [January 9, 2020, 9:30am UTC](https://discourse.vtk.org/t/wl-rpath-not-executed-when-building-version-8-2-0/2383/6 "2020-01-09T09:30:40Z")

</div>

I built ParaView 5.7.0 from source (the only flag being `CMAKE_INSTALL_PREFIX`) and confirm the VTK libraries know where their fellow dependees are.
