ethz-asl / segmap

A map representation based on 3D segments
BSD 3-Clause "New" or "Revised" License
1.07k stars 393 forks source link

Compiling Segmap On Ubuntu16.04 #109

Closed ludennis closed 6 years ago

ludennis commented 6 years ago

Hi all,

I've been trying to get SegMap to work on my Ubuntu 16.04 machine for a few days.

I was able to follow the instruction to compile and install tensorflow 1.8 and catkin build tensorflow_ros_cpp with the following installed:

And now to compile SegMap with g++ 5.4 I got the following error:

Errors << segmapper:make /home/d300/segmap/logs/segmapper/build.make.000.log
In file included from /home/d300/segmap/devel/include/pointmatcher/PointMatcher.h:63:0, from /home/d300/segmap/src/laser_slam/laser_slam/include/laser_slam/common.hpp:10, from /home/d300/segmap/src/laser_slam/laser_slam/include/laser_slam/incremental_estimator.hpp:10, from /home/d300/segmap/src/segmap/segmapper/include/segmapper/segmapper.hpp:9, from /home/d300/segmap/src/segmap/segmapper/src/segmapper.cpp:1: /home/d300/segmap/devel/include/pointmatcher/Parametrizable.h:46:0: warning: "BOOST_ASSIGN_MAX_PARAMS" redefined

define BOOST_ASSIGN_MAX_PARAMS 6

^ In file included from /home/d300/segmap/devel/include/gtsam/nonlinear/NonlinearFactor.h:30:0, from /home/d300/segmap/devel/include/gtsam/nonlinear/NonlinearFactorGraph.h:25, from /home/d300/segmap/devel/include/gtsam/nonlinear/ISAM2.h:22, from /home/d300/segmap/src/laser_slam/laser_slam/include/laser_slam/incremental_estimator.hpp:7, from /home/d300/segmap/src/segmap/segmapper/include/segmapper/segmapper.hpp:9, from /home/d300/segmap/src/segmap/segmapper/src/segmapper.cpp:1: /usr/include/boost/assign/list_of.hpp:378:0: note: this is the location of the previous definition

define BOOST_ASSIGN_MAX_PARAMS 5

^ In file included from /home/d300/segmap/devel/include/pointmatcher/PointMatcher.h:63:0, from /home/d300/segmap/src/laser_slam/laser_slam/include/laser_slam/common.hpp:10, from /home/d300/segmap/src/laser_slam/laser_slam/include/laser_slam/incremental_estimator.hpp:10, from /home/d300/segmap/src/segmap/segmapper/include/segmapper/segmapper.hpp:9, from /home/d300/segmap/src/segmap/segmapper/src/segmapper_node.cpp:5: /home/d300/segmap/devel/include/pointmatcher/Parametrizable.h:46:0: warning: "BOOST_ASSIGN_MAX_PARAMS" redefined

define BOOST_ASSIGN_MAX_PARAMS 6

^ In file included from /home/d300/segmap/devel/include/gtsam/nonlinear/NonlinearFactor.h:30:0, from /home/d300/segmap/devel/include/gtsam/nonlinear/NonlinearFactorGraph.h:25, from /home/d300/segmap/devel/include/gtsam/nonlinear/ISAM2.h:22, from /home/d300/segmap/src/laser_slam/laser_slam/include/laser_slam/incremental_estimator.hpp:7, from /home/d300/segmap/src/segmap/segmapper/include/segmapper/segmapper.hpp:9, from /home/d300/segmap/src/segmap/segmapper/src/segmapper_node.cpp:5: /usr/include/boost/assign/list_of.hpp:378:0: note: this is the location of the previous definition

define BOOST_ASSIGN_MAX_PARAMS 5

^ /home/d300/segmap/devel/lib/libtf_graph_executor.so: undefined reference to tensorflow::ReadBinaryProto(tensorflow::Env*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, google::protobuf::MessageLite*)' /home/d300/segmap/devel/lib/libtf_graph_executor.so: undefined reference totensorflow::internal::CheckOpMessageBuilder::NewString[abi:cxx11]()' collect2: error: ld returned 1 exit status make[2]: [/home/d300/segmap/devel/lib/segmapper/segmapper_node] Error 1 make[1]: [CMakeFiles/segmapper_node.dir/all] Error 2 make: *** [all] Error 2 cd /home/d300/segmap/build/segmapper; catkin build --get-env segmapper | catkin env -si /usr/bin/make --jobserver-fds=6,7 -j; cd -

And the following error when I compile SegMap with g++ 4.8:

Errors << gtsam_catkin:make /home/d300/segmap/logs/gtsam_catkin/build.make.001.log
make[3]: warning: -jN forced in submake: disabling jobserver mode. ../gtsam/libgtsam.so.4.0.0: undefined reference to boost::archive::text_oarchive_impl<boost::archive::text_oarchive>::save(std::string const&)' collect2: error: ld returned 1 exit status make[5]: *** [examples/Pose2SLAMExampleExpressions] Error 1 make[4]: *** [examples/CMakeFiles/Pose2SLAMExampleExpressions.dir/all] Error 2 make[4]: *** Waiting for unfinished jobs.... ../gtsam/libgtsam.so.4.0.0: undefined reference toboost::archive::text_oarchive_impl::save(std::string const&)' collect2: error: ld returned 1 exit status make[5]: [examples/SFMExample_bal_COLAMD_METIS] Error 1 make[4]: [examples/CMakeFiles/SFMExample_bal_COLAMD_METIS.dir/all] Error 2 make[3]: [all] Error 2 make[2]: [gtsam_src-prefix/src/gtsam_src-stamp/gtsam_src-build] Error 2 make[1]: [CMakeFiles/gtsam_src.dir/all] Error 2 make: [all] Error 2 cd /home/d300/segmap/build/gtsam_catkin; catkin build --get-env gtsam_catkin | catkin env -si /usr/bin/make --jobserver-fds=6,7 -j; cd -

Errors << pcl_catkin:make /home/d300/segmap/logs/pcl_catkin/build.make.001.log
../../lib/libpcl_visualization.so.1.8.0: undefined reference to boost::filesystem::path_traits::dispatch(boost::filesystem::directory_entry const&, std::string&)' collect2: error: ld returned 1 exit status make[5]: *** [bin/pcl_oni_viewer] Error 1 make[4]: *** [visualization/tools/CMakeFiles/pcl_oni_viewer.dir/all] Error 2 make[4]: *** Waiting for unfinished jobs.... ../../lib/libpcl_visualization.so.1.8.0: undefined reference toboost::filesystem::path_traits::dispatch(boost::filesystem::directory_entry const&, std::string&)' collect2: error: ld returned 1 exit status make[5]: [bin/pcl_hdl_viewer_simple] Error 1 make[4]: [visualization/tools/CMakeFiles/pcl_hdl_viewer_simple.dir/all] Error 2 ../../lib/libpcl_visualization.so.1.8.0: undefined reference to boost::filesystem::path_traits::dispatch(boost::filesystem::directory_entry const&, std::string&)' collect2: error: ld returned 1 exit status ../../lib/libpcl_visualization.so.1.8.0: undefined reference toboost::filesystem::path_traits::dispatch(boost::filesystem::directory_entry const&, std::string&)' collect2: error: ld returned 1 exit status make[5]: [bin/pcl_openni_image] Error 1 make[4]: [visualization/tools/CMakeFiles/pcl_openni_image.dir/all] Error 2 make[5]: [bin/pcl_vlp_viewer] Error 1 make[4]: [visualization/tools/CMakeFiles/pcl_vlp_viewer.dir/all] Error 2 ../../lib/libpcl_visualization.so.1.8.0: undefined reference to boost::filesystem::path_traits::dispatch(boost::filesystem::directory_entry const&, std::string&)' collect2: error: ld returned 1 exit status make[5]: *** [bin/pcl_pcd_grabber_viewer] Error 1 make[4]: *** [visualization/tools/CMakeFiles/pcl_pcd_grabber_viewer.dir/all] Error 2 ../../lib/libpcl_visualization.so.1.8.0: undefined reference toboost::filesystem::path_traits::dispatch(boost::filesystem::directory_entry const&, std::string&)' collect2: error: ld returned 1 exit status make[5]: [bin/pcl_viewer] Error 1 make[4]: [visualization/tools/CMakeFiles/pcl_viewer.dir/all] Error 2 make[3]: [all] Error 2 make[2]: [pcl_src-prefix/src/pcl_src-stamp/pcl_src-build] Error 2 make[1]: [CMakeFiles/pcl_src.dir/all] Error 2 make: [all] Error 2 cd /home/d300/segmap/build/pcl_catkin; catkin build --get-env pcl_catkin | catkin env -si /usr/bin/make --jobserver-fds=6,7 -j; cd -

Any help would be appreciated, thanks!

Dennis Lu

tuandle commented 6 years ago

I had the first problem as you did #108 #106 . You can try to install TF by bazel as instructed in this, then I believe you can catkin build segmapper. I am not sure about the problem with different versions of g++ though. Is there any reason that you choose g++ 4.8 ?

smauq commented 6 years ago

Yes, I'd definitely not switch compilers between packages. I suggest doing catkin clean and also purging your ccache in case you're using it before trying again. In essence the error is similar to what @tuandle posted and either switching tensorflow versions or linking directly to the bazel install as described here should solve the issue with missing references to tensorflow.

ludennis commented 6 years ago

Hi @tuandle and @smauq, thanks for the prompt replies!

And yeah, switching between different compilers is definitely a bad idea (what was I doing there?).

I ended up recompiling tensorflow 1.9 with g++5.4/CUDA 8.0/cuDNN7.0, and changing some code in the cmake files in tensorflow_ros_cpp to make compiling possible.

The error of using g++5.4 was due to my tensorflow 1.8 being compiled with g++4.8. This produces an discrepancy in c++ ABI, for the system with g++ 5.4 will have used c++11 ABI to compile, and tensorflow with g++ 4.8 will have used c++03 ABI to compile. The incompatibility ended in an error when running catkin build segmapper.

But yeah, no more switching compilers. (I did learn how to use update-alternatives in the process, though!).

Dennis