norlab-ulaval / libpointmatcher

An Iterative Closest Point (ICP) library for 2D and 3D mapping in Robotics
BSD 3-Clause "New" or "Revised" License
1.58k stars 542 forks source link

Compile Error #444

Closed maipbui closed 2 years ago

maipbui commented 3 years ago

Hello,

I want to install libpointmatcher version 1.2.4 and followed the instructions but failed to compile. Could you please check the error message and help? Thank you. It happens same error when I tried on Ubuntu 16.04.

Ubuntu: 18.04 64-bit git version 2.17.1 cmake version 3.10.2 GCC version:

gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Boost version: Version: 1.65.1.0ubuntu1 Eigen3: Version: 3.3.4-4 No doxygen is installed libnabo: install from source

Error message:

mb18@mb18-Alienware-15-R3:~/Libraries/libpointmatcher-1.2.4/build$ cmake -D CMAKE_BUILD_TYPE=RelWithDebInfo ${SRC_DIR}
-- The C compiler identification is GNU 7.5.0
-- The CXX compiler identification is GNU 7.5.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Performing Test FLAG_WEXTRA
-- Performing Test FLAG_WEXTRA - Success
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Boost version: 1.65.1
-- Found the following Boost libraries:
--   thread
--   filesystem
--   system
--   program_options
--   date_time
--   chrono
--   atomic
-- Boost version: 1.65.1
-- Found the following Boost libraries:
--   thread
--   filesystem
--   system
--   program_options
--   date_time
--   chrono
--   atomic
-- libnabo found, version 1.0.7 (include= libs=)
CMake Warning (dev) at CMakeLists.txt:218 (get_property):
  Policy CMP0026 is not set: Disallow use of the LOCATION target property.
  Run "cmake --help-policy CMP0026" for policy details.  Use the cmake_policy
  command to set the policy and suppress this warning.

  The LOCATION property should not be read from target "yaml-cpp-pm".  Use
  the target name directly with add_custom_command, or use the generator
  expression $<TARGET_FILE>, as appropriate.

This warning is for project developers.  Use -Wno-dev to suppress it.

-- using built-in yaml-cpp, version 0.3.0
   -- text-based configuration enabled
-- Looking for _POSIX_TIMERS
-- Looking for _POSIX_TIMERS - found
-- API Documentation (doxygen): disabled
CMake Warning (dev) at CMakeLists.txt:456 (get_target_property):
  Policy CMP0026 is not set: Disallow use of the LOCATION target property.
  Run "cmake --help-policy CMP0026" for policy details.  Use the cmake_policy
  command to set the policy and suppress this warning.

  The LOCATION property should not be read from target "pointmatcher".  Use
  the target name directly with add_custom_command, or use the generator
  expression $<TARGET_FILE>, as appropriate.

This warning is for project developers.  Use -Wno-dev to suppress it.

-- Configuring done
-- Generating done
-- Build files have been written to: /home/mb18/Libraries/libpointmatcher-1.2.4/build
mb18@mb18-Alienware-15-R3:~/Libraries/libpointmatcher-1.2.4/build$ make -j 4
[  2%] Built target gtest
[ 26%] Built target yaml-cpp-pm
[ 76%] Built target pointmatcher
[ 76%] Linking CXX executable pmicp
[ 77%] Linking CXX executable icp_simple
[ 78%] Linking CXX executable icp_customized
[ 79%] Linking CXX executable align_sequence
../libpointmatcher.so.1.2.4: undefined reference to `Nabo::NearestNeighbourSearch<double, Eigen::Matrix<double, -1, -1, 0, -1, -1> >::create(Eigen::Matrix<double, -1, -1, 0, -1, -1> const&, int, Nabo::NearestNeighbourSearch<double, Eigen::Matrix<double, -1, -1, 0, -1, -1> >::SearchType, unsigned int, Nabo::Parameters const&)'
../libpointmatcher.so.1.2.4: undefined reference to `Nabo::NearestNeighbourSearch<float, Eigen::Matrix<float, -1, -1, 0, -1, -1> >::create(Eigen::Matrix<float, -1, -1, 0, -1, -1> const&, int, Nabo::NearestNeighbourSearch<float, Eigen::Matrix<float, -1, -1, 0, -1, -1> >::SearchType, unsigned int, Nabo::Parameters const&)'
collect2: error: ld returned 1 exit status
examples/CMakeFiles/icp_simple.dir/build.make:104: recipe for target 'examples/icp_simple' failed
make[2]: *** [examples/icp_simple] Error 1
CMakeFiles/Makefile2:383: recipe for target 'examples/CMakeFiles/icp_simple.dir/all' failed
make[1]: *** [examples/CMakeFiles/icp_simple.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
../libpointmatcher.so.1.2.4: undefined reference to `Nabo::NearestNeighbourSearch<double, Eigen::Matrix<double, -1, -1, 0, -1, -1> >::create(Eigen::Matrix<double, -1, -1, 0, -1, -1> const&, int, Nabo::NearestNeighbourSearch<double, Eigen::Matrix<double, -1, -1, 0, -1, -1> >::SearchType, unsigned int, Nabo::Parameters const&)'
../libpointmatcher.so.1.2.4: undefined reference to `Nabo::NearestNeighbourSearch<float, Eigen::Matrix<float, -1, -1, 0, -1, -1> >::create(Eigen::Matrix<float, -1, -1, 0, -1, -1> const&, int, Nabo::NearestNeighbourSearch<float, Eigen::Matrix<float, -1, -1, 0, -1, -1> >::SearchType, unsigned int, Nabo::Parameters const&)'
collect2: error: ld returned 1 exit status
examples/CMakeFiles/pmicp.dir/build.make:104: recipe for target 'examples/pmicp' failed
make[2]: *** [examples/pmicp] Error 1
CMakeFiles/Makefile2:420: recipe for target 'examples/CMakeFiles/pmicp.dir/all' failed
make[1]: *** [examples/CMakeFiles/pmicp.dir/all] Error 2
../libpointmatcher.so.1.2.4: undefined reference to `Nabo::NearestNeighbourSearch<double, Eigen::Matrix<double, -1, -1, 0, -1, -1> >::create(Eigen::Matrix<double, -1, -1, 0, -1, -1> const&, int, Nabo::NearestNeighbourSearch<double, Eigen::Matrix<double, -1, -1, 0, -1, -1> >::SearchType, unsigned int, Nabo::Parameters const&)'
../libpointmatcher.so.1.2.4: undefined reference to `Nabo::NearestNeighbourSearch<float, Eigen::Matrix<float, -1, -1, 0, -1, -1> >::create(Eigen::Matrix<float, -1, -1, 0, -1, -1> const&, int, Nabo::NearestNeighbourSearch<float, Eigen::Matrix<float, -1, -1, 0, -1, -1> >::SearchType, unsigned int, Nabo::Parameters const&)'
collect2: error: ld returned 1 exit status
examples/CMakeFiles/align_sequence.dir/build.make:104: recipe for target 'examples/align_sequence' failed
make[2]: *** [examples/align_sequence] Error 1
CMakeFiles/Makefile2:457: recipe for target 'examples/CMakeFiles/align_sequence.dir/all' failed
make[1]: *** [examples/CMakeFiles/align_sequence.dir/all] Error 2
../libpointmatcher.so.1.2.4: undefined reference to `Nabo::NearestNeighbourSearch<double, Eigen::Matrix<double, -1, -1, 0, -1, -1> >::create(Eigen::Matrix<double, -1, -1, 0, -1, -1> const&, int, Nabo::NearestNeighbourSearch<double, Eigen::Matrix<double, -1, -1, 0, -1, -1> >::SearchType, unsigned int, Nabo::Parameters const&)'
../libpointmatcher.so.1.2.4: undefined reference to `Nabo::NearestNeighbourSearch<float, Eigen::Matrix<float, -1, -1, 0, -1, -1> >::create(Eigen::Matrix<float, -1, -1, 0, -1, -1> const&, int, Nabo::NearestNeighbourSearch<float, Eigen::Matrix<float, -1, -1, 0, -1, -1> >::SearchType, unsigned int, Nabo::Parameters const&)'
collect2: error: ld returned 1 exit status
examples/CMakeFiles/icp_customized.dir/build.make:104: recipe for target 'examples/icp_customized' failed
make[2]: *** [examples/icp_customized] Error 1
CMakeFiles/Makefile2:346: recipe for target 'examples/CMakeFiles/icp_customized.dir/all' failed
make[1]: *** [examples/CMakeFiles/icp_customized.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2

This is the message when I successfully installed libnabo

mb18@mb18-Alienware-15-R3:~/Libraries/libnabo/build$ make
[ 21%] Built target nabo
[ 30%] Built target trivial
[ 39%] Built target usage
[ 47%] Built target knnbench
[ 56%] Built target knnepsilon
[ 65%] Built target knnvalidate
[ 73%] Built target knnbucketsize
[100%] Built target pynabo
mb18@mb18-Alienware-15-R3:~/Libraries/libnabo/build$ make test
Running tests...
Test project /home/mb18/Libraries/libnabo/build
      Start  1: validation-2D-exhaustive
 1/18 Test  #1: validation-2D-exhaustive ..............   Passed    0.02 sec
      Start  2: validation-2D-random
 2/18 Test  #2: validation-2D-random ..................   Passed    0.06 sec
      Start  3: validation-3D-exhaustive
 3/18 Test  #3: validation-3D-exhaustive ..............   Passed    0.20 sec
      Start  4: validation-3D-random
 4/18 Test  #4: validation-3D-random ..................   Passed    0.43 sec
      Start  5: validation-3D-large-random
 5/18 Test  #5: validation-3D-large-random ............   Passed    1.01 sec
      Start  6: validation-3D-large-random-radius
 6/18 Test  #6: validation-3D-large-random-radius .....   Passed    0.82 sec
      Start  7: bench-3D-large-exhaustive-10000-K1
 7/18 Test  #7: bench-3D-large-exhaustive-10000-K1 ....   Passed    1.65 sec
      Start  8: bench-3D-large-exhaustive-1000-K1
 8/18 Test  #8: bench-3D-large-exhaustive-1000-K1 .....   Passed    3.28 sec
      Start  9: bench-3D-large-exhaustive-100-K1
 9/18 Test  #9: bench-3D-large-exhaustive-100-K1 ......   Passed    5.74 sec
      Start 10: bench-3D-large-random-K1
10/18 Test #10: bench-3D-large-random-K1 ..............   Passed    0.96 sec
      Start 11: bench-3D-large-exhaustive-10000-K10
11/18 Test #11: bench-3D-large-exhaustive-10000-K10 ...   Passed    3.60 sec
      Start 12: bench-3D-large-exhaustive-1000-K10
12/18 Test #12: bench-3D-large-exhaustive-1000-K10 ....   Passed    6.16 sec
      Start 13: bench-3D-large-exhaustive-100-K10
13/18 Test #13: bench-3D-large-exhaustive-100-K10 .....   Passed    9.61 sec
      Start 14: bench-3D-large-random-K20
14/18 Test #14: bench-3D-large-random-K20 .............   Passed    1.76 sec
      Start 15: bench-3D-large-exhaustive-10000-K30
15/18 Test #15: bench-3D-large-exhaustive-10000-K30 ...   Passed    8.07 sec
      Start 16: bench-3D-large-exhaustive-1000-K30
16/18 Test #16: bench-3D-large-exhaustive-1000-K30 ....   Passed   10.65 sec
      Start 17: bench-3D-large-exhaustive-100-K30
17/18 Test #17: bench-3D-large-exhaustive-100-K30 .....   Passed   16.64 sec
      Start 18: bench-3D-large-random-K30
18/18 Test #18: bench-3D-large-random-K30 .............   Passed    4.38 sec

100% tests passed, 0 tests failed out of 18

Total Test time (real) =  75.04 sec
mb18@mb18-Alienware-15-R3:~/Libraries/libnabo/build$ sudo make install
[ 21%] Built target nabo
[ 30%] Built target trivial
[ 39%] Built target usage
[ 47%] Built target knnbench
[ 56%] Built target knnepsilon
[ 65%] Built target knnvalidate
[ 73%] Built target knnbucketsize
[100%] Built target pynabo
Install the project...
-- Install configuration: "RelWithDebInfo"
-- Installing: /usr/local/lib/libnabo.a
-- Installing: /usr/local/include/nabo/nabo.h
-- Installing: /usr/local/include/nabo/third_party/any.hpp
-- Installing: /usr/local/share/doc/libnabo/README.md
-- Installing: /usr/local/share/libnabo/package.xml
-- Up-to-date: /usr/local/lib/libnabo.a
-- Installing: /usr/local/share/libnabo/cmake/libnabo-targets.cmake
-- Installing: /usr/local/share/libnabo/cmake/libnabo-targets-relwithdebinfo.cmake
-- Installing: /usr/local/share/libnabo/cmake/libnaboConfig.cmake
-- Installing: /usr/local/share/libnabo/cmake/libnaboConfigVersion.cmake
-- Installing: /usr/local/lib/python3.8/site-packages/pynabo.so
-- Set runtime path of "/usr/local/lib/python3.8/site-packages/pynabo.so" to ""
aguenette commented 3 years ago

Hi @maipbui! You have two options to be able to compile libpointmatcher:

  1. Use version 1.2.4, 1.3.0 or 1.3.1 of libpointmatcher and version 1.0.7 of libnabo, i.e. to check out their respective tag and build the libraries as follows.
  2. Use the latest changes of both libpointmatcher and libnabo, i.e. checkout their master branch and build the libraries as follows.

The reason is that the CMakeLists.txt file on the master branch of both libraries is not compatible with older version of the libraries.

maipbui commented 3 years ago

Hi @maipbui! You have two options to be able to compile libpointmatcher:

  1. Use version 1.2.4, 1.3.0 or 1.3.1 of libpointmatcher and version 1.0.7 of libnabo, i.e. to check out their respective tag and build the libraries as follows.
  2. Use the latest changes of both libpointmatcher and libnabo, i.e. checkout their master branch and build the libraries as follows.

The reason is that the CMakeLists.txt file on the master branch of both libraries is not compatible with older version of the libraries.

Hi @aguenette, thanks for the reply. I installed libnabo version 1.0.7 and libpointmatcher 1.2.4 but it failed so what should I do now as your suggestions?

aguenette commented 3 years ago

I'm also using Ubuntu 18.04 and I successfully builded libpointmatcher 1.2.4 using libnabo 1.0.7. So, what I suggest you to do is to start back from the beginning, i.e. uninstalling libnabo and removing the build directory, then redo the steps to build it and install it. Same thing for libpointmatcher, but only by removing the build directory.

maipbui commented 3 years ago

I'm also using Ubuntu 18.04 and I successfully builded libpointmatcher 1.2.4 using libnabo 1.0.7. So, what I suggest you to do is to start back from the beginning, i.e. uninstalling libnabo and removing the build directory, then redo the steps to build it and install it. Same thing for libpointmatcher, but only by removing the build directory.

Got what you meant, I was able to compile it. Thank you very much!!!

maipbui commented 3 years ago

Hello @aguenette,

Does package "libpointmatcher_ros" supported on Ubuntu 18.04, ROS Melodic? I tried to install other software but failed to compile because this below error message. I checked this documentation and see it is only release with fuerte, groovy, and hydro. Would it be possible to install "libpointmatcher_ros" on Ros Melodic and could you please show me how? Thanks for the help!

CMake Error at /opt/ros/melodic/share/catkin/cmake/catkinConfig.cmake:83 (find_package):
  Could not find a package configuration file provided by
  "libpointmatcher_ros" with any of the following names:

    libpointmatcher_rosConfig.cmake
    libpointmatcher_ros-config.cmake

  Add the installation prefix of "libpointmatcher_ros" to CMAKE_PREFIX_PATH
  or set "libpointmatcher_ros_DIR" to a directory containing one of the above
  files.  If "libpointmatcher_ros" provides a separate development package or
  SDK, be sure it has been installed.
Call Stack (most recent call first):
  map_compression/CMakeLists.txt:4 (find_package)

-- Configuring incomplete, errors occurred!
Chick92 commented 2 years ago

Same problem. Trying solution now, but the solution offered is essentially "use an older version", which seems counter productive.

pomerlef commented 2 years ago

@Chick92 please give us more details about your version and from where you are fetching them? I think there are multiple version of "libpointmatcher_ros" floating around.

We are currently supporting that one: https://github.com/norlab-ulaval/libpointmatcher_ros

Chick92 commented 2 years ago

Hi @pomerlef, i've just managed to successfully build it using the master branches from libpointmatcher and libnabo. I had always assumed that the master branches would be the default ones pulled, apparently not.

Thanks!

YibinWu commented 1 year ago

I tried all three branches of libpointmatcher but failed to make it. Then I switched to master and succeed. I used libnabo 1.0.7.

pomerlef commented 1 year ago

@YibinWu open another issue and follow https://github.com/ethz-asl/libpointmatcher/blob/master/doc/CompilationUbuntu.md to include the basic information.