dusty-nv / jetbot_ros

ROS nodes and Gazebo model for NVIDIA JetBot with Jetson Nano
MIT License
382 stars 178 forks source link

Build jetbot_ros fails for: /usr/bin/ld: cannot find -lnvbuf_utils #44

Open jomoengineer opened 2 years ago

jomoengineer commented 2 years ago

I am attempting to go through the build and install process for jetbot_ros but it is failing at the "Build jetbot_ros" phase with the following build error: Note: JetBot Image Version: 0.4.3 / JetPack 4.5 4Gb

Did I perhaps miss a step?

The library file libnvbuf_utils is installed on the system though. ls -la /usr/lib/aarch64-linux-gnu/tegra/libnvbuf_utils.so lrwxrwxrwx 1 root root 23 Jan 15 2021 /usr/lib/aarch64-linux-gnu/tegra/libnvbuf_utils.so -> libnvbuf_utils.so.1.0.0

Error seen: `jetbot@nano-4gb-jp45:~/workspace/catkin_ws$ catkin_make Base path: /home/jetbot/workspace/catkin_ws Source space: /home/jetbot/workspace/catkin_ws/src Build space: /home/jetbot/workspace/catkin_ws/build Devel space: /home/jetbot/workspace/catkin_ws/devel Install space: /home/jetbot/workspace/catkin_ws/install

Running command: "make cmake_check_build_system" in "/home/jetbot/workspace/catkin_ws/build"

-- Using CATKIN_DEVEL_PREFIX: /home/jetbot/workspace/catkin_ws/devel -- Using CMAKE_PREFIX_PATH: /home/jetbot/workspace/catkin_ws/devel;/opt/ros/melodic -- This workspace overlays: /home/jetbot/workspace/catkin_ws/devel;/opt/ros/melodic -- Found PythonInterp: /usr/bin/python2 (found suitable version "2.7.17", minimum required is "2") -- Using PYTHON_EXECUTABLE: /usr/bin/python2 -- Using Debian Python package layout -- Using empy: /usr/bin/empy -- Using CATKIN_ENABLE_TESTING: ON -- Call enable_testing() -- Using CATKIN_TEST_RESULTS_DIR: /home/jetbot/workspace/catkin_ws/build/test_results -- Found gtest sources under '/usr/src/googletest': gtests will be built -- Found gmock sources under '/usr/src/googletest': gmock will be built -- Found PythonInterp: /usr/bin/python2 (found version "2.7.17") -- Using Python nosetests: /usr/bin/nosetests-2.7 -- catkin 0.7.29 -- BUILD_SHARED_LIBS is on -- BUILD_SHARED_LIBS is on -- ~~~~~~~~~~~~~ -- ~~ traversing 2 packages in topological order: -- ~~ - jetbot_ros -- ~~ - ros_deep_learning -- ~~~~~~~~~~~~~ -- +++ processing catkin package: 'jetbot_ros' -- ==> add_subdirectory(jetbot_ros) -- +++ processing catkin package: 'ros_deep_learning' -- ==> add_subdirectory(ros_deep_learning) detected ROS_DISTRO=ROS_MELODIC detected ROS1 (catkin_make) -- Configuring done -- Generating done -- Build files have been written to: /home/jetbot/workspace/catkin_ws/build

Running command: "make -j2 -l2" in "/home/jetbot/workspace/catkin_ws/build"

[ 3%] Linking CXX executable /home/jetbot/workspace/catkin_ws/devel/lib/ros_deep_learning/segnet [ 7%] Linking CXX executable /home/jetbot/workspace/catkin_ws/devel/lib/jetbot_ros/jetbot_camera /usr/bin/ld: cannot find -lnvbuf_utils collect2: error: ld returned 1 exit status jetbot_ros/CMakeFiles/jetbot_camera.dir/build.make:168: recipe for target '/home/jetbot/workspace/catkin_ws/devel/lib/jetbot_ros/jetbot_camera' failed make[2]: [/home/jetbot/workspace/catkin_ws/devel/lib/jetbot_ros/jetbot_camera] Error 1 CMakeFiles/Makefile2:615: recipe for target 'jetbot_ros/CMakeFiles/jetbot_camera.dir/all' failed make[1]: [jetbot_ros/CMakeFiles/jetbot_camera.dir/all] Error 2 make[1]: Waiting for unfinished jobs.... [ 18%] Built target segnet Makefile:140: recipe for target 'all' failed make: [all] Error 2 Invoking "make -j2 -l2" failed `

dusty-nv commented 2 years ago

Hi @jomoengineer, can you try adding link_directories(/usr/lib/aarch64-linux-gnu/tegra) to this line in CMakeLists.txt ?

https://github.com/dusty-nv/jetbot_ros/blob/179bdaa3614123b7f08dcfafe6bc5367bbbf058b/CMakeLists.txt#L125

jomoengineer commented 2 years ago

Yep! Adding the link_directories just above the include_directories line solved the issue.

Thanks!