trinity-devel@lists.pearsoncomputing.net

Message: previous - next
Month: March 2012

Re: [trinity-devel] tdegraphics build failure 2 : libkscan.so (linker error?)

From: "David C. Rankin" <drankinatty@...>
Date: Tue, 06 Mar 2012 21:44:19 -0600
On 03/06/2012 08:00 PM, David C. Rankin wrote:
> On 03/06/2012 07:37 PM, David C. Rankin wrote:
>> On 03/06/2012 07:09 PM, Darrell Anderson wrote:
>>>>   Ran into another issue with tdegraphics that I can't
>>>> solve by a dependency review:
>>>>
>>>> [ 31%] Building CXX object
>>>> libkscan/CMakeFiles/kscan-shared.dir/imgscaninfo.cpp.o
>>>> Linking CXX shared library libkscan.so
>>>> /usr/bin/ld: cannot find
>>>> -lsane-Wl,-O1,--sort-common,--as-needed,-z,relro,--hash-style=gnu-L/usr/lib
>>>> collect2: ld returned 1 exit status
>>>> make[2]: *** [libkscan/libkscan.so.1.0.0] Error 1
>>>> make[1]: *** [libkscan/CMakeFiles/kscan-shared.dir/all]
>>>> Error 2
>>>> make: *** [all] Error 2
>>>>
>>>>   Is this a CMake issue? Linker error? What to look
>>>> for?
>>>
>>> Do you have SANE installed?
>>>
>>> Check your build log for the following:
>>>
>>> -- checking for 'libkscan'
>>> --   ok, activated for build
>>>
>>> Check your CMakeCache.txt for this:
>>>
>>> //Build libkscan
>>> BUILD_LIBKSCAN:BOOL=ON
>>>
>>>
>>> Darrell
>>>
>>
>> Hmm... yes on both accounts:
>>
>> -- checking for 'libkscan'
>> --   ok, activated for build
>>
>>
>> [19:35 providence:/home/david/bld/david/build/src/build] # grep -i libkscan
>> CMakeCache.txt
>> //Build libkscan
>> BUILD_LIBKSCAN:BOOL=ON
>> libksane_BINARY_DIR:STATIC=/build/src/build/libkscan
>> libksane_SOURCE_DIR:STATIC=/build/src/tdegraphics/libkscan
>>
>> Is this a new gcc issue? I have gcc 4.6.2-7... How would I check?
>>
>>
>>
> 
>   I cannot read cmake very well, but it looks like it gets to about line 584 in
> libkscan/CMakeFiles/kscan-shared.dir/build.make:
> 
> 
>         @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --red --bold
> "Linking CXX shared library libkscan.so"
>         cd /build/src/build/libkscan && $(CMAKE_COMMAND) -E cmake_link_script
> CMakeFiles/kscan-shared.dir/link.txt --verbose=$(VERBOSE)
>         cd /build/src/build/libkscan && $(CMAKE_COMMAND) -E
> cmake_symlink_library libkscan.so.1.0.0 libkscan.so.1 libkscan.so
> 
> libkscan/libkscan.so.1: libkscan/libkscan.so.1.0.0
> 
> libkscan/libkscan.so: libkscan/libkscan.so.1.0.0
> 
>   Because it gets to:
> 
> [ 31%] Building CXX object libkscan/CMakeFiles/kscan-shared.dir/imgscaninfo.cpp.o
> 
>   Then dies. Any ideas?
> 

  I think I'm getting closer to at least finding where things are going wrong.
Can someone confirm the order that the build system will go though the files in
the libkscan/CMakeFiles/kscan-shared.dir? I don't know how the intricacies work,
but it looks like it works something like this:

chroot/david/build/src/build/libkscan> ll CMakeFiles/
total 12
drwxr-xr-x 2 nobody nobody 4096 Mar  6 19:35 kscan-shared.dir
-rw-r--r-- 1 nobody nobody  970 Mar  6 19:30 CMakeDirectoryInformation.cmake
-rw-r--r-- 1 nobody nobody    2 Mar  6 19:30 progress.marks

  Path information is set from CMakeDirectoryInformation.cmake

21:27 nirvana:/mnt/nv1/home/chroot/david/build/src/build/libkscan> cat
CMakeFiles/CMakeDirectoryInformation.cmake
# CMAKE generated file: DO NOT EDIT!
# Generated by "Unix Makefiles" Generator, CMake Version 2.8

# Relative path conversion top directories.
SET(CMAKE_RELATIVE_PATH_TOP_SOURCE "/build/src/tdegraphics")
SET(CMAKE_RELATIVE_PATH_TOP_BINARY "/build/src/build")

# Force unix paths in dependencies.
SET(CMAKE_FORCE_UNIX_PATHS 1)

# The C and CXX include file search paths:
SET(CMAKE_C_INCLUDE_PATH
  "libkscan"
  "/build/src/tdegraphics/libkscan"
  "/opt/trinity/include"
  "/opt/tqt3/include"
  "/opt/trinity/include/tqt"
  )
<snip>

  Then it drops into the CMakeFiles/kscan-shared.dir

chroot/david/build/src/build/libkscan> ll CMakeFiles/kscan-shared.dir/
total 1616
-rw-r--r-- 1 nobody nobody  50066 Mar  6 19:30 build.make
-rw-r--r-- 1 nobody nobody   1420 Mar  6 19:30 cmake_clean.cmake
-rw-r--r-- 1 nobody nobody  42307 Mar  6 19:35 CXX.includecache
-rw-r--r-- 1 nobody nobody   2830 Mar  6 19:30 DependInfo.cmake
-rw-r--r-- 1 nobody nobody  73257 Mar  6 19:35 depend.internal
-rw-r--r-- 1 nobody nobody 186988 Mar  6 19:35 depend.make
-rw-r--r-- 1 nobody nobody  58224 Mar  6 19:35 devselector.cpp.o
-rw-r--r-- 1 nobody nobody  24008 Mar  6 19:35 dispgamma.cpp.o
-rw-r--r-- 1 nobody nobody    579 Mar  6 19:30 flags.make
-rw-r--r-- 1 nobody nobody  32848 Mar  6 19:35 gammadialog.cpp.o
-rw-r--r-- 1 nobody nobody 118000 Mar  6 19:35 img_canvas.cpp.o
-rw-r--r-- 1 nobody nobody  38912 Mar  6 19:35 imgscaledialog.cpp.o
-rw-r--r-- 1 nobody nobody   3696 Mar  6 19:35 imgscaninfo.cpp.o
-rw-r--r-- 1 nobody nobody  22728 Mar  6 19:35 kgammatable.cpp.o
-rw-r--r-- 1 nobody nobody 178736 Mar  6 19:35 kscandevice.cpp.o
-rw-r--r-- 1 nobody nobody 144720 Mar  6 19:35 kscanoption.cpp.o
-rw-r--r-- 1 nobody nobody  47176 Mar  6 19:35 kscanoptset.cpp.o
-rw-r--r-- 1 nobody nobody  88552 Mar  6 19:35 kscanslider.cpp.o
-rw-r--r-- 1 nobody nobody   1742 Mar  6 19:30 link.txt
-rw-r--r-- 1 nobody nobody  33712 Mar  6 19:35 massscandialog.cpp.o
-rw-r--r-- 1 nobody nobody 119280 Mar  6 19:35 previewer.cpp.o
-rw-r--r-- 1 nobody nobody    668 Mar  6 19:30 progress.make
-rw-r--r-- 1 nobody nobody  78328 Mar  6 19:35 scandialog.cpp.o
-rw-r--r-- 1 nobody nobody 169960 Mar  6 19:35 scanparams.cpp.o
-rw-r--r-- 1 nobody nobody  45992 Mar  6 19:35 scansourcedialog.cpp.o
-rw-r--r-- 1 nobody nobody  31688 Mar  6 19:35 sizeindicator.cpp.o

  Where it then reads the 'flags.txt, does make for 'build.make' and then uses
'link.txt' for the linker. In this process, 'flags.txt' looks to have the
correct include information:

chroot/david/build/src/build/libkscan> cat CMakeFiles/kscan-shared.dir/flags.make
# CMAKE generated file: DO NOT EDIT!
# Generated by "Unix Makefiles" Generator, CMake Version 2.8

# compile CXX with /usr/bin/c++
CXX_FLAGS = -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector
--param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2   -DQT_NO_ASCII_CAST
-DQT_CLEAN_NAMESPACE -DQT_NO_STL -DQT_NO_COMPAT -DQT_NO_TRANSLATION
-DQT_THREAD_SUPPORT -D_REENTRANT -include tqt.h -fPIC
-I/build/src/build/libkscan -I/build/src/tdegraphics/libkscan
-I/opt/trinity/include -I/opt/tqt3/include -I/opt/trinity/include/tqt

CXX_DEFINES = -Dkscan_shared_EXPORTS -DHAVE_CONFIG_H

  The question is build.make -- is the symlink_library stuff correct? It looks
like it, but I don't know. This is where the build craters:

libkscan/libkscan.so.1.0.0: libkscan/CMakeFiles/kscan-shared.dir/link.txt
        @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --red --bold
"Linking CXX shared library libkscan.so"
        cd /build/src/build/libkscan && $(CMAKE_COMMAND) -E cmake_link_script
CMakeFiles/kscan-shared.dir/link.txt --verbose=$(VERBOSE)
        cd /build/src/build/libkscan && $(CMAKE_COMMAND) -E
cmake_symlink_library libkscan.so.1.0.0 libkscan.so.1 libkscan.so

libkscan/libkscan.so.1: libkscan/libkscan.so.1.0.0

libkscan/libkscan.so: libkscan/libkscan.so.1.0.0

  Stuck -- How To Fix??

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