GCC Dynamic Linking Issue
When I compile a cxx application that uses VTKm with GCC, such as for example the "demo" example in vtkm/examples/demo. I get the following linking error:
./Demo: error while loading shared libraries: libvtkm_io-1.7.so.1: cannot open shared object file: No such file or directory.
When I run "ldd ./Demo" I get the following output:
linux-vdso.so.1 (0x00007ffc98757000)
libvtkm_rendering-1.7.so.1 => /home/peter/Projects/libraries/vtk-m/install/lib/libvtkm_rendering-1.7.so.1 (0x00007fdeaa73a000)
libvtkm_source-1.7.so.1 => /home/peter/Projects/libraries/vtk-m/install/lib/libvtkm_source-1.7.so.1 (0x00007fdeaa6fb000)
libvtkm_filter_contour-1.7.so.1 => /home/peter/Projects/libraries/vtk-m/install/lib/libvtkm_filter_contour-1.7.so.1 (0x00007fdea9ecf000)
libvtkm_filter_common-1.7.so.1 => /home/peter/Projects/libraries/vtk-m/install/lib/libvtkm_filter_common-1.7.so.1 (0x00007fdea9950000)
libvtkm_cont-1.7.so.1 => /home/peter/Projects/libraries/vtk-m/install/lib/libvtkm_cont-1.7.so.1 (0x00007fdea880b000)
libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007fdea85e0000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fdea85c6000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fdea839e000)
libvtkm_io-1.7.so.1 => not found
libvtkm_filter_extra-1.7.so.1 => not found
libvtkm_filter_gradient-1.7.so.1 => not found
libvtkm_worklet-1.7.so.1 => not found
libvtkmdiympi_nompi.so => not found
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fdea82b8000)
/lib64/ld-linux-x86-64.so.2 (0x00007fdeab2ce000)
libvtkmdiympi_nompi.so => not found
libvtkm_worklet-1.7.so.1 => not found
libvtkmdiympi_nompi.so => not found
libvtkm_worklet-1.7.so.1 => not found
libvtkmdiympi_nompi.so => not found
libvtkmdiympi_nompi.so => not found
I've compiled vtkm from the master branch (commit 87c82fdd) using "cmake .. && make" and then installing in a local directory.
When I compile the same application with clang, it compiles and runs just fine.
I've tried this on two build systems. Those are:
- Ubuntu 18.04, GCC version = 7.5.0, Clang Version 6.0.0
- Ubuntu 21.10, GCC version = 11.2.0, Clang Version 13.0.0
I've also tried the master branch and the v1.7.0-rc1 release with the same result.
Edited by Petar Hristov