librealsense icon indicating copy to clipboard operation
librealsense copied to clipboard

librealsense2-dev (2.9.0-0~realsense0.56) debian packages break cmake builds due to libusb.a dependency.

Open mjscosta opened this issue 8 years ago • 1 comments

Required Info
Camera Model R200 / F200 / SR300 / ZR300 / D400
Firmware Version
Operating System & Version ubuntu 16.04
Kernel Version (Linux Only) 4.4.0-87
SDK Version 2.9

1 - Error

CMake Error at /usr/lib/x86_64-linux-gnu/cmake/realsense2/realsense2Targets.cmake:84 (message):
 The imported target "realsense2::usb" references the file
    "/usr/lib/libusb.a"
 but this file does not exist.  Possible reasons include:
 * The file was deleted, renamed, or moved to another location.
 * An install or uninstall procedure did not complete successfully.
 * The installation package was faulty and contained
    "/usr/lib/x86_64-linux-gnu/cmake/realsense2/realsense2Targets.cmake"
 but not all the files it references.
Call Stack (most recent call first):
 /usr/lib/x86_64-linux-gnu/cmake/realsense2/realsense2Config.cmake:33 (include)
 rgbd/CMakeLists.txt:66 (FIND_PACKAGE)

2- New lib release librealsense2-dev (2.9.0-0~realsense0.56) has a change in file /usr/lib/x86_64-linux-gnu/cmake/realsense2/realsense2Targets-release.cmake, added a reference to /usr/lib/libusb.a. 2.1 - This lib/location does not exist in ubuntu 16.04. 2.2 - there is a lib libusb-dev, that contains file /usr/lib/x86_64-linux-gnu/libusb.a 2.2.1 - but this lib, seems to be a legacy version, regarding the new libusb-1.0-0-dev which contains file /usr/lib/x86_64-linux-gnu/libusb-1.0.a

3 - Solution so far was to create a symbolic link sudo ln -s /usr/lib/x86_64-linux-gnu/libusb-1.0.a /usr/lib/libusb.a 3.1 - Compilation succeeds, but it is not clear which it is the correct dependency, either libusb-dev or libusb-1.0-0-dev.

4- diff from version 2.9 and 2.8.3.

8,18d7
< # Import target "realsense2::usb" for configuration "release"
< set_property(TARGET realsense2::usb APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
< set_target_properties(realsense2::usb PROPERTIES
<   IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "C"
<   IMPORTED_LINK_INTERFACE_LIBRARIES_RELEASE "udev"
<   IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/lib/libusb.a"
<   )
< 
< list(APPEND _IMPORT_CHECK_TARGETS realsense2::usb )
< list(APPEND _IMPORT_CHECK_FILES_FOR_realsense2::usb "${_IMPORT_PREFIX}/lib/libusb.a" )
< 
32c21
<   IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/lib/x86_64-linux-gnu/librealsense2.so.2.9.0"
---
>   IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/lib/x86_64-linux-gnu/librealsense2.so.2.8.3"
37c26
< list(APPEND _IMPORT_CHECK_FILES_FOR_realsense2::realsense2 "${_IMPORT_PREFIX}/lib/x86_64-linux-gnu/librealsense2.so.2.9.0" )
---
> list(APPEND _IMPORT_CHECK_FILES_FOR_realsense2::realsense2 "${_IMPORT_PREFIX}/lib/x86_64-linux-gnu/librealsense2.so.2.8.3" )

mjscosta avatar Jan 10 '18 16:01 mjscosta

[Realsense Customer Engineering Team Comment] You can try librealsense 2.10.0 which added USE_SYSTEM_LIBUSB flag to CMake file. This should be resolved.