#237 libplayerc depends on libjpeg - fails to build

trunk
closed-fixed
G Biggs
player (137)
5
2009-07-17
2008-07-08
No

libplayerc depends on libjpeg, but the dependency is not represented in the CMake scripts.

CMake fails to find libjpeg on my MacPorts installation, but still tries and fails to build libplayerc.

I'm guessing that the jpeg dependency is common in the tree, so this might be the first of a series.

Discussion

  • G Biggs

    G Biggs - 2008-07-09

    Logged In: YES
    user_id=1352294
    Originator: NO

    Are you sure about this? The cmake script links playerc to playerjpeg *if* libjpeg was found (meaning playerjpeg will be built). dev_camera.c, which is the bit that depends on jpeg, includes a #define check for HAVE_JPEG (defined in config.h if libjpeg is found) around the jpeg-dependent code. If libjpeg isn't found, none of this should be included. Is there perhaps some code somewhere in playerc that should be checking HAVE_JPEG, but isn't?

     
  • Richard Vaughan

    Richard Vaughan - 2008-07-15

    Logged In: YES
    user_id=139639
    Originator: YES

    I think it's happening:

    snipped from my console:

    -- Looking for jpeg_read_header in jpeg
    -- Looking for jpeg_read_header in jpeg - not found
    -- Looking for include files HAVE_JPEGLIB_H
    -- Looking for include files HAVE_JPEGLIB_H - not found.

    <stuff>

    -- Looking for include files HAVE_HDR_JPEGLIB_H
    -- Looking for include files HAVE_HDR_JPEGLIB_H - not found.

    <lots of stuff>

    Scanning dependencies of target _playerc
    [ 18%] Building C object
    client_libs/libplayerc/bindings/python/CMakeFiles/_playerc.dir/playercPYTHON_wrap.o
    /Users/vaughan/PS/player/build/client_libs/libplayerc/bindings/python/playercPYTHON_wrap.c:
    In function '_wrap_playerc_mclient_client_set':
    /Users/vaughan/PS/player/build/client_libs/libplayerc/bindings/python/playercPYTHON_wrap.c:48045:
    warning: assignment from incompatible pointer type
    /Users/vaughan/PS/player/build/client_libs/libplayerc/bindings/python/playercPYTHON_wrap.c:
    In function '_wrap_playerc_mclient_addclient':
    /Users/vaughan/PS/player/build/client_libs/libplayerc/bindings/python/playercPYTHON_wrap.c:48250:
    warning: passing argument 2 of 'playerc_mclient_addclient' from
    incompatible pointer type
    Linking C shared module _playerc.so
    ld: library not found for -lplayerjpeg
    collect2: ld returned 1 exit status
    make[2]: *** [client_libs/libplayerc/bindings/python/_playerc.so] Error 1
    make[1]: *** [client_libs/libplayerc/bindings/python/CMakeFiles/_playerc.dir/all]
    Error 2
    make: *** [all] Error 2

    One possible source of weirdness is that I don't know why it's not finding jpeglib. I have it installed in /opt/local, and my environment includes:

    CMAKE_INCLUDE_PATH=/opt/local/include
    CMAKE_LIBRARY_PATH=/opt/local/lib

    Whatever that problem is, if jpeg's missing at config time, then either libplayerc should not be built, or it has a spurious dependency on jpeg.

    This is reproduced on both my OS X boxes with MacPorts.

    Any ideas?

    Richard/

     
  • G Biggs

    G Biggs - 2008-07-16

    Logged In: YES
    user_id=1352294
    Originator: NO

    As it turns out, it was a spurious dependency, but not in libplayerc. libplayerc was correctly not linking to playerjpeg when playerjpeg isn't built, but the Python bindings were still trying to link to it.

    Not finding libjpeg in the first place is a separate issue, related to how the CMake module CheckLibraryExists searches for a library. I'll look into it.

     
  • G Biggs

    G Biggs - 2008-07-16

    Logged In: YES
    user_id=1352294
    Originator: NO

    Fixed in CVS HEAD. Thanks very much for the report.

     
  • Toby Collett

    Toby Collett - 2009-01-03
    • milestone: --> trunk
    • assigned_to: gerkey --> gbiggs
     
  • Toby Collett

    Toby Collett - 2009-01-03
    • labels: --> player
     
  • Toby Collett

    Toby Collett - 2009-07-17
    • status: open --> closed-fixed
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks