ceres_python_bindings
ceres_python_bindings copied to clipboard
Error installing on Amazon Linux 2
Hi there,
I tried to install ceres_python_bindings along-side ceres-solver (v2.2.0 cloned from ceres-solver main branch on github). The installation is on an Amazon Linux 2 distribution, with g++ 7.3.1 and cmake 3.24.2. I am working with python3.8
I run the cmake for ceres using the flags
cmake -DSUITESPARSE=OFF -DCMAKE_CXX_STANDARD=17
, and after having modifyed the CMakeList file with the cerer_python_bindings path.
I obtained a positive cmake output:
-- Detected Ceres version: 2.2.0 from /home/vferro/workplace/CERES/ceres-solver/include/ceres/version.h
-- Detected available Ceres threading models: [CXX_THREADS, OPENMP, NO_THREADS]
-- Found Eigen version 3.3.7: /usr/share/eigen3
-- Enabling use of Eigen as a sparse linear algebra library.
-- Building without CUDA.
-- Found LAPACK library: /usr/lib64/libopenblas.so;-lpthread;-lm;-ldl
-- Building without SuiteSparse.
-- Building without Eigen METIS support.
-- Building without Apple's Accelerate sparse support.
-- Use of gflags disabled - no tests or tools will be built!
-- No preference for use of exported glog CMake configuration set, and no hints for include/library directories provided. Defaulting to preferring an installed/exported glog CMake configuration if available.
-- Found installed version of glog: /usr/local/lib64/cmake/glog
-- Detected glog version: 0.7.0
-- Found Google Log (glog). Assuming glog was NOT built with gflags support as gflags was not found. If glog was built with gflags, please set the gflags search locations such that it can be found by Ceres. Otherwise, Ceres may fail to link due to missing gflags symbols.
-- Using Ceres threading model: CXX_THREADS
-- Building Ceres as a static library.
-- Enabling CERES_USE_EIGEN_SPARSE in Ceres config.h
-- Enabling CERES_NO_SUITESPARSE in Ceres config.h
-- Enabling CERES_NO_CUDA in Ceres config.h
-- Enabling CERES_NO_ACCELERATE_SPARSE in Ceres config.h
-- Enabling CERES_USE_CXX_THREADS in Ceres config.h
-- Enabling CERES_NO_CHOLMOD_PARTITION in Ceres config.h
-- Enabling CERES_NO_EIGEN_METIS in Ceres config.h
-- Build the examples.
-- pybind11 v2.4.dev4
**-- Python Bindings for Ceres(PyCeres) have been added**
-- Configuring done
-- Generating done
-- Build files have been written to: /home/vferro/workplace/CERES/ceres-solver
However, then I try to run make
, I get the following errors:
Consolidate compiler generated dependencies of target ceres_internal
[ 78%] Built target ceres_internal
Consolidate compiler generated dependencies of target ceres
[ 83%] Built target ceres
[ 83%] Building CXX object CMakeFiles/PyCeres.dir/ceres_python_bindings/python_bindings/python_module.cpp.o
/home/vferro/workplace/CERES/ceres-solver/ceres_python_bindings/python_bindings/python_module.cpp: In function ‘ceres::Problem CreatePythonProblem()’:
/home/vferro/workplace/CERES/ceres-solver/ceres_python_bindings/python_bindings/python_module.cpp:60:16: warning: no previous declaration for ‘ceres::Problem CreatePythonProblem()’ [-Wmissing-declarations]
ceres::Problem CreatePythonProblem() {
^~~~~~~~~~~~~~~~~~~
/home/vferro/workplace/CERES/ceres-solver/ceres_python_bindings/python_bindings/python_module.cpp:62:5: error: ‘struct ceres::Problem::Options’ has no member named ‘local_parameterization_ownership’; did you mean ‘loss_function_ownership’?
o.local_parameterization_ownership = ceres::Ownership::DO_NOT_TAKE_OWNERSHIP;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
loss_function_ownership
...
I cropped the entire error message above for brevity. Here is an attachment of the entire output. debug_ceres_python_bindings.txt
If I try to compile ceres-solver without adding python bindings, it compiles without problems.
I also tried to compile python binding directly with cmake (not alongside ceres), and got a similar error:
[ 25%] Building CXX object CMakeFiles/PyCeres.dir/python_bindings/python_module.cpp.o
/home/vferro/workplace/CERES/ceres-solver/ceres_python_bindings/python_bindings/python_module.cpp: In function ‘ceres::Problem CreatePythonProblem()’:
/home/vferro/workplace/CERES/ceres-solver/ceres_python_bindings/python_bindings/python_module.cpp:62:5: error: ‘struct ceres::Problem::Options’ has no member named ‘local_parameterization_ownership’; did you mean ‘loss_function_ownership’?
o.local_parameterization_ownership = ceres::Ownership::DO_NOT_TAKE_OWNERSHIP;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
loss_function_ownership
....
Finally, for completeness, I also tried to install using pip install .
, but that failed too.
I am not sure if this has something to do with the version of ceres-solver that I cloned, and whether I should revert to an earlier version.
Please let me know if you need more info on this issue, and/or if you there is something I missed in the installation guide.