Orb_slam2: Fail to build ORB-SLAM2

Created on 26 Nov 2016  路  6Comments  路  Source: raulmur/ORB_SLAM2

Hello, all
I have some trouble during running command "./build.sh". the error is shown below. Thank you for all help in advance.

My working environment is:
OS: Ubuntu 16.04 [mate odroid ux3]
GCC/G++: 5.4.0
Eigen: 3.3~beta1-2

[ 59%] Building CXX object CMakeFiles/ORB_SLAM2.dir/src/Initializer.cc.o
c++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See for instructions.
CMakeFiles/ORB_SLAM2.dir/build.make:134: recipe for target 'CMakeFiles/ORB_SLAM2.dir/src/LoopClosing.cc.o' failed
make[2]: * [CMakeFiles/ORB_SLAM2.dir/src/LoopClosing.cc.o] Error 4
c++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See for instructions.
CMakeFiles/ORB_SLAM2.dir/build.make:110: recipe for target 'CMakeFiles/ORB_SLAM2.dir/src/LocalMapping.cc.o' failed
make[2]:
[CMakeFiles/ORB_SLAM2.dir/src/LocalMapping.cc.o] Error 4
c++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See for instructions.
CMakeFiles/ORB_SLAM2.dir/build.make:470: recipe for target 'CMakeFiles/ORB_SLAM2.dir/src/Initializer.cc.o' failed
make[2]:
[CMakeFiles/ORB_SLAM2.dir/src/Initializer.cc.o] Error 4
c++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See for instructions.
CMakeFiles/ORB_SLAM2.dir/build.make:254: recipe for target 'CMakeFiles/ORB_SLAM2.dir/src/MapPoint.cc.o' failed
make[2]:
[CMakeFiles/ORB_SLAM2.dir/src/MapPoint.cc.o] Error 4
c++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See for instructions.
CMakeFiles/ORB_SLAM2.dir/build.make:206: recipe for target 'CMakeFiles/ORB_SLAM2.dir/src/FrameDrawer.cc.o' failed
make[2]:
[CMakeFiles/ORB_SLAM2.dir/src/FrameDrawer.cc.o] Error 4
c++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See for instructions.
CMakeFiles/ORB_SLAM2.dir/build.make:62: recipe for target 'CMakeFiles/ORB_SLAM2.dir/src/System.cc.o' failed
make[2]:
[CMakeFiles/ORB_SLAM2.dir/src/System.cc.o] Error 4
c++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See for instructions.
CMakeFiles/ORB_SLAM2.dir/build.make:230: recipe for target 'CMakeFiles/ORB_SLAM2.dir/src/Converter.cc.o' failed
make[2]:
[CMakeFiles/ORB_SLAM2.dir/src/Converter.cc.o] Error 4
c++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See for instructions.
CMakeFiles/ORB_SLAM2.dir/build.make:350: recipe for target 'CMakeFiles/ORB_SLAM2.dir/src/Optimizer.cc.o' failed
make[2]:
[CMakeFiles/ORB_SLAM2.dir/src/Optimizer.cc.o] Error 4
c++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See for instructions.
CMakeFiles/ORB_SLAM2.dir/build.make:398: recipe for target 'CMakeFiles/ORB_SLAM2.dir/src/Frame.cc.o' failed
make[2]:
[CMakeFiles/ORB_SLAM2.dir/src/Frame.cc.o] Error 4
CMakeFiles/Makefile2:104: recipe for target 'CMakeFiles/ORB_SLAM2.dir/all' failed
make[1]:
[CMakeFiles/ORB_SLAM2.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *
* [all] Error 2

Most helpful comment

thx cranil :)
Let me add the name of the file in question :
Thirdparty/g2o/g2o/solvers/linear_solver_eigen.h

typedef Eigen::PermutationMatrix PermutationMatrix;
to typedef Eigen::PermutationMatrix PermutationMatrix;

Also don't forget to add this line on most files.cc ( in the top )

include

File in folder src:
LocalMapping.cc
System.cc
Tracking.cc
Viewer.cc
LoopClosing.cc

And in folder Examples...
stereo_euroc.cc
stereo_kitti.cc
rgbd_tum.cc
mono_kitti.cc
mono_tum.cc
mono_euro.cc

All 6 comments

Looks like your compiler is dying, so not sure if this is the same issue I've had. I fixed it by changing typedef Eigen::PermutationMatrix<Eigen::Dynamic, Eigen::Dynamic, SparseMatrix::Index> PermutationMatrix;
to typedef Eigen::PermutationMatrix<Eigen::Dynamic, Eigen::Dynamic, SparseMatrix::StorageIndex> PermutationMatrix;

-- Anil.

thx cranil :)
Let me add the name of the file in question :
Thirdparty/g2o/g2o/solvers/linear_solver_eigen.h

typedef Eigen::PermutationMatrix PermutationMatrix;
to typedef Eigen::PermutationMatrix PermutationMatrix;

Also don't forget to add this line on most files.cc ( in the top )

include

File in folder src:
LocalMapping.cc
System.cc
Tracking.cc
Viewer.cc
LoopClosing.cc

And in folder Examples...
stereo_euroc.cc
stereo_kitti.cc
rgbd_tum.cc
mono_kitti.cc
mono_tum.cc
mono_euro.cc

I am having a similar problem..

-- Build files have been written to: /home/raktim/ORB_SLAM2/Examples/ROS/ORB_SLAM2/build
[ 0%] Built target rospack_genmsg_libexe
[ 0%] Built target rosbuild_precompile
make[2]: * No rule to make target '../../../../lib/libORB_SLAM2.so', needed by '../Stereo'. Stop.
CMakeFiles/Makefile2:104: recipe for target 'CMakeFiles/Stereo.dir/all' failed
make[1]:
[CMakeFiles/Stereo.dir/all] Error 2
make[1]:
Waiting for unfinished jobs....
make[2]:
No rule to make target '../../../../lib/libORB_SLAM2.so', needed by '../Mono'. Stop.
CMakeFiles/Makefile2:718: recipe for target 'CMakeFiles/Mono.dir/all' failed
make[1]:
[CMakeFiles/Mono.dir/all] Error 2
make[2]:
No rule to make target '../../../../lib/libORB_SLAM2.so', needed by '../RGBD'. Stop.
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/RGBD.dir/all' failed
make[1]:
[CMakeFiles/RGBD.dir/all] Error 2
make[2]:
No rule to make target '../../../../lib/libORB_SLAM2.so', needed by '../MonoAR'. Stop.
CMakeFiles/Makefile2:820: recipe for target 'CMakeFiles/MonoAR.dir/all' failed
make[1]:
[CMakeFiles/MonoAR.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *
[all] Error 2

The solutions cranil and callsty worked for me. Don't forget to cmake, make and then build after making the changes. :) I forgot, so I am guessing there might be someone who might forget to do that in the end.

I faced the following error while building ORBSLAM2 plz help me to fix this error.

[ 84%] Linking CXX executable ../Examples/Monocular/mono_kitti
[ 87%] Linking CXX executable ../Examples/Monocular/mono_tum
[ 90%] Linking CXX executable ../Examples/RGB-D/rgbd_tum
[ 93%] Linking CXX executable ../Examples/Stereo/stereo_kitti
[ 96%] Linking CXX executable ../Examples/Stereo/stereo_euroc
[100%] Linking CXX executable ../Examples/Monocular/mono_euroc
/usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/libOpenGL.so: undefined reference to _glapi_tls_Current' collect2: error: ld returned 1 exit status CMakeFiles/mono_kitti.dir/build.make:153: recipe for target '../Examples/Monocular/mono_kitti' failed make[2]: *** [../Examples/Monocular/mono_kitti] Error 1 CMakeFiles/Makefile2:109: recipe for target 'CMakeFiles/mono_kitti.dir/all' failed make[1]: *** [CMakeFiles/mono_kitti.dir/all] Error 2 make[1]: *** Waiting for unfinished jobs.... /usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/libOpenGL.so: undefined reference to_glapi_tls_Current'
collect2: error: ld returned 1 exit status
CMakeFiles/mono_tum.dir/build.make:153: recipe for target '../Examples/Monocular/mono_tum' failed
make[2]: * [../Examples/Monocular/mono_tum] Error 1
CMakeFiles/Makefile2:146: recipe for target 'CMakeFiles/mono_tum.dir/all' failed
make[1]:
[CMakeFiles/mono_tum.dir/all] Error 2
/usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/libOpenGL.so: undefined reference to _glapi_tls_Current' collect2: error: ld returned 1 exit status CMakeFiles/rgbd_tum.dir/build.make:153: recipe for target '../Examples/RGB-D/rgbd_tum' failed make[2]: *** [../Examples/RGB-D/rgbd_tum] Error 1 CMakeFiles/Makefile2:257: recipe for target 'CMakeFiles/rgbd_tum.dir/all' failed make[1]: *** [CMakeFiles/rgbd_tum.dir/all] Error 2 /usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/libOpenGL.so: undefined reference to_glapi_tls_Current'
collect2: error: ld returned 1 exit status
CMakeFiles/stereo_kitti.dir/build.make:153: recipe for target '../Examples/Stereo/stereo_kitti' failed
make[2]:
[../Examples/Stereo/stereo_kitti] Error 1
CMakeFiles/Makefile2:220: recipe for target 'CMakeFiles/stereo_kitti.dir/all' failed
make[1]:
[CMakeFiles/stereo_kitti.dir/all] Error 2
/usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/libOpenGL.so: undefined reference to _glapi_tls_Current' collect2: error: ld returned 1 exit status CMakeFiles/mono_euroc.dir/build.make:153: recipe for target '../Examples/Monocular/mono_euroc' failed make[2]: *** [../Examples/Monocular/mono_euroc] Error 1 CMakeFiles/Makefile2:72: recipe for target 'CMakeFiles/mono_euroc.dir/all' failed make[1]: *** [CMakeFiles/mono_euroc.dir/all] Error 2 /usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/libOpenGL.so: undefined reference to_glapi_tls_Current'
collect2: error: ld returned 1 exit status
CMakeFiles/stereo_euroc.dir/build.make:153: recipe for target '../Examples/Stereo/stereo_euroc' failed
make[2]:
[../Examples/Stereo/stereo_euroc] Error 1
CMakeFiles/Makefile2:183: recipe for target 'CMakeFiles/stereo_euroc.dir/all' failed
make[1]:
[CMakeFiles/stereo_euroc.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *
* [all] Error 2

I am having a similar problem..

-- Build files have been written to: /home/raktim/ORB_SLAM2/Examples/ROS/ORB_SLAM2/build
[ 0%] Built target rospack_genmsg_libexe
[ 0%] Built target rosbuild_precompile
make[2]: * No rule to make target '../../../../lib/libORB_SLAM2.so', needed by '../Stereo'. Stop.
CMakeFiles/Makefile2:104: recipe for target 'CMakeFiles/Stereo.dir/all' failed
make[1]:
[CMakeFiles/Stereo.dir/all] Error 2
make[1]:
Waiting for unfinished jobs....
make[2]:
No rule to make target '../../../../lib/libORB_SLAM2.so', needed by '../Mono'. Stop.
CMakeFiles/Makefile2:718: recipe for target 'CMakeFiles/Mono.dir/all' failed
make[1]:
[CMakeFiles/Mono.dir/all] Error 2
make[2]:
No rule to make target '../../../../lib/libORB_SLAM2.so', needed by '../RGBD'. Stop.
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/RGBD.dir/all' failed
make[1]:
[CMakeFiles/RGBD.dir/all] Error 2
make[2]:
No rule to make target '../../../../lib/libORB_SLAM2.so', needed by '../MonoAR'. Stop.
CMakeFiles/Makefile2:820: recipe for target 'CMakeFiles/MonoAR.dir/all' failed
make[1]:
[CMakeFiles/MonoAR.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *
[all] Error 2

How did you fix it eventually?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Gaoxiang-Zhang picture Gaoxiang-Zhang  路  3Comments

sunstarchan picture sunstarchan  路  4Comments

nik13 picture nik13  路  5Comments

EasternH picture EasternH  路  5Comments

jinfagang picture jinfagang  路  4Comments