gvpack built with CMake in Linux cannot load shared library libgvplugin_neato_layout.so.6
Steps to reproduce
Build Graphviz with CMake on Linux.
Set up:
dir=`pwd`/`echo build/_CPack_Packages/Linux/DEB/Graphviz-*-Linux/usr`
export C_INCLUDE_PATH="$dir/include:$C_INCLUDE_PATH"
export LIBRARY_PATH="$dir/lib:$LIBRARY_PATH"
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:"$dir/lib"
export PATH="$dir/bin:$PATH"
dot -c
Run:
gvpack -?
Expected Behaviour
Print usage. No error.
Actual Behaviour
gvpack: error while loading shared libraries: libgvplugin_neato_layout.so.6: cannot open shared object file: No such file or directory
OS Version
Ubuntu 18.04.
Graphviz Version
dot - graphviz version 2.44.2~dev.20200925.1756 (20200925.1756)
Home-built based on master at 898c87cb.
Additional info
Adding:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:"$dir/lib/graphviz"
fixes the problem. I don't know if this is what you're supposed to do or if gvpack
should be linked in a different way so that it looks for libgvplugin_neato_layout.so.6
in the graphviz
subdirectory.
find:
magjac@t440:~/graphviz$ find $dir -name libgvplugin_neato_layout.so.6
/home/magjac/graphviz/build/_CPack_Packages/Linux/DEB/Graphviz-2.44.2~dev.20200926.1525-Linux/usr/lib/graphviz/libgvplugin_neato_layout.so.6
ldd:
magjac@t440:~/graphviz$ ldd $dir/bin/gvpack
linux-vdso.so.1 (0x00007fff47f38000)
libgvplugin_neato_layout.so.6 => not found
libgvc.so.6 => /usr/lib/libgvc.so.6 (0x00007f84ef98d000)
libcgraph.so.6 => /usr/lib/libcgraph.so.6 (0x00007f84ef772000)
libcdt.so.5 => /usr/lib/libcdt.so.5 (0x00007f84ef56a000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f84ef1cc000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f84eeddb000)
libpathplan.so.4 => /usr/lib/libpathplan.so.4 (0x00007f84eebcf000)
libxdot.so.4 => /usr/lib/libxdot.so.4 (0x00007f84ee9c8000)
libexpat.so.1 => /lib/x86_64-linux-gnu/libexpat.so.1 (0x00007f84ee796000)
libltdl.so.7 => /usr/lib/x86_64-linux-gnu/libltdl.so.7 (0x00007f84ee58c000)
/lib64/ld-linux-x86-64.so.2 (0x00007f84efe5b000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f84ee388000)
Might be related to the discussion in !1581 (comment 419129746).