Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation error on Eigen3 #9

Open
alexge233 opened this issue Dec 14, 2017 · 6 comments
Open

Compilation error on Eigen3 #9

alexge233 opened this issue Dec 14, 2017 · 6 comments

Comments

@alexge233
Copy link

Hi,

Thanks for the code! Sadly it fails to build with an Eigen static assertion error:

[ 50%] Building CXX object CMakeFiles/ORB_SLAM2.dir/src/Optimizer.cc.o
In file included from /usr/include/eigen3/Eigen/Core:297:0,
                 from /usr/local/include/pangolin/gl/gl.h:39,
                 from /usr/local/include/pangolin/pangolin.h:33,
                 from /home/zuperath/code/orb-slam2-gpu/include/MapDrawer.h:27,
                 from /home/zuperath/code/orb-slam2-gpu/include/Viewer.h:26,
                 from /home/zuperath/code/orb-slam2-gpu/include/Tracking.h:28,
                 from /home/zuperath/code/orb-slam2-gpu/include/LocalMapping.h:27,
                 from /home/zuperath/code/orb-slam2-gpu/include/LoopClosing.h:25,
                 from /home/zuperath/code/orb-slam2-gpu/include/Optimizer.h:27,
                 from /home/zuperath/code/orb-slam2-gpu/src/Optimizer.cc:21:
/usr/include/eigen3/Eigen/src/Core/AssignEvaluator.h: In instantiation of ‘void Eigen::internal::call_assignment_no_alias(Dst&, const Src&, const Func&) [with Dst = Eigen::Matrix<int, -1, 1>; Src = Eigen::Matrix<long int, -1, 1, 0, -1, 1>; Func = Eigen::internal::assign_op<int>]’:
/usr/include/eigen3/Eigen/src/Core/AssignEvaluator.h:712:27:   required from ‘void Eigen::internal::call_assignment(Dst&, const Src&, const Func&, typename Eigen::internal::enable_if<(! Eigen::internal::evaluator_assume_aliasing<Src>::value), void*>::type) [with Dst = Eigen::Matrix<int, -1, 1>; Src = Eigen::Matrix<long int, -1, 1, 0, -1, 1>; Func = Eigen::internal::assign_op<int>; typename Eigen::internal::enable_if<(! Eigen::internal::evaluator_assume_aliasing<Src>::value), void*>::type = void*]’
/usr/include/eigen3/Eigen/src/Core/AssignEvaluator.h:693:18:   required from ‘void Eigen::internal::call_assignment(Dst&, const Src&) [with Dst = Eigen::Matrix<int, -1, 1>; Src = Eigen::Matrix<long int, -1, 1, 0, -1, 1>]’
/usr/include/eigen3/Eigen/src/Core/PlainObjectBase.h:682:32:   required from ‘Derived& Eigen::PlainObjectBase<Derived>::_set(const Eigen::DenseBase<OtherDerived>&) [with OtherDerived = Eigen::Matrix<long int, -1, 1, 0, -1, 1>; Derived = Eigen::Matrix<int, -1, 1>]’
/usr/include/eigen3/Eigen/src/Core/Matrix.h:225:24:   required from ‘Eigen::Matrix<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols>& Eigen::Matrix<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols>::operator=(const Eigen::DenseBase<OtherDerived>&) [with OtherDerived = Eigen::Matrix<long int, -1, 1, 0, -1, 1>; _Scalar = int; int _Rows = -1; int _Cols = 1; int _Options = 0; int _MaxRows = -1; int _MaxCols = 1]’
/usr/include/eigen3/Eigen/src/Core/PermutationMatrix.h:367:17:   required from ‘Eigen::PermutationMatrix<SizeAtCompileTime, MaxSizeAtCompileTime, IndexType>& Eigen::PermutationMatrix<SizeAtCompileTime, MaxSizeAtCompileTime, IndexType>::operator=(const Eigen::PermutationBase<OtherDerived>&) [with Other = Eigen::PermutationMatrix<-1, -1, long int>; int SizeAtCompileTime = -1; int MaxSizeAtCompileTime = -1; _StorageIndex = int]’
/home/zuperath/code/orb-slam2-gpu/Thirdparty/g2o/g2o/solvers/linear_solver_eigen.h:68:18:   required from ‘void g2o::LinearSolverEigen<MatrixType>::CholeskyDecomposition::analyzePatternWithPermutation(g2o::LinearSolverEigen<MatrixType>::SparseMatrix&, const PermutationMatrix&) [with MatrixType = Eigen::Matrix<double, 7, 7, 0, 7, 7>; g2o::LinearSolverEigen<MatrixType>::SparseMatrix = Eigen::SparseMatrix<double, 0>; g2o::LinearSolverEigen<MatrixType>::PermutationMatrix = Eigen::PermutationMatrix<-1, -1, long int>]’
/home/zuperath/code/orb-slam2-gpu/Thirdparty/g2o/g2o/solvers/linear_solver_eigen.h:195:9:   required from ‘void g2o::LinearSolverEigen<MatrixType>::computeSymbolicDecomposition(const g2o::SparseBlockMatrix<MatrixType>&) [with MatrixType = Eigen::Matrix<double, 7, 7, 0, 7, 7>]’
/home/zuperath/code/orb-slam2-gpu/Thirdparty/g2o/g2o/solvers/linear_solver_eigen.h:100:37:   required from ‘bool g2o::LinearSolverEigen<MatrixType>::solve(const g2o::SparseBlockMatrix<MatrixType>&, double*, double*) [with MatrixType = Eigen::Matrix<double, 7, 7, 0, 7, 7>]’
/home/zuperath/code/orb-slam2-gpu/src/Optimizer.cc:1244:1:   required from here
/usr/include/eigen3/Eigen/src/Core/AssignEvaluator.h:745:3: error: static assertion failed: YOU_MIXED_DIFFERENT_NUMERIC_TYPES__YOU_NEED_TO_USE_THE_CAST_METHOD_OF_MATRIXBASE_TO_CAST_NUMERIC_TYPES_EXPLICITLY
   EIGEN_CHECK_BINARY_COMPATIBILIY(Func,typename ActualDstTypeCleaned::Scalar,typename Src::Scalar);
   ^
CMakeFiles/ORB_SLAM2.dir/build.make:378: recipe for target 'CMakeFiles/ORB_SLAM2.dir/src/Optimizer.cc.o' failed
make[2]: *** [CMakeFiles/ORB_SLAM2.dir/src/Optimizer.cc.o] Error 1
CMakeFiles/Makefile2:67: 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
@ashishbhatti
Copy link

raulmur/ORB_SLAM2#202 (comment)
This resolved this problem in my case.
I had other issues after that.

Linking CXX shared library lib/libORB_SLAM2.so
/usr/bin/ld: cannot find -lnvToolsExt
collect2: error: ld returned 1 exit status
CMakeFiles/ORB_SLAM2.dir/build.make:1957: recipe for target 'lib/libORB_SLAM2.so' failed
make[2]: *** [lib/libORB_SLAM2.so] Error 1
CMakeFiles/Makefile2:67: 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

@Warsin
Copy link

Warsin commented May 14, 2018

This resolved this problem in my case.
I had other issues after that.

Linking CXX shared library lib/libORB_SLAM2.so
/usr/bin/ld: cannot find -lnvToolsExt
collect2: error: ld returned 1 exit status
CMakeFiles/ORB_SLAM2.dir/build.make:1957: recipe for target 'lib/libORB_SLAM2.so' failed
make[2]: *** [lib/libORB_SLAM2.so] Error 1
CMakeFiles/Makefile2:67: 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

did you have solved it?

@Halcao
Copy link
Contributor

Halcao commented Jul 6, 2019

This resolved this problem in my case.
I had other issues after that.

Linking CXX shared library lib/libORB_SLAM2.so
/usr/bin/ld: cannot find -lnvToolsExt
collect2: error: ld returned 1 exit status
CMakeFiles/ORB_SLAM2.dir/build.make:1957: recipe for target 'lib/libORB_SLAM2.so' failed
make[2]: *** [lib/libORB_SLAM2.so] Error 1
CMakeFiles/Makefile2:67: 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

did you have solved it?

You should find libnvToolsExt.so and copy/link it to your library path.
In my case, the shared library path is /usr/local/cuda-9.0/targets/aarch64-linux/lib/libnvToolsExt.so

@mindmad
Copy link

mindmad commented Feb 14, 2022

Hi @yunchih , @Halcao .
I had a similar error with eigen , here is the error log:

-- Configuring incomplete, errors occurred!
See also "/home/mad/ORB_SLAM2/build/CMakeFiles/CMakeOutput.log".
See also "/home/mad/ORB_SLAM2/build/CMakeFiles/CMakeError.log".
[  3%] Linking CXX shared library ../lib/libORB_SLAM2.so
/usr/bin/ld: cannot find -lEigen3::Eigen
collect2: error: ld returned 1 exit status
CMakeFiles/ORB_SLAM2.dir/build.make:601: recipe for target '../lib/libORB_SLAM2.so' failed
make[2]: *** [../lib/libORB_SLAM2.so] Error 1
CMakeFiles/Makefile2:252: 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

I tried with all the solutions in this issue it did not work
any help how to solve this error. thank you in advance.

@yunchih
Copy link
Owner

yunchih commented Feb 15, 2022

Did you follow this?

@mindmad
Copy link

mindmad commented Feb 17, 2022

Did you follow this?

thank you for your reply. I found that Pangolin version was the problem I installed 0.5 version instead and it solved the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants