Review Request 115907: Link tests with extra libraries as well

Alex Merry kde at randomguy3.me.uk
Fri Feb 21 11:07:41 UTC 2014



> On Feb. 20, 2014, 10:46 a.m., Alex Merry wrote:
> > Can you describe the problem this fixes?  Are the tests directly using these libraries somehow?
> 
> Adrián Chaves Fernández wrote:
>     If I build with these steps:
>     
>     mkdir -p build && cd build
>     cmake ../kxmlgui-4.96.0 \
>       -DCMAKE_INSTALL_PREFIX=/usr/bin \
>       -DCMAKE_BUILD_TYPE=RelWithDebInfo \
>       -DLIB_INSTALL_DIR=lib \
>       -DSYSCONF_INSTALL_DIR=/etc
>     make
>     
>     In Chakra, I cannot get it to build. Without these changes, I get something like this when building the tests:
>     
>     Linking CXX executable kbugreporttest
>     cd /home/gallaecio/proxectos/empaquetamento/repositorios/desktop/kxmlgui/src/build/tests && /usr/bin/cmake -E cmake_link_script CMakeFiles/kbugreporttest.dir/link.txt --verbose=1
>     /usr/bin/c++   -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector --param=ssp-buffer-size=4 -g -fvar-tracking-assignments -g -fvar-tracking-assignments  -std=c++0x -fno-exceptions -Wall -Wextra -Wcast-align -Wchar-subscripts -Wformat-security -Wno-long-long -Wpointer-arith -Wundef -Wnon-virtual-dtor -Woverloaded-virtual -Werror=return-type -O2 -g -DNDEBUG  -Wl,--enable-new-dtags  -Wl,-O1,--sort-common,--as-needed,-z,relro CMakeFiles/kbugreporttest.dir/kbugreporttest.cpp.o CMakeFiles/kbugreporttest.dir/kbugreporttest_automoc.cpp.o  -o kbugreporttest -rdynamic /usr/lib/libQt5Test.so.5.2.1 /usr/lib/libKF5WidgetsAddons.so.4.96.0 /usr/lib/libKF5I18n.so.4.96.0 ../src/libKF5XmlGui.so.4.96.0 /usr/lib/libKF5ConfigWidgets.so.4.96.0 /usr/lib/libKF5Codecs.so.4.96.0 /usr/lib/libKF5Auth.so.4.96.0 /usr/lib/libKF5I18n.so.4.96.0 /usr/lib/libKF5CoreAddons.so.4.96.0 /usr/lib/libKF5WidgetsAddons.so.4.96.0 /usr/lib/libKF5ConfigGui.so.4.96.0 /usr/lib/libQt5Xml.so.5.2.1 /usr/lib/libKF5ConfigCore.so.4.96.0 /usr/lib/libQt5Widgets.so.5.2.1 /usr/lib/libQt5Gui.so.5.2.1 /usr/lib/libQt5DBus.so.5.2.1 /usr/lib/libQt5Core.so.5.2.1 -Wl,-rpath,/home/gallaecio/proxectos/empaquetamento/repositorios/desktop/kxmlgui/src/build/src 
>     /usr/bin/ld: warning: libKF5Attica.so.4, needed by ../src/libKF5XmlGui.so.4.96.0, not found (try using -rpath or -rpath-link)
>     ../src/libKF5XmlGui.so.4.96.0: undefined reference to `Attica::Person::~Person()'
>     ../src/libKF5XmlGui.so.4.96.0: undefined reference to `Attica::Provider::~Provider()'
>     ../src/libKF5XmlGui.so.4.96.0: undefined reference to `Attica::Person::city() const'
>     ../src/libKF5XmlGui.so.4.96.0: undefined reference to `Attica::Person::extendedAttribute(QString const&) const'
>     ../src/libKF5XmlGui.so.4.96.0: undefined reference to `Attica::ItemJob<Attica::Person>::result() const'
>     ../src/libKF5XmlGui.so.4.96.0: undefined reference to `Attica::Metadata::~Metadata()'
>     ../src/libKF5XmlGui.so.4.96.0: undefined reference to `Attica::Person::country() const'
>     ../src/libKF5XmlGui.so.4.96.0: undefined reference to `Attica::ProviderManager::ProviderManager(QFlags<Attica::ProviderManager::ProviderFlag> const&)'
>     ../src/libKF5XmlGui.so.4.96.0: undefined reference to `Attica::ProviderManager::providers() const'
>     ../src/libKF5XmlGui.so.4.96.0: undefined reference to `Attica::Provider::name() const'
>     ../src/libKF5XmlGui.so.4.96.0: undefined reference to `Attica::Provider::Provider()'
>     ../src/libKF5XmlGui.so.4.96.0: undefined reference to `Attica::Person::avatarUrl() const'
>     ../src/libKF5XmlGui.so.4.96.0: undefined reference to `Attica::ProviderManager::loadDefaultProviders()'
>     ../src/libKF5XmlGui.so.4.96.0: undefined reference to `Attica::Metadata::error() const'
>     ../src/libKF5XmlGui.so.4.96.0: undefined reference to `Attica::ProviderManager::~ProviderManager()'
>     ../src/libKF5XmlGui.so.4.96.0: undefined reference to `Attica::BaseJob::staticMetaObject'
>     ../src/libKF5XmlGui.so.4.96.0: undefined reference to `Attica::BaseJob::start()'
>     ../src/libKF5XmlGui.so.4.96.0: undefined reference to `Attica::ProviderManager::providerByUrl(QUrl const&) const'
>     ../src/libKF5XmlGui.so.4.96.0: undefined reference to `Attica::Provider::isValid() const'
>     ../src/libKF5XmlGui.so.4.96.0: undefined reference to `Attica::Provider::requestPerson(QString const&)'
>     ../src/libKF5XmlGui.so.4.96.0: undefined reference to `Attica::Person::homepage() const'
>     ../src/libKF5XmlGui.so.4.96.0: undefined reference to `Attica::Provider::operator=(Attica::Provider const&)'
>     ../src/libKF5XmlGui.so.4.96.0: undefined reference to `Attica::BaseJob::metadata() const'
>     collect2: error: ld returned 1 exit status
>     make[2]: *** [tests/kbugreporttest] Error 1
>     make[2]: Leaving directory `/home/gallaecio/proxectos/empaquetamento/repositorios/desktop/kxmlgui/src/build'
>     make[1]: *** [tests/CMakeFiles/kbugreporttest.dir/all] Error 2
>     make[1]: Leaving directory `/home/gallaecio/proxectos/empaquetamento/repositorios/desktop/kxmlgui/src/build'
>     make: *** [all] Error 2
> 
> Adrián Chaves Fernández wrote:
>     Hmm…
>     
>     I’ve been toying around, changing things here and there. And here is what I found:
>     
>     Attica installs in lib64. Then, KXmlGui detects it but tests fail to build. However, if I copy /usr/lib64/* into /usr/lib, KXmlGui builds fine. Maybe this lib64 thing is the key of the issue?

Ah, I bet I know what it is.  Our CMake installation/RPath setup figures that, since you're installing to /usr, the RPath doesn't need to be set.  It also figures that lib64 is the correct installation directory for a 64-bit non-Debian system.  This appears not to hold for Chakra, where I guess that /usr/lib64 isn't in /etc/ld.so.conf.

On ArchLinux, I wouldn't run into this problem, because there is a symlink from /usr/lib64 to /usr/lib.  So you have three options: override LIB_INSTALL_DIR for your KDE packages, add /usr/lib64 to /etc/ld.so.conf (and run ldconfig), or symlink /usr/lib64 to /usr/lib.


- Alex


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/115907/#review50328
-----------------------------------------------------------


On Feb. 20, 2014, 5:53 a.m., Adrián Chaves Fernández wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/115907/
> -----------------------------------------------------------
> 
> (Updated Feb. 20, 2014, 5:53 a.m.)
> 
> 
> Review request for KDE Frameworks.
> 
> 
> Repository: kxmlgui
> 
> 
> Description
> -------
> 
> Uses the optional extra libraries in the tests as well.
> 
> 
> Diffs
> -----
> 
>   CMakeLists.txt 4db9ac5 
>   autotests/CMakeLists.txt 01725da 
>   src/CMakeLists.txt a0dd642 
>   tests/CMakeLists.txt 413fa92 
>   tests/krichtexteditor/CMakeLists.txt 45c1abe 
> 
> Diff: https://git.reviewboard.kde.org/r/115907/diff/
> 
> 
> Testing
> -------
> 
> Tests build with and without KF5Attica.
> 
> 
> Thanks,
> 
> Adrián Chaves Fernández
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20140221/d3ba51a9/attachment.html>


More information about the Kde-frameworks-devel mailing list