On Thu, Nov 06, 2014 at 12:46:21PM +0100, Ludovic Courtès wrote: > Apologies if this was already mentioned, but why don’t > -DCMAKE_INSTALL_RPATH_USE_LINK_PATH=TRUE and > -DCMAKE_INSTALL_RPATH=$out/lib (in cmake-build-system.scm) lead to > binaries with a RUNPATH? As Eric said, this should produce binaries > with an appropriate RUNPATH, no? Or does it only take care of setting > the RUNPATH to $out/lib?
From what I understood, the first variable should have solved the problem. I set -DCMAKE_VERBOSE_MAKEFILE=ON and compiled ktouch. When running it, it stops with ktouch: error while loading shared libraries: libkdeclarative.so.5: cannot open shared object file: No such file or directory And indeed: $ ldd ~/.guix-profile/bin/ktouch linux-vdso.so.1 (0x00007fff961ff000) libkdeclarative.so.5 => not found ... (lots of other "not found"). $ objdump -x ~/.guix-profile/bin/ktouch ... Dynamic Section: NEEDED libkdeclarative.so.5 NEEDED libplasma.so.3 NEEDED libkio.so.5 NEEDED libkcmutils.so.4 NEEDED libQtCore.so.4 NEEDED libpthread.so.0 NEEDED libQtOpenGL.so.4 NEEDED libQtScript.so.4 NEEDED libQtDeclarative.so.4 NEEDED libQtXmlPatterns.so.4 NEEDED libQtSql.so.4 NEEDED libQtNetwork.so.4 NEEDED libQtXml.so.4 NEEDED libkdeui.so.5 NEEDED libQtSvg.so.4 NEEDED libkdecore.so.5 NEEDED libQtDBus.so.4 NEEDED libQtGui.so.4 NEEDED libstdc++.so.6 NEEDED libm.so.6 NEEDED libgcc_s.so.1 NEEDED libc.so.6 RUNPATH /gnu/store/7c30kyzagk84inhnb2nbxcmnh76xgh6c-ktouch-4.14.2/lib:/gnu/store/4k20pkxgvfc22wpcvh6xr26ma4b619ad-glibc-2.20/lib:/gnu/store/k7w7wdpvaqlkwq0ijz9149pqn3lq8a5n-gcc-4.8.3-lib/lib64:/gnu/store/k7w7wdpvaqlkwq0ijz9149pqn3lq8a5n-gcc-4.8.3-lib/lib:/gnu/store/k7w7wdpvaqlkwq0ijz9149pqn3lq8a5n-gcc-4.8.3-lib/lib/gcc/x86_64-unknown-linux-gnu/4.8.3/../../.. (Thanks to Ludovic for the suggestion to use objdump!) The linker line looks like this: Linking CXX executable ktouch cd /tmp/nix-build-ktouch-4.14.2.drv-0/build/src && /gnu/store/sr9lv3vhviy151zv315zdgi2rvq97a9r-cmake-2.8.12/bin/cmake -E cmake_link_script CMakeFiles/ktouch.dir/link.txt --verbose=1 /gnu/store/13ahaqlmniysmbls5d1fcmzy59yd5xk5-gcc-4.8.3/bin/c++ -Wnon-virtual-dtor -Wno-long-long -Wundef -Wcast-align -Wchar-subscripts -Wall -W -Wpointer-arith -Wformat-security -fno-exceptions -DQT_NO_EXCEPTIONS -fno-check-new -fno-common -Woverloaded-virtual -fno-threadsafe-statics -fvisibility=hidden -Werror=return-type -fvisibility-inlines-hidden -O2 -g -DNDEBUG -DQT_NO_DEBUG -Wl,--enable-new-dtags CMakeFiles/ktouch.dir/ktouch_automoc.o CMakeFiles/ktouch.dir/main.o CMakeFiles/ktouch.dir/application.o CMakeFiles/ktouch.dir/mainwindow.o CMakeFiles/ktouch.dir/bindings/utils.o CMakeFiles/ktouch.dir/bindings/stringformatter.o CMakeFiles/ktouch.dir/declarativeitems/applicationbackground.o CMakeFiles/ktouch.dir/declarativeitems/cursorshapearea.o CMakeFiles/ktouch.dir/declarativeitems/griditem.o CMakeFiles/ktouch.dir/declarativeitems/lessonpainter.o CMakeFiles/ktouch.dir/declarativeitems/preferencesproxy.o CMakeFiles/ktouch.dir/declarativeitems/scalebackgrounditem.o CMakeFiles/ktouch.dir/declarativeitems/ traininglinecore.o CMakeFiles/ktouch.dir/core/resource.o CMakeFiles/ktouch.dir/core/keyboardlayoutbase.o CMakeFiles/ktouch.dir/core/keyboardlayout.o CMakeFiles/ktouch.dir/core/abstractkey.o CMakeFiles/ktouch.dir/core/key.o CMakeFiles/ktouch.dir/core/keychar.o CMakeFiles/ktouch.dir/core/specialkey.o CMakeFiles/ktouch.dir/core/coursebase.o CMakeFiles/ktouch.dir/core/course.o CMakeFiles/ktouch.dir/core/lesson.o CMakeFiles/ktouch.dir/core/trainingstats.o CMakeFiles/ktouch.dir/core/profile.o CMakeFiles/ktouch.dir/core/dataindex.o CMakeFiles/ktouch.dir/core/dataaccess.o CMakeFiles/ktouch.dir/core/dbaccess.o CMakeFiles/ktouch.dir/core/profiledataaccess.o CMakeFiles/ktouch.dir/core/resourcedataaccess.o CMakeFiles/ktouch.dir/core/userdataaccess.o CMakeFiles/ktouch.dir/undocommands/coursecommands.o CMakeFiles/ktouch.dir/undocommands/keyboardlayoutcommands.o CMakeFiles/ktouch.dir/models/resourcemodel.o CMakeFiles/ktouch.dir/models/lessonmodel.o CMakeFiles/ktouch.dir/models/charactersmodel.o CMakeFiles/ktouch.dir/models/ categorizedresourcesortfilterproxymodel.o CMakeFiles/ktouch.dir/models/errorsmodel.o CMakeFiles/ktouch.dir/models/learningprogressmodel.o CMakeFiles/ktouch.dir/editor/resourceeditor.o CMakeFiles/ktouch.dir/editor/resourceeditorwidget.o CMakeFiles/ktouch.dir/editor/newresourceassistant.o CMakeFiles/ktouch.dir/editor/resourcetypeswidget.o CMakeFiles/ktouch.dir/editor/newcoursewidget.o CMakeFiles/ktouch.dir/editor/newkeyboardlayoutwidget.o CMakeFiles/ktouch.dir/editor/resourcetemplatewidget.o CMakeFiles/ktouch.dir/editor/abstracteditor.o CMakeFiles/ktouch.dir/editor/courseeditor.o CMakeFiles/ktouch.dir/editor/keyboardlayoutcombobox.o CMakeFiles/ktouch.dir/editor/lessontexteditor.o CMakeFiles/ktouch.dir/editor/lessontexthighlighter.o CMakeFiles/ktouch.dir/editor/keyboardlayouteditor.o CMakeFiles/ktouch.dir/editor/keyboardlayouteditorview.o CMakeFiles/ktouch.dir/editor/keyboardlayoutpropertieswidget.o CMakeFiles/ktouch.dir/editor/charactersviewdelegate.o CMakeFiles/ktouch.dir/trainingconfigwidget.o CMakeFiles/ ktouch.dir/colorsconfigwidget.o CMakeFiles/ktouch.dir/customlessoneditorwidget.o CMakeFiles/ktouch.dir/keyboardlayoutmenu.o CMakeFiles/ktouch.dir/preferences.o -o ktouch -rdynamic /gnu/store/mipmjv4mpsf3rrsk1mbhpqzlw939v6ny-kdelibs-4.14.2/lib/libkdeclarative.so.5.14.2 /gnu/store/mipmjv4mpsf3rrsk1mbhpqzlw939v6ny-kdelibs-4.14.2/lib/libplasma.so.3.0.0 /gnu/store/mipmjv4mpsf3rrsk1mbhpqzlw939v6ny-kdelibs-4.14.2/lib/libkio.so.5.14.2 /gnu/store/mipmjv4mpsf3rrsk1mbhpqzlw939v6ny-kdelibs-4.14.2/lib/libkcmutils.so.4.14.2 /gnu/store/ay41dmszxgl57mxsfrp0misnz159csw1-qt-4.8.6/lib/libQtCore.so -lpthread /gnu/store/ay41dmszxgl57mxsfrp0misnz159csw1-qt-4.8.6/lib/libQtOpenGL.so /gnu/store/ay41dmszxgl57mxsfrp0misnz159csw1-qt-4.8.6/lib/libQtScript.so /gnu/store/ay41dmszxgl57mxsfrp0misnz159csw1-qt-4.8.6/lib/libQtDeclarative.so /gnu/store/ay41dmszxgl57mxsfrp0misnz159csw1-qt-4.8.6/lib/libQtXmlPatterns.so /gnu/store/ay41dmszxgl57mxsfrp0misnz159csw1-qt-4.8.6/lib/libQtSql.so /gnu/store/mipmjv4mpsf3rrsk1mbhpqzlw939v6ny-kdelibs-4.14.2/ lib/libkcmutils.so.4.14.2 /gnu/store/mipmjv4mpsf3rrsk1mbhpqzlw939v6ny-kdelibs-4.14.2/lib/libkio.so.5.14.2 /gnu/store/ay41dmszxgl57mxsfrp0misnz159csw1-qt-4.8.6/lib/libQtNetwork.so /gnu/store/ay41dmszxgl57mxsfrp0misnz159csw1-qt-4.8.6/lib/libQtXml.so /gnu/store/mipmjv4mpsf3rrsk1mbhpqzlw939v6ny-kdelibs-4.14.2/lib/libkdeui.so.5.14.2 /gnu/store/ay41dmszxgl57mxsfrp0misnz159csw1-qt-4.8.6/lib/libQtSvg.so /gnu/store/mipmjv4mpsf3rrsk1mbhpqzlw939v6ny-kdelibs-4.14.2/lib/libkdecore.so.5.14.2 /gnu/store/ay41dmszxgl57mxsfrp0misnz159csw1-qt-4.8.6/lib/libQtCore.so -lpthread /gnu/store/ay41dmszxgl57mxsfrp0misnz159csw1-qt-4.8.6/lib/libQtDBus.so /gnu/store/ay41dmszxgl57mxsfrp0misnz159csw1-qt-4.8.6/lib/libQtGui.so -Wl,-rpath,::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: You see lots of "...so" and no "-l...", which is apparently the cmake way of doing things. But no "-Wl,-rpath" despite -DCMAKE_INSTALL_RPATH_USE_LINK_PATH=TRUE Does this mean that this option only honours paths coming from "-l", while at the same time using "-l" is unusual with cmake? Andreas