Natsu-Akatsuki / RangeNetTrt8

tensorrt8 && cuda && libtorch implementation of rangenet++
MIT License
43 stars 8 forks source link

Linking Problems While Building #11

Open tlgkyn06 opened 11 months ago

tlgkyn06 commented 11 months ago

Hi, thank u for your work. I'm trying to build your repo on Nvidia agx xavier , when I do catkin_make in my workspace , I get errors at linking section as below;

Any advice? OS: Ubuntu 20.04 CUDA: 11.4 Tensorrt: 8.2

Base path: /root/Workspace/range_ws Source space: /root/Workspace/range_ws/src Build space: /root/Workspace/range_ws/build Devel space: /root/Workspace/range_ws/devel Install space: /root/Workspace/range_ws/install

Running command: "make cmake_check_build_system" in "/root/Workspace/range_ws/build"

-- Using CATKIN_DEVEL_PREFIX: /root/Workspace/range_ws/devel -- Using CMAKE_PREFIX_PATH: /opt/ros/noetic -- This workspace overlays: /opt/ros/noetic -- Found PythonInterp: /usr/bin/python3 (found suitable version "3.8.10", minimum required is "3") -- Using PYTHON_EXECUTABLE: /usr/bin/python3 -- Using Debian Python package layout -- Using empy: /usr/lib/python3/dist-packages/em.py -- Using CATKIN_ENABLE_TESTING: ON -- Call enable_testing() -- Using CATKIN_TEST_RESULTS_DIR: /root/Workspace/range_ws/build/test_results -- Forcing gtest/gmock from source, though one was otherwise available. -- 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/python3 (found version "3.8.10") -- Using Python nosetests: /usr/bin/nosetests3 -- catkin 0.8.10 -- BUILD_SHARED_LIBS is on -- BUILD_SHARED_LIBS is on -- ~~~~~~~~~~~~~ -- ~~ traversing 1 packages in topological order: -- ~~ - rangenet_pp -- ~~~~~~~~~~~~~ -- +++ processing catkin package: 'rangenet_pp' -- ==> add_subdirectory(RangeNetTrt8) -- [INFO] CMAKE_BUILD_TYPE: -- [INFO] ROS1 is available! -- Using these message generators: gencpp;geneus;genlisp;gennodejs;genpy CMake Warning at /usr/local/lib/python3.8/dist-packages/torch/share/cmake/Torch/TorchConfig.cmake:22 (message): static library kineto_LIBRARY-NOTFOUND not found. Call Stack (most recent call first): /usr/local/lib/python3.8/dist-packages/torch/share/cmake/Torch/TorchConfig.cmake:127 (append_torchlib_if_found) RangeNetTrt8/cmake/ThirdParty.cmake:5 (find_package) RangeNetTrt8/CMakeLists.txt:26 (include)

-- Eigen found (include: /usr/include/eigen3, version: 3.3.7) -- The imported target "vtkParseOGLExt" references the file "/usr/bin/vtkParseOGLExt-7.1" but this file does not exist. Possible reasons include:

-- The imported target "vtkRenderingPythonTkWidgets" references the file "/usr/lib/aarch64-linux-gnu/libvtkRenderingPythonTkWidgets.so" but this file does not exist. Possible reasons include:

-- The imported target "vtk" references the file "/usr/bin/vtk" but this file does not exist. Possible reasons include:

-- The imported target "pvtk" references the file "/usr/bin/pvtk" but this file does not exist. Possible reasons include:

-- OpenNI found (include: /usr/include/ni, lib: /usr/lib/libOpenNI.so) -- OpenNI2 found (include: /usr/include/openni2, lib: /usr/lib/libOpenNI2.so) -- OpenNI found (include: /usr/include/ni, lib: /usr/lib/libOpenNI.so) -- OpenNI2 found (include: /usr/include/openni2, lib: /usr/lib/libOpenNI2.so) -- QHULL found (include: /usr/include, lib: optimized;/usr/lib/aarch64-linux-gnu/libqhull.so;debug;/usr/lib/aarch64-linux-gnu/libqhull.so) -- OpenNI found (include: /usr/include/ni, lib: /usr/lib/libOpenNI.so) -- [INFO] PCL_VERSION is 1.10.0 -- [INFO] CUDA is available! -- [INFO] CUDA Libs: /usr/local/cuda-11.4/lib64/libcudart_static.a;-lpthread;dl;/usr/lib/aarch64-linux-gnu/librt.so -- [INFO] CUDA Headers: /usr/local/cuda-11.4/include -- [INFO] CUDNN is available! -- [INFO] CUDNN_LIBRARY: /usr/lib/aarch64-linux-gnu/libcudnn.so -- [INFO] NVINFER: /usr/lib/aarch64-linux-gnu/libnvinfer.so -- [INFO] NVPARSERS: /usr/lib/aarch64-linux-gnu/libnvparsers.so -- [INFO] NVINFER_PLUGIN: /usr/lib/aarch64-linux-gnu/libnvinfer_plugin.so -- [INFO] NVONNX_PARSER: /usr/lib/aarch64-linux-gnu/libnvonnxparser.so -- [INFO] TensorRT is available! -- Configuring done -- Generating done -- Build files have been written to: /root/Workspace/range_ws/build

Running command: "make -j4 -l4" in "/root/Workspace/range_ws/build"

[ 7%] Building NVCC (Device) object RangeNetTrt8/CMakeFiles/project_ops.dir/src/ops/project_ops_generated_project_kernel.cu.o [ 14%] Building CXX object RangeNetTrt8/CMakeFiles/pointcloud_io.dir/src/utils/pointcloud_io.cpp.o

: warning: ISO C++11 requires whitespace after the macro name [ 21%] Building CXX object RangeNetTrt8/CMakeFiles/postprocess.dir/src/utils/postprocess.cpp.o : warning: ISO C++11 requires whitespace after the macro name : warning: ISO C++11 requires whitespace after the macro name [ 28%] Linking CXX shared library /root/Workspace/range_ws/devel/lib/libpointcloud_io.so : warning: ISO C++11 requires whitespace after the macro name Scanning dependencies of target project_ops [ 35%] Building CXX object RangeNetTrt8/CMakeFiles/project_ops.dir/src/ops/project.cpp.o [ 42%] Linking CXX shared library /root/Workspace/range_ws/devel/lib/libpostprocess.so [ 42%] Built target postprocess [ 50%] Linking CXX shared library /root/Workspace/range_ws/devel/lib/libproject_ops.so [ 50%] Built target project_ops [ 50%] Built target pointcloud_io Scanning dependencies of target rangenet_lib [ 57%] Building CXX object RangeNetTrt8/CMakeFiles/rangenet_lib.dir/src/network/net.cpp.o [ 64%] Building CXX object RangeNetTrt8/CMakeFiles/rangenet_lib.dir/src/network/netTensorRT.cpp.o [ 71%] Linking CXX shared library /root/Workspace/range_ws/devel/lib/librangenet_lib.so [ 71%] Built target rangenet_lib Scanning dependencies of target demo Scanning dependencies of target ros1_demo [ 78%] Building CXX object RangeNetTrt8/CMakeFiles/ros1_demo.dir/src/ros1_demo.cpp.o [ 85%] Building CXX object RangeNetTrt8/CMakeFiles/demo.dir/src/demo.cpp.o [ 92%] Linking CXX executable /root/Workspace/range_ws/devel/lib/rangenet_pp/ros1_demo [100%] Linking CXX executable /root/Workspace/range_ws/devel/lib/rangenet_pp/demo /usr/bin/ld: CMakeFiles/ros1_demo.dir/src/ros1_demo.cpp.o: in function `ROS_DEMO::ROS_DEMO(ros::NodeHandle*)': ros1_demo.cpp:(.text+0xe18): undefined reference to `ros::console::initializeLogLocation(ros::console::LogLocation*, std::string const&, ros::console::levels::Level)' /usr/bin/ld: CMakeFiles/ros1_demo.dir/src/ros1_demo.cpp.o: in function `ROS_DEMO::pointcloudCallback(boost::shared_ptr > const> const&)': ros1_demo.cpp:(.text+0x1c68): undefined reference to `ros::console::initializeLogLocation(ros::console::LogLocation*, std::string const&, ros::console::levels::Level)' /usr/bin/ld: CMakeFiles/ros1_demo.dir/src/ros1_demo.cpp.o: in function `main': ros1_demo.cpp:(.text.startup+0x5c): undefined reference to `ros::init(int&, char**, std::string const&, unsigned int)' /usr/bin/ld: ros1_demo.cpp:(.text.startup+0xac): undefined reference to `ros::NodeHandle::NodeHandle(std::string const&, std::map, std::allocator > > const&)' /usr/bin/ld: CMakeFiles/ros1_demo.dir/src/ros1_demo.cpp.o: in function `ros::SubscriptionCallbackHelperT > const> const&, void>::deserialize(ros::SubscriptionCallbackHelperDeserializeParams const&)': ros1_demo.cpp:(.text._ZN3ros27SubscriptionCallbackHelperTIRKN5boost10shared_ptrIKN11sensor_msgs12PointCloud2_ISaIvEEEEEvE11deserializeERKNS_43SubscriptionCallbackHelperDeserializeParamsE[_ZN3ros27SubscriptionCallbackHelperTIRKN5boost10shared_ptrIKN11sensor_msgs12PointCloud2_ISaIvEEEEEvE11deserializeERKNS_43SubscriptionCallbackHelperDeserializeParamsE]+0x9b8): undefined reference to `ros::console::initializeLogLocation(ros::console::LogLocation*, std::string const&, ros::console::levels::Level)' /usr/bin/ld: /root/Workspace/range_ws/devel/lib/librangenet_lib.so: undefined reference to `pcl::visualization::PCLVisualizer::addCoordinateSystem(double, std::string const&, int)' /usr/bin/ld: /root/Workspace/range_ws/devel/lib/librangenet_lib.so: undefined reference to `YAML::detail::node_data::empty_scalar' /usr/bin/ld: /root/Workspace/range_ws/devel/lib/librangenet_lib.so: undefined reference to `pcl::visualization::PCLVisualizer::setPointCloudRenderingProperties(int, double, std::string const&, int)' /usr/bin/ld: /root/Workspace/range_ws/devel/lib/librangenet_lib.so: undefined reference to `pcl::visualization::PCLVisualizer::PCLVisualizer(std::string const&, bool)' /usr/bin/ld: /root/Workspace/range_ws/devel/lib/librangenet_lib.so: undefined reference to `YAML::LoadFile(std::string const&)' /usr/bin/ld: /root/Workspace/range_ws/devel/lib/librangenet_lib.so: undefined reference to `YAML::detail::node_data::set_scalar(std::string const&)' collect2: error: ld returned 1 exit status make[2]: *** [RangeNetTrt8/CMakeFiles/ros1_demo.dir/build.make:538: /root/Workspace/range_ws/devel/lib/rangenet_pp/ros1_demo] Error 1 make[1]: *** [CMakeFiles/Makefile2:605: RangeNetTrt8/CMakeFiles/ros1_demo.dir/all] Error 2 make[1]: *** Waiting for unfinished jobs.... /usr/bin/ld: CMakeFiles/demo.dir/src/demo.cpp.o: in function `YAML::detail::node& YAML::detail::node_data::get(std::string const&, std::shared_ptr)': demo.cpp:(.text._ZN4YAML6detail9node_data3getISsEERNS0_4nodeERKT_St10shared_ptrINS0_13memory_holderEE[_ZN4YAML6detail9node_data3getISsEERNS0_4nodeERKT_St10shared_ptrINS0_13memory_holderEE]+0x2d8): undefined reference to `YAML::detail::node_data::set_scalar(std::string const&)' /usr/bin/ld: CMakeFiles/demo.dir/src/demo.cpp.o: in function `main': demo.cpp:(.text.startup+0x140): undefined reference to `YAML::LoadFile(std::string const&)' /usr/bin/ld: demo.cpp:(.text.startup+0x3a0): undefined reference to `pcl::PCDReader::read(std::string const&, pcl::PCLPointCloud2&, Eigen::Matrix&, Eigen::Quaternion&, int&, int)' /usr/bin/ld: /root/Workspace/range_ws/devel/lib/librangenet_lib.so: undefined reference to `pcl::visualization::PCLVisualizer::addCoordinateSystem(double, std::string const&, int)' /usr/bin/ld: /root/Workspace/range_ws/devel/lib/librangenet_lib.so: undefined reference to `YAML::detail::node_data::empty_scalar' /usr/bin/ld: /root/Workspace/range_ws/devel/lib/librangenet_lib.so: undefined reference to `pcl::visualization::PCLVisualizer::setPointCloudRenderingProperties(int, double, std::string const&, int)' /usr/bin/ld: /root/Workspace/range_ws/devel/lib/librangenet_lib.so: undefined reference to `pcl::visualization::PCLVisualizer::PCLVisualizer(std::string const&, bool)' collect2: error: ld returned 1 exit status make[2]: *** [RangeNetTrt8/CMakeFiles/demo.dir/build.make:456: /root/Workspace/range_ws/devel/lib/rangenet_pp/demo] Error 1 make[1]: *** [CMakeFiles/Makefile2:494: RangeNetTrt8/CMakeFiles/demo.dir/all] Error 2 make: *** [Makefile:141: all] Error 2 Invoking "make -j4 -l4" failed
Natsu-Akatsuki commented 11 months ago

Do you download and set the libtorch library refering to the proposed README?

tlgkyn06 commented 10 months ago

When I add libtorch, it emerged this error. May be this libtorch is not compatible with arm64 archtecture.

[ 7%] Building NVCC (Device) object RangeNetTrt8/CMakeFiles/project_ops.dir/src/ops/project_ops_generated_project_kernel.cu.o

: warning: ISO C++11 requires whitespace after the macro name : warning: ISO C++11 requires whitespace after the macro name : warning: ISO C++11 requires whitespace after the macro name : warning: ISO C++11 requires whitespace after the macro name Scanning dependencies of target project_ops [ 14%] Building CXX object RangeNetTrt8/CMakeFiles/project_ops.dir/src/ops/project.cpp.o [ 21%] Linking CXX shared library /root/Workspace/3range_ws/devel/lib/libproject_ops.so [ 21%] Built target project_ops Scanning dependencies of target pointcloud_io [ 28%] Building CXX object RangeNetTrt8/CMakeFiles/pointcloud_io.dir/src/utils/pointcloud_io.cpp.o [ 35%] Linking CXX shared library /root/Workspace/3range_ws/devel/lib/libpointcloud_io.so [ 35%] Built target pointcloud_io Scanning dependencies of target rangenet_lib [ 42%] Building CXX object RangeNetTrt8/CMakeFiles/rangenet_lib.dir/src/network/net.cpp.o [ 50%] Building CXX object RangeNetTrt8/CMakeFiles/rangenet_lib.dir/src/network/netTensorRT.cpp.o [ 57%] Linking CXX shared library /root/Workspace/3range_ws/devel/lib/librangenet_lib.so /usr/bin/ld: /root/Workspace/3range_ws/src/RangeNetTrt8/src/libtorch/lib/libtorch.so: error adding symbols: file in wrong format collect2: error: ld returned 1 exit status make[2]: *** [RangeNetTrt8/CMakeFiles/rangenet_lib.dir/build.make:487: /root/Workspace/3range_ws/devel/lib/librangenet_lib.so] Error 1 make[1]: *** [CMakeFiles/Makefile2:659: RangeNetTrt8/CMakeFiles/rangenet_lib.dir/all] Error 2 make: *** [Makefile:141: all] Error 2 Invoking "make -j4 -l4" failed
Natsu-Akatsuki commented 10 months ago

Thanks for your feedback. I agree with you. I am afraid that a deployment on the Jetson Platform is beyond my experience. Best wishes for your solution.

tlgkyn06 commented 10 months ago

Thanks for your fast replies :) . Maybe this issue can stay open for a while in case someone else helps.

smileyr99 commented 3 weeks ago

Thanks for your fast replies :) . Maybe this issue can stay open for a while in case someone else helps. I'm also using a Jetson Orin and currently experiencing the same problem. If you've managed to solve it, I would appreciate any advice you can offer!