gtrll / piper

Other
60 stars 22 forks source link

Build Error: Static assertion failed #12

Open dlee640 opened 3 years ago

dlee640 commented 3 years ago

I have gtsam 4.0.3 & gpmp2 both installed on my home directory.

When I try to $ catkin_make -DBUILD_ALL_INTERFACE:OPTION=ON, I get the error below.

dlee640@dlee640-T580:~/piper_ws$ catkin_make -DBUILD_ALL_INTERFACE:OPTION=ON
Base path: /home/dlee640/piper_ws
Source space: /home/dlee640/piper_ws/src
Build space: /home/dlee640/piper_ws/build
Devel space: /home/dlee640/piper_ws/devel
Install space: /home/dlee640/piper_ws/install
Creating symlink "/home/dlee640/piper_ws/src/CMakeLists.txt" pointing to "/opt/ros/melodic/share/catkin/cmake/toplevel.cmake"
####
#### Running command: "cmake /home/dlee640/piper_ws/src -DBUILD_ALL_INTERFACE:OPTION=ON -DCATKIN_DEVEL_PREFIX=/home/dlee640/piper_ws/devel -DCMAKE_INSTALL_PREFIX=/home/dlee640/piper_ws/install -G Unix Makefiles" in "/home/dlee640/piper_ws/build"
####
-- 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
-- Using CATKIN_DEVEL_PREFIX: /home/dlee640/piper_ws/devel
-- Using CMAKE_PREFIX_PATH: /home/dlee640/champ_ws/devel;/opt/ros/melodic
-- This workspace overlays: /home/dlee640/champ_ws/devel;/opt/ros/melodic
-- Found PythonInterp: /home/dlee640/.pyenv/shims/python2 (found suitable version "2.7.17", minimum required is "2") 
-- Using PYTHON_EXECUTABLE: /home/dlee640/.pyenv/shims/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/dlee640/piper_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: /home/dlee640/.pyenv/shims/python2 (found version "2.7.17") 
-- 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  
-- Using Python nosetests: /usr/bin/nosetests-2.7
-- catkin 0.7.29
-- BUILD_SHARED_LIBS is on
-- BUILD_SHARED_LIBS is on
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- ~~  traversing 1 packages in topological order:
-- ~~  - piper
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- +++ processing catkin package: 'piper'
-- ==> add_subdirectory(piper)
-- Using these message generators: gencpp;geneus;genlisp;gennodejs;genpy
-- Boost version: 1.65.1
-- Found the following Boost libraries:
--   serialization
--   system
--   filesystem
--   thread
--   program_options
--   date_time
--   timer
--   chrono
--   regex
--   atomic
-- GTSAM include directory:  /usr/local/lib/cmake/GTSAM/../../../include
-- gpmp2 include directory:  /usr/local/lib/cmake/gpmp2/../../../include
-- Configuring done
-- Generating done
-- Build files have been written to: /home/dlee640/piper_ws/build
####
#### Running command: "make -j8 -l8" in "/home/dlee640/piper_ws/build"
####
Scanning dependencies of target piperbase
[ 12%] Building CXX object piper/CMakeFiles/piperbase.dir/piper/base/traj.cpp.o
[ 37%] Building CXX object piper/CMakeFiles/piperbase.dir/piper/base/robot.cpp.o
[ 37%] Building CXX object piper/CMakeFiles/piperbase.dir/piper/base/problem.cpp.o
In file included from /usr/include/boost/math/policies/policy.hpp:20:0,
                 from /usr/include/boost/math/policies/error_handling.hpp:21,
                 from /usr/include/boost/math/special_functions/round.hpp:14,
                 from /opt/ros/melodic/include/ros/time.h:58,
                 from /opt/ros/melodic/include/ros/ros.h:38,
                 from /home/dlee640/piper_ws/src/piper/piper/base/robot.h:13,
                 from /home/dlee640/piper_ws/src/piper/piper/base/robot.cpp:8:
/usr/include/boost/optional/detail/optional_reference_spec.hpp: In instantiation of ‘void boost::detail::prevent_binding_rvalue() [with From = const Eigen::Matrix<double, -1, 1>&&]’:
/usr/include/boost/optional/detail/optional_reference_spec.hpp:165:81:   required from ‘boost::optional<T&>::optional(T&&) [with T = const Eigen::Matrix<double, -1, 1>]’
/home/dlee640/piper_ws/src/piper/piper/base/robot.cpp:63:125:   required from here
/usr/include/boost/optional/detail/optional_reference_spec.hpp:32:5: error: static assertion failed: binding rvalue references to optional lvalue references is disallowed
     BOOST_STATIC_ASSERT_MSG(boost::is_lvalue_reference<From>::value,
     ^
piper/CMakeFiles/piperbase.dir/build.make:86: recipe for target 'piper/CMakeFiles/piperbase.dir/piper/base/robot.cpp.o' failed
make[2]: *** [piper/CMakeFiles/piperbase.dir/piper/base/robot.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
CMakeFiles/Makefile2:516: recipe for target 'piper/CMakeFiles/piperbase.dir/all' failed
make[1]: *** [piper/CMakeFiles/piperbase.dir/all] Error 2
Makefile:140: recipe for target 'all' failed
make: *** [all] Error 2
Invoking "make -j8 -l8" failed

Where is this error coming from and how do I solve it?

sjnah commented 3 years ago

Try GTSAM as feature/Eigen branch (based on 4.0.0). Then no more Boost Error message.

and If some other error occurs, check PR of GPMP2 and merge manually. GPMP2, Piper seem to be no more updates/fix for more than two years. Perhaps, the GTSAM has been updated several times in the meantime, and some problems occurred.