trinity-devel@lists.pearsoncomputing.net

Message: previous - next
Month: January 2014

Re: [trinity-devel] tdebase FTBFS /usr/bin/ld: cannot find -ldbus-tqt-1

From: "David C. Rankin" <drankinatty@...>
Date: Sun, 19 Jan 2014 23:23:24 -0600
On 01/19/2014 09:42 PM, David C. Rankin wrote:
> On 01/19/2014 08:19 PM, Slávek Banko wrote:
>> On Monday 20 of January 2014 03:12:12 Slávek Banko wrote:
>>> On Monday 20 of January 2014 00:52:20 David C. Rankin wrote:
>>>> On 01/19/2014 04:12 PM, David C. Rankin wrote:
>>>>> On 01/19/2014 03:56 PM, Darrell Anderson wrote:
>>>>>> I'm no compiler expert, not even close, sunny or rainy day. Unless
>>>>>> Arch is REALLY different from other distros, I would pause to
>>>>>> consider what else might be causing the errors. That is, the rest
>>>>>> of the team is building full package sets without the same errors.
>>>>>>
>>>>>> That said, yes, you could have stumbled across a corner case that
>>>>>> Arch exposes. We've seen that before around here. :)
>>>>>>
>>>>>> Darrell
>>>>>
>>>>> I'm the corner case sucker... I think I have an idea.
>>>>>
>>>>> tdebase/kicker/kicker/CMakeLists.txt has:
>>>>>
>>>>>   link_directories( ${TQT_LIBRARY_DIRS} )
>>>>>
>>>>> Why isn't it linking against TDE_LIBRARY_DIRS? So I'm going to try:
>>>>>
>>>>>   link_directories( ${TQT_LIBRARY_DIRS} ${TDE_LIBRARY_DIRS} )
>>>>>
>>>>> I have a love/hate relationship with cmake. Love it when it works, hate
>>>>> it when it doesn't because it does so much behind the scene and is a
>>>>> PITA to follow the chain of logic for tests/includes and find what it
>>>>> actually does with pkgconfig info after it finds it. For all I know
>>>>> tdebase is properly finding the libdbus-tqt-1 information, but since
>>>>> the
>>>>> link_directories doesn't want it, it may be ignoring the information.
>>>>> Why it includes on some distros and is failing for me? (See my
>>>>> love/hate comment :-)
>>>>
>>>> It failed again:
>>>>
>>>> Linking CXX static library libkicker_ui.a
>>>> [ 54%] Built target kicker_ui-static
>>>> Scanning dependencies of target tdeinit_kicker-shared
>>>> [ 54%] Building CXX object
>>>> kicker/kicker/CMakeFiles/tdeinit_kicker-shared.dir/dummy.cpp.o
>>>> Linking CXX shared library libtdeinit_kicker.so
>>>> /usr/bin/ld: cannot find -ldbus-tqt-1
>>>> collect2: error: ld returned 1 exit status
>>>> kicker/kicker/CMakeFiles/tdeinit_kicker-shared.dir/build.make:108: recipe
>>>> for target 'kicker/kicker/libtdeinit_kicker.so' failed
>>>> make[2]: *** [kicker/kicker/libtdeinit_kicker.so] Error 1
>>>> CMakeFiles/Makefile2:16479: recipe for target
>>>> 'kicker/kicker/CMakeFiles/tdeinit_kicker-shared.dir/all' failed
>>>> make[1]: *** [kicker/kicker/CMakeFiles/tdeinit_kicker-shared.dir/all]
>>>> Error 2 Makefile:116: recipe for target 'all' failed
>>>> make: *** [all] Error 2
>>>>
>>>> Even with:
>>>> link_directories( ${TQT_LIBRARY_DIRS} ${TDE_LIBRARY_DIRS} )
>>>>
>>>> the build fails to add -L/opt/trinity/lib
>>>>
>>>> Now this is weird. -ldbus-1-tqt has no problem (from CMakeCache.txt)
>>>>
>>>> DBUS_1_TQT_LDFLAGS:INTERNAL=-L/opt/trinity/lib;-ldbus-1-tqt
>>>> DBUS_1_TQT_LDFLAGS_OTHER:INTERNAL=
>>>> DBUS_1_TQT_LIBDIR:INTERNAL=/opt/trinity/lib
>>>> DBUS_1_TQT_LIBRARIES:INTERNAL=dbus-1-tqt
>>>> DBUS_1_TQT_LIBRARY_DIRS:INTERNAL=/opt/trinity/lib
>>>> <snip>
>>>> DBUS_STATIC_LDFLAGS:INTERNAL=-ldbus-1;-lpthread;-lrt
>>>> DBUS_STATIC_LDFLAGS_OTHER:INTERNAL=
>>>> DBUS_STATIC_LIBDIR:INTERNAL=
>>>> DBUS_STATIC_LIBRARIES:INTERNAL=dbus-1;pthread;rt
>>>>
>>>> and
>>>>
>>>> DBUS_TQT_LDFLAGS:INTERNAL=-L/opt/trinity/lib;-ldbus-tqt-1;-ldbus-1
>>>> DBUS_TQT_LDFLAGS_OTHER:INTERNAL=
>>>> DBUS_TQT_LIBDIR:INTERNAL=/opt/trinity/lib
>>>> DBUS_TQT_LIBRARIES:INTERNAL=dbus-tqt-1;dbus-1
>>>> DBUS_TQT_LIBRARY_DIRS:INTERNAL=/opt/trinity/lib
>>>> <snip>
>>>> DBUS_TQT_STATIC_LDFLAGS:INTERNAL=-L/opt/trinity/lib;-ldbus-tqt-1;-ldbus-1
>>>> ;- lpthread;-lrt DBUS_TQT_STATIC_LDFLAGS_OTHER:INTERNAL=
>>>> DBUS_TQT_STATIC_LIBDIR:INTERNAL=
>>>> DBUS_TQT_STATIC_LIBRARIES:INTERNAL=dbus-tqt-1;dbus-1;pthread;rt
>>>> DBUS_TQT_STATIC_LIBRARY_DIRS:INTERNAL=/opt/trinity/lib
>>>>
>>>> BUT....
>>>>
>>>> The /opt/trinity/lib information never makes it into the link command:
>>>>
>>>> /usr/bin/c++  -fPIC -march=x86-64 -mtune=generic -O2 -pipe
>>>> -fstack-protector --param=ssp-buffer-size=4   -DQT_NO_ASCII_CAST
>>>> -DQT_CLEAN_NAMESPACE -DQT_NO_STL -DQT_NO_COMPAT -DQT_NO_TRANSLATION
>>>> -DQT_THREAD_SUPPORT -D_REENTRANT -include tqt.h -I/opt/tqt3/include
>>>> -I/usr/include/tqt -DQT_NO_ASCII_CAST
>>>> -DQT_CLEAN_NAMESPACE -DQT_NO_STL -DQT_NO_COMPAT -DQT_NO_TRANSLATION
>>>> -DQT_THREAD_SUPPORT -D_REENTRANT -include tqt.h -Wl,--no-undefined
>>>> -shared -Wl,-soname,libtdeinit_kicker.so -o libtdeinit_kicker.so
>>>> CMakeFiles/tdeinit_kicker-shared.dir/dummy.cpp.o  -L/opt/tqt3/lib
>>>> -Wl,-whole-archive core/libkicker_core.a -Wl,-no-whole-archive
>>>> buttons/libkicker_buttons.a ui/libkicker_ui.a
>>>> ../libkicker/libkickermain.so.1.0.0 /opt/trinity/lib/libtdeabc.so.1.2.0
>>>> /opt/trinity/lib/libtdeutils.so.1.2.0 ../../libkonq/libkonq.so.4.2.0
>>>> ../../tdmlib/libdmctl.a -lXau
>>>> interfaces/libkickoffsearch_interfaces.so.0.0.0 -ldbus-tqt-1 -ldbus-1
>>>> /opt/trinity/lib/libvcard.so.0.0.0
>>>> /opt/trinity/lib/libtderesources.so.1.2.0
>>>> /opt/trinity/lib/libtdeparts.so.2.1.0 /opt/trinity/lib/libtdeio.so.14.0.0
>>>> /opt/trinity/lib/libtdeui.so.14.0.0 -lfreetype -lfontconfig
>>>> /opt/trinity/lib/libtdesu.so.14.0.0 -lutil
>>>> /opt/trinity/lib/libtdewalletclient.so.1.0.1
>>>> /opt/trinity/lib/libtdecore.so.14.0.0 /opt/trinity/lib/libDCOP.so.14.0.0
>>>> /opt/trinity/lib/libtdefx.so.14.0.0 -ltqt -ltqt-mt -lXrender -lX11 -lc
>>>> -lz -lidn -lXcomposite -lICE -lSM -lacl
>>>> -Wl,-rpath,/opt/tqt3/lib:/build/tde-tdebase/src/build/kicker/libkicker:/o
>>>> pt
>>>> /trinity/lib:/build/tde-tdebase/src/build/libkonq:/build/tde-tdebase/src/
>>>> bui ld/kicker/kicker/interfaces:
>>>>
>>>> Any thoughts?
>>>
>>> Try attached patch.
>>>
>>> Slavek
>>
>> Quite possibly will need to adjust wherever linking tdecore-shared.
>> Patch updated.
>>
>> Slavek
>>
> 
> 
> Excellent Progress,
> 
>   You fixed kicker/ui-static!! ...but.. it now crashes on launcher:
> 
> [ 57%] Building CXX object
> kicker/applets/launcher/CMakeFiles/launcher_panelapplet-module.dir/configdlg.cpp.o
> Linking CXX shared module launcher_panelapplet.so
> /usr/bin/ld: cannot find -ldbus-tqt-1
> collect2: error: ld returned 1 exit status
> kicker/applets/launcher/CMakeFiles/launcher_panelapplet-module.dir/build.make:356:
> recipe for target 'kicker/applets/launcher/launcher_panelapplet.so' failed
> make[2]: *** [kicker/applets/launcher/launcher_panelapplet.so] Error 1
> CMakeFiles/Makefile2:17380: recipe for target
> 'kicker/applets/launcher/CMakeFiles/launcher_panelapplet-module.dir/all' failed
> make[1]: ***
> [kicker/applets/launcher/CMakeFiles/launcher_panelapplet-module.dir/all] Error 2
> Makefile:116: recipe for target 'all' failed
> make: *** [all] Error 2
> 
> 

Crud!

  It looks like there is more required than just adding ${DBUS_TQT_LIBRARY_DIRS}
to each of the CMakeLists.txt that like to tdecore-shared.

for i in $(find tdebase-orig -name CMakeLists.txt); do if grep -q tdecore-shared
"$i" &>/dev/null; then echo "$i"; fi; done
tdebase-orig/twin/clients/redmond/CMakeLists.txt
tdebase-orig/twin/clients/default/CMakeLists.txt
tdebase-orig/twin/lib/CMakeLists.txt
tdebase-orig/twin/data/CMakeLists.txt
tdebase-orig/tqt3integration/utils/CMakeLists.txt
tdebase-orig/kstart/CMakeLists.txt
tdebase-orig/khelpcenter/CMakeLists.txt
tdebase-orig/kreadconfig/CMakeLists.txt
tdebase-orig/tdeioslave/thumbnail/CMakeLists.txt
tdebase-orig/kcontrol/krdb/CMakeLists.txt
tdebase-orig/khotkeys/kcontrol/CMakeLists.txt
tdebase-orig/tdeinit/CMakeLists.txt
tdebase-orig/kicker/taskmanager/CMakeLists.txt
tdebase-orig/kicker/kicker/CMakeLists.txt
tdebase-orig/nsplugins/CMakeLists.txt

You have already added ${DBUS_TQT_LIBRARY_DIRS} to each of these with the patch.
I'll keep looking, but if you have any additional insight, I would welcome it. I
found an earlier tde-dev thread regarding this issue from 7/19/2011 author
(Nix). There modifications were also needed in the ConfigureChecks.cmake files:

Index: ConfigureChecks.cmake
===================================================================
--- ConfigureChecks.cmake	(revision 1242239)
+++ ConfigureChecks.cmake	(working copy)
@@ -189,9 +189,10 @@
   endif( )

   # check for dbus-tqt
+  pkg_check_modules( DBUS_TQT REQUIRED dbus-tqt )
   tde_save( CMAKE_REQUIRED_INCLUDES CMAKE_REQUIRED_LIBRARIES )
-  set( CMAKE_REQUIRED_INCLUDES ${QT_INCLUDE_DIRS} ${TQT_INCLUDE_DIRS}
${DBUS_INCLUDE_DIRS} )
-  set( CMAKE_REQUIRED_LIBRARIES ${TQT_LDFLAGS} )
+  set( CMAKE_REQUIRED_INCLUDES ${DBUS_TQT_INCLUDE_DIRS} ${TQT_INCLUDE_DIRS}
${QT_INCLUDE_DIRS})
+  set( CMAKE_REQUIRED_LIBRARIES ${DBUS_TQT_LDFLAGS} ${TQT_LDFLAGS} ${QT_LDFLAGS} )
   check_cxx_source_compiles("
     #include <tqt.h>
     #include <dbus/connection.h>
Index: ksmserver/CMakeLists.txt
===================================================================
--- ksmserver/CMakeLists.txt	(revision 1242239)
+++ ksmserver/CMakeLists.txt	(working copy)
@@ -19,12 +19,13 @@
   ${CMAKE_SOURCE_DIR}/kdmlib
   ${TDE_INCLUDE_DIR}
   ${TQT_INCLUDE_DIRS}
-  ${DBUS_INCLUDE_DIRS}
+  ${DBUS_TQT_INCLUDE_DIRS}
   ${HAL_INCLUDE_DIRS}
 )

 link_directories(
   ${TQT_LIBRARY_DIRS}
+  ${DBUS_TQT_LIBRARY_DIRS}
 )


@@ -42,5 +43,5 @@
     main.cpp server.cpp shutdowndlg.cpp
     legacy.cpp startup.cpp shutdown.cpp client.cpp
     KSMServerInterface.skel server.skel timed.ui
-  LINK dmctl-static kdeui-shared ${HAL_LIBRARIES} ${DBUS_LIBRARIES}
+  LINK dmctl-static kdeui-shared ${HAL_LIBRARIES} ${DBUS_TQT_LIBRARIES}
 )
Index: kdm/backend/CMakeLists.txt
===================================================================
--- kdm/backend/CMakeLists.txt	(revision 1242239)
+++ kdm/backend/CMakeLists.txt	(working copy)
@@ -14,9 +14,12 @@
 include_directories(
   ${CMAKE_CURRENT_BINARY_DIR}
   ${CMAKE_BINARY_DIR}
-  ${DBUS_INCLUDE_DIRS}
+  ${DBUS_TQT_INCLUDE_DIRS}
 )

+link_directories(
+  ${DBUS_TQT_LIBRARY_DIRS}
+)

 ##### kdm (executable) ##########################

@@ -34,6 +37,6 @@
     process.c protodpy.c reset.c resource.c rpcauth.c
     server.c session.c sessreg.c socket.c streams.c
     util.c xdmauth.c xdmcp.c
-  LINK X11 ${XAU_LIBRARIES} ${DBUS_LIBRARIES} ${PAM_LIBRARY}
+  LINK X11 ${XAU_LIBRARIES} ${DBUS_TQT_LIBRARIES} ${PAM_LIBRARY}
   DESTINATION ${BIN_INSTALL_DIR}
 )


  I'll try and see if I can do something similar and report back. If you have
more ideas -- let me know...


-- 
David C. Rankin, J.D.,P.E.