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

compile error... #1

Closed
YisenYu opened this issue Oct 16, 2018 · 16 comments
Closed

compile error... #1

YisenYu opened this issue Oct 16, 2018 · 16 comments

Comments

@YisenYu
Copy link

YisenYu commented Oct 16, 2018

Thank you for the excellent work!

There seems to be a compile error, here is the log:
[ 18%] Building CXX object src/CMakeFiles/ldso.dir/Map.cc.o
In file included from /usr/include/eigen3/Eigen/StdVector:23:0,
from /Works/LDSO/thirdparty/g2o/g2o/core/jacobian_workspace.h:31,
from /Works/LDSO/thirdparty/g2o/g2o/core/optimizable_graph.h:41,
from /Works/LDSO/thirdparty/g2o/g2o/core/base_vertex.h:30,
from /Works/LDSO/include/internal/PR.h:8,
from /Works/LDSO/src/Map.cc:8:
/usr/include/eigen3/Eigen/src/StlSupport/StdVector.h:69:9: error: partial specialization of ‘std::vector<T, Eigen::aligned_allocator >’ after instantiation of ‘std::vector<ldso::internal::FrameFramePrecalc, Eigen::aligned_allocatorldso::internal::FrameFramePrecalc >’ [-fpermissive]
class vector<T,EIGEN_ALIGNED_ALLOCATOR >
^

@NikolausDemmel
Copy link
Contributor

Can you please provide more information:

  • what operating system, which compiler?
  • how do you call cmake? what is the (full) output?
  • how do you call make?

@YisenYu
Copy link
Author

YisenYu commented Oct 16, 2018

I'm on Ubuntu14.04 64bit, gcc/g++ 4.9.4, cmake3.10.3
After installing all the dependencies, I directly use ./make_project.sh to build. DBoW3 and g2o are built successully, while ldso failed.
Here is the full output of ./make_project.sh:

==================================================
-- Configuring done
-- Generating done
-- Build files have been written to: /Works/LDSO/thirdparty/DBoW3/build
[100%] Built target DBoW3
mkdir: cannot create directory ‘build’: File exists
-- BUILD TYPE:Release
-- Compiling on Unix
CMake Warning (dev) at /usr/share/cmake-3.10/Modules/FindOpenMP.cmake:310 (if):
if given arguments:
"TRUE"
An argument named "TRUE" appears in a conditional statement. Policy
CMP0012 is not set: if() recognizes numbers and boolean constants. Run
"cmake --help-policy CMP0012" for policy details. Use the cmake_policy
command to set the policy and suppress this warning.
Call Stack (most recent call first):
/usr/share/cmake-3.10/Modules/FindOpenMP.cmake:425 (_OPENMP_GET_SPEC_DATE)
CMakeLists.txt:47 (FIND_PACKAGE)
This warning is for project developers. Use -Wno-dev to suppress it.

CMake Warning (dev) at /usr/share/cmake-3.10/Modules/FindOpenMP.cmake:310 (if):
if given arguments:
"TRUE"
An argument named "TRUE" appears in a conditional statement. Policy
CMP0012 is not set: if() recognizes numbers and boolean constants. Run
"cmake --help-policy CMP0012" for policy details. Use the cmake_policy
command to set the policy and suppress this warning.
Call Stack (most recent call first):
/usr/share/cmake-3.10/Modules/FindOpenMP.cmake:425 (_OPENMP_GET_SPEC_DATE)
CMakeLists.txt:47 (FIND_PACKAGE)
This warning is for project developers. Use -Wno-dev to suppress it.

-- Configuring done
-- Generating done
-- Build files have been written to: /Works/LDSO/thirdparty/g2o/build
[100%] Built target g2o
-- The C compiler identification is GNU 4.9.4
-- The CXX compiler identification is GNU 4.9.4
-- 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
-- Found Eigen3: /usr/include/eigen3 (Required is at least version "2.91.0")
-- Found Glog: /usr/include
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.26")
-- Found LIBZIP: /usr/local/lib/libzip.so
--- found ziplib (1.1.1), compiling with zip capability.
-- Configuring done
-- Generating done
-- Build files have been written to: /Works/LDSO/build
--- found ziplib (1.1.1), compiling with zip capability.
-- Configuring done
-- Generating done
-- Build files have been written to: /Works/LDSO/build
Scanning dependencies of target ldso
make[2]: Warning: File `src/CMakeFiles/ldso.dir/depend.make' has modification time 0.036 s in the future
[ 6%] Building CXX object src/CMakeFiles/ldso.dir/Feature.cc.o
[ 9%] Building CXX object src/CMakeFiles/ldso.dir/Point.cc.o
[ 12%] Building CXX object src/CMakeFiles/ldso.dir/Frame.cc.o
[ 12%] Building CXX object src/CMakeFiles/ldso.dir/Setting.cc.o
[ 15%] Building CXX object src/CMakeFiles/ldso.dir/Camera.cc.o
In file included from /Works/LDSO/thirdparty/DBoW3/src/DBoW3.h:60:0,
from /Works/LDSO/include/NumTypes.h:16,
from /Works/LDSO/include/Camera.h:5,
from /Works/LDSO/src/Camera.cc:1:
/Works/LDSO/thirdparty/DBoW3/src/Database.h:31:12: warning: ‘DBoW3::MIN_COMMON_WORDS’ defined but not used [-Wunused-variable]
static int MIN_COMMON_WORDS = 5;
^
cc1plus: warning: unrecognized command line option "-Wno-duplicate-decl-specifier"
[ 18%] Building CXX object src/CMakeFiles/ldso.dir/Map.cc.o
In file included from /Works/LDSO/thirdparty/DBoW3/src/DBoW3.h:60:0,
from /Works/LDSO/include/NumTypes.h:16,
from /Works/LDSO/include/Feature.h:9,
from /Works/LDSO/src/Feature.cc:1:
/Works/LDSO/thirdparty/DBoW3/src/Database.h:31:12: warning: ‘DBoW3::MIN_COMMON_WORDS’ defined but not used [-Wunused-variable]
static int MIN_COMMON_WORDS = 5;
^
cc1plus: warning: unrecognized command line option "-Wno-duplicate-decl-specifier"
[ 21%] Building CXX object src/CMakeFiles/ldso.dir/internal/PointHessian.cc.o
In file included from /Works/LDSO/thirdparty/DBoW3/src/DBoW3.h:60:0,
from /Works/LDSO/include/NumTypes.h:16,
from /Works/LDSO/include/Feature.h:9,
from /Works/LDSO/src/Point.cc:1:
/Works/LDSO/thirdparty/DBoW3/src/Database.h:31:12: warning: ‘DBoW3::MIN_COMMON_WORDS’ defined but not used [-Wunused-variable]
static int MIN_COMMON_WORDS = 5;
^
cc1plus: warning: unrecognized command line option "-Wno-duplicate-decl-specifier"
[ 24%] Building CXX object src/CMakeFiles/ldso.dir/internal/FrameHessian.cc.o
In file included from /Works/LDSO/thirdparty/DBoW3/src/DBoW3.h:60:0,
from /Works/LDSO/include/NumTypes.h:16,
from /Works/LDSO/include/Point.h:6,
from /Works/LDSO/include/internal/PointHessian.h:5,
from /Works/LDSO/src/internal/PointHessian.cc:2:
/Works/LDSO/thirdparty/DBoW3/src/Database.h:31:12: warning: ‘DBoW3::MIN_COMMON_WORDS’ defined but not used [-Wunused-variable]
static int MIN_COMMON_WORDS = 5;
^
cc1plus: warning: unrecognized command line option "-Wno-duplicate-decl-specifier"
[ 27%] Building CXX object src/CMakeFiles/ldso.dir/internal/GlobalCalib.cc.o
In file included from /Works/LDSO/thirdparty/DBoW3/src/DBoW3.h:60:0,
from /Works/LDSO/include/NumTypes.h:16,
from /Works/LDSO/include/Frame.h:12,
from /Works/LDSO/src/Frame.cc:1:
/Works/LDSO/thirdparty/DBoW3/src/Database.h:31:12: warning: ‘DBoW3::MIN_COMMON_WORDS’ defined but not used [-Wunused-variable]
static int MIN_COMMON_WORDS = 5;
^
cc1plus: warning: unrecognized command line option "-Wno-duplicate-decl-specifier"
[ 30%] Building CXX object src/CMakeFiles/ldso.dir/internal/FrameFramePrecalc.cc.o
In file included from /usr/include/eigen3/Eigen/StdVector:23:0,
from /Works/LDSO/thirdparty/g2o/g2o/core/jacobian_workspace.h:31,
from /Works/LDSO/thirdparty/g2o/g2o/core/optimizable_graph.h:41,
from /Works/LDSO/thirdparty/g2o/g2o/core/base_vertex.h:30,
from /Works/LDSO/include/internal/PR.h:8,
from /Works/LDSO/src/Map.cc:8:
/usr/include/eigen3/Eigen/src/StlSupport/StdVector.h:69:9: error: partial specialization of ‘std::vector<T, Eigen::aligned_allocator >’ after instantiation of ‘std::vector<ldso::internal::FrameFramePrecalc, Eigen::aligned_allocatorldso::internal::FrameFramePrecalc >’ [-fpermissive]
class vector<T,EIGEN_ALIGNED_ALLOCATOR >
^
In file included from /Works/LDSO/thirdparty/DBoW3/src/DBoW3.h:60:0,
from /Works/LDSO/include/NumTypes.h:16,
from /Works/LDSO/include/internal/GlobalCalib.h:5,
from /Works/LDSO/src/internal/GlobalCalib.cc:1:
/Works/LDSO/thirdparty/DBoW3/src/Database.h:31:12: warning: ‘DBoW3::MIN_COMMON_WORDS’ defined but not used [-Wunused-variable]
static int MIN_COMMON_WORDS = 5;
^
cc1plus: warning: unrecognized command line option "-Wno-duplicate-decl-specifier"
[ 33%] Building CXX object src/CMakeFiles/ldso.dir/internal/Residuals.cc.o
In file included from /Works/LDSO/thirdparty/DBoW3/src/DBoW3.h:60:0,
from /Works/LDSO/include/NumTypes.h:16,
from /Works/LDSO/include/Frame.h:12,
from /Works/LDSO/include/internal/FrameHessian.h:5,
from /Works/LDSO/src/internal/FrameHessian.cc:1:
/Works/LDSO/thirdparty/DBoW3/src/Database.h:31:12: warning: ‘DBoW3::MIN_COMMON_WORDS’ defined but not used [-Wunused-variable]
static int MIN_COMMON_WORDS = 5;
^
cc1plus: warning: unrecognized command line option "-Wno-duplicate-decl-specifier"
[ 36%] Building CXX object src/CMakeFiles/ldso.dir/internal/ImmaturePoint.cc.o
In file included from /Works/LDSO/thirdparty/DBoW3/src/DBoW3.h:60:0,
from /Works/LDSO/include/NumTypes.h:16,
from /Works/LDSO/include/internal/FrameFramePrecalc.h:5,
from /Works/LDSO/src/internal/FrameFramePrecalc.cc:1:
/Works/LDSO/thirdparty/DBoW3/src/Database.h:31:12: warning: ‘DBoW3::MIN_COMMON_WORDS’ defined but not used [-Wunused-variable]
static int MIN_COMMON_WORDS = 5;
^
cc1plus: warning: unrecognized command line option "-Wno-duplicate-decl-specifier"
[ 39%] Building CXX object src/CMakeFiles/ldso.dir/internal/PR.cc.o
In file included from /Works/LDSO/thirdparty/DBoW3/src/DBoW3.h:60:0,
from /Works/LDSO/include/NumTypes.h:16,
from /Works/LDSO/include/internal/Residuals.h:9,
from /Works/LDSO/src/internal/Residuals.cc:1:
/Works/LDSO/thirdparty/DBoW3/src/Database.h:31:12: warning: ‘DBoW3::MIN_COMMON_WORDS’ defined but not used [-Wunused-variable]
static int MIN_COMMON_WORDS = 5;
^
cc1plus: warning: unrecognized command line option "-Wno-duplicate-decl-specifier"
In file included from /Works/LDSO/thirdparty/DBoW3/src/DBoW3.h:60:0,
from /Works/LDSO/include/NumTypes.h:16,
from /Works/LDSO/include/Frame.h:12,
from /Works/LDSO/src/internal/ImmaturePoint.cc:1:
/Works/LDSO/thirdparty/DBoW3/src/Database.h:31:12: warning: ‘DBoW3::MIN_COMMON_WORDS’ defined but not used [-Wunused-variable]
static int MIN_COMMON_WORDS = 5;
^
cc1plus: warning: unrecognized command line option "-Wno-duplicate-decl-specifier"
[ 42%] Building CXX object src/CMakeFiles/ldso.dir/internal/OptimizationBackend/AccumulatedSCHessian.cc.o
[ 45%] Building CXX object src/CMakeFiles/ldso.dir/internal/OptimizationBackend/AccumulatedTopHessian.cc.o
In file included from /Works/LDSO/thirdparty/DBoW3/src/DBoW3.h:60:0,
from /Works/LDSO/include/NumTypes.h:16,
from /Works/LDSO/include/internal/OptimizationBackend/AccumulatedTopHessian.h:5,
from /Works/LDSO/src/internal/OptimizationBackend/AccumulatedTopHessian.cc:1:
/Works/LDSO/thirdparty/DBoW3/src/Database.h:31:12: warning: ‘DBoW3::MIN_COMMON_WORDS’ defined but not used [-Wunused-variable]
static int MIN_COMMON_WORDS = 5;
^
cc1plus: warning: unrecognized command line option "-Wno-duplicate-decl-specifier"
[ 48%] Building CXX object src/CMakeFiles/ldso.dir/internal/OptimizationBackend/EnergyFunctional.cc.o
In file included from /Works/LDSO/thirdparty/DBoW3/src/DBoW3.h:60:0,
from /Works/LDSO/include/NumTypes.h:16,
from /Works/LDSO/include/internal/OptimizationBackend/EnergyFunctional.h:5,
from /Works/LDSO/src/internal/OptimizationBackend/AccumulatedSCHessian.cc:1:
/Works/LDSO/thirdparty/DBoW3/src/Database.h:31:12: warning: ‘DBoW3::MIN_COMMON_WORDS’ defined but not used [-Wunused-variable]
static int MIN_COMMON_WORDS = 5;
^
cc1plus: warning: unrecognized command line option "-Wno-duplicate-decl-specifier"
[ 51%] Building CXX object src/CMakeFiles/ldso.dir/frontend/CoarseTracker.cc.o
/Works/LDSO/src/frontend/CoarseTracker.cc: In member function ‘bool ldso::CoarseTracker::trackNewestCoarse(std::shared_ptrldso::internal::FrameHessian, SE3&, ldso::AffLight&, int, Vec5)’:
/Works/LDSO/src/frontend/CoarseTracker.cc:161:23: warning: variable ‘relAff’ set but not used [-Wunused-but-set-variable]
Vec2f relAff = AffLight::fromToVecExposure(lastRef->ab_exposure, newFrame->ab_exposure,
^
/Works/LDSO/src/frontend/CoarseTracker.cc:101:19: warning: variable ‘relAff’ set but not used [-Wunused-but-set-variable]
Vec2f relAff = AffLight::fromToVecExposure(lastRef->ab_exposure, newFrame->ab_exposure, lastRef_aff_g2l,
^
In file included from /Works/LDSO/thirdparty/DBoW3/src/DBoW3.h:60:0,
from /Works/LDSO/include/NumTypes.h:16,
from /Works/LDSO/include/internal/PR.h:5,
from /Works/LDSO/src/internal/PR.cc:1:
/Works/LDSO/thirdparty/DBoW3/src/Database.h:31:12: warning: ‘DBoW3::MIN_COMMON_WORDS’ defined but not used [-Wunused-variable]
static int MIN_COMMON_WORDS = 5;
^
cc1plus: warning: unrecognized command line option "-Wno-duplicate-decl-specifier"
[ 54%] Building CXX object src/CMakeFiles/ldso.dir/frontend/CoarseInitializer.cc.o
In file included from /Works/LDSO/thirdparty/DBoW3/src/DBoW3.h:60:0,
from /Works/LDSO/include/NumTypes.h:16,
from /Works/LDSO/include/Map.h:5,
from /Works/LDSO/src/Map.cc:1:
/Works/LDSO/thirdparty/DBoW3/src/Database.h:31:12: warning: ‘DBoW3::MIN_COMMON_WORDS’ defined but not used [-Wunused-variable]
static int MIN_COMMON_WORDS = 5;
^
cc1plus: warning: unrecognized command line option "-Wno-duplicate-decl-specifier"
make[2]: *** [src/CMakeFiles/ldso.dir/Map.cc.o] Error 1
make[2]: *** Waiting for unfinished jobs....
In file included from /Works/LDSO/thirdparty/DBoW3/src/DBoW3.h:60:0,
from /Works/LDSO/include/NumTypes.h:16,
from /Works/LDSO/include/Feature.h:9,
from /Works/LDSO/src/frontend/CoarseTracker.cc:1:
/Works/LDSO/thirdparty/DBoW3/src/Database.h: At global scope:
/Works/LDSO/thirdparty/DBoW3/src/Database.h:31:12: warning: ‘DBoW3::MIN_COMMON_WORDS’ defined but not used [-Wunused-variable]
static int MIN_COMMON_WORDS = 5;
^
cc1plus: warning: unrecognized command line option "-Wno-duplicate-decl-specifier"
In file included from /Works/LDSO/thirdparty/DBoW3/src/DBoW3.h:60:0,
from /Works/LDSO/include/NumTypes.h:16,
from /Works/LDSO/include/Frame.h:12,
from /Works/LDSO/include/internal/FrameHessian.h:5,
from /Works/LDSO/src/frontend/CoarseInitializer.cc:1:
/Works/LDSO/thirdparty/DBoW3/src/Database.h:31:12: warning: ‘DBoW3::MIN_COMMON_WORDS’ defined but not used [-Wunused-variable]
static int MIN_COMMON_WORDS = 5;
^
cc1plus: warning: unrecognized command line option "-Wno-duplicate-decl-specifier"
In file included from /Works/LDSO/thirdparty/DBoW3/src/DBoW3.h:60:0,
from /Works/LDSO/include/NumTypes.h:16,
from /Works/LDSO/include/Feature.h:9,
from /Works/LDSO/src/internal/OptimizationBackend/EnergyFunctional.cc:1:
/Works/LDSO/thirdparty/DBoW3/src/Database.h:31:12: warning: ‘DBoW3::MIN_COMMON_WORDS’ defined but not used [-Wunused-variable]
static int MIN_COMMON_WORDS = 5;
^
cc1plus: warning: unrecognized command line option "-Wno-duplicate-decl-specifier"
make[1]: *** [src/CMakeFiles/ldso.dir/all] Error 2
make: *** [all] Error 2

@NikolausDemmel
Copy link
Contributor

We haven't tested on 14.04, only 16.04 and clang on macos. Might be related to the compiler. I'll have to look into it to determine what the proper fix is. Maybe you can do some digging too.

A quick search reveals a possible issue with Eigen:

@YisenYu
Copy link
Author

YisenYu commented Oct 16, 2018

ok I'll try it.
Thank you very much!

@shadowver
Copy link

I had the similar issue when I build the project. It appeared to be the egien issue. Tried download the latest version of the egien and replace the default version as you may installed via sudo apt-get. It should solve the problem. Do remember use the newly installed egien build g2o first...

@skaegy
Copy link

skaegy commented Oct 25, 2018

I had a similar issue while the project with Eigen 3.2.9. It is solved by rebuild with Eigen 3.3.4.

@YisenYu
Copy link
Author

YisenYu commented Oct 26, 2018

I have solved it by updating gcc/g++ to 5.5 and using Eigen 3.3.5.
Maybe only updating Eigen is enough.
Thanks to everybody
(ง •̀_•́)ง

@YisenYu YisenYu closed this as completed Oct 26, 2018
@UncleVwang
Copy link

I'm on Ubuntu14.04 64bit, gcc/g++ 5.50, cmake3.2.2,Eigen 3.3.5
After installing all the dependencies, I directly use ./make_project.sh to build. DBoW3 and g2o are built successully, while ldso failed.
here is my error output:
o::EdgePointSim3::computeError()’:
/home/unclewang/LDSO/include/internal/PR.h:292:34: error: call of overloaded ‘isnan(Sophus::Sim3GroupBase<Sophus::Sim3Group >::Scalar)’ is ambiguous
if (isnan(Scw.scale())) {

/home/unclewang/LDSO/src/frontend/LoopClosing.cc: In member function ‘bool ldso::LoopClosing::ComputeOptimizedPose(std::shared_ptrldso::Frame, Sim3&, std::shared_ptrldso::internal::CalibHessian, Mat77&, float)’:
/home/unclewang/LDSO/src/frontend/LoopClosing.cc:472:68: error: call of overloaded ‘isnan(Sophus::Sim3GroupBase<Sophus::Sim3Group >::Scalar)’ is ambiguous

@NikolausDemmel
Copy link
Contributor

How do you make sure that all third party depedencies and LDSO itself pick up the right eigen? Do you also have libeigen-dev from apt installed?

@YisenYu
Copy link
Author

YisenYu commented Oct 30, 2018

I removed libeigen-dev and installed eigen3.3.5 from src code, then rebuilt the whole project
@UncleVwang you can fix it by using std::isnan() instead of isnan()

@YisenYu YisenYu reopened this Oct 30, 2018
@NikolausDemmel
Copy link
Contributor

Thanks. A PR for fixing the isnan would be welcome!

@UncleVwang
Copy link

Thanks,I have tried your opinion and succeed.@YisenYu

@mrgransky
Copy link

I had the similar issue with eigen3 and ubuntu 16.04.
for me the following command fix the issue:

$ sudo apt-get install libeigen3-dev

I also removed all the build and lib folders from the thirdparty and main project folder and rebuilt it again.

@UncleVwang
Copy link

You can try to install Eigen 3.3.5,and try to compile again.

@NikolausDemmel
Copy link
Contributor

I fixed the std::isnan in 009f87b

@gaoxiang12
Copy link
Collaborator

fixed by #include <Eigen/StdVector> in NumType.h according to @NikolausDemmel 's comment.

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

7 participants