borglab / gtsam

GTSAM is a library of C++ classes that implement smoothing and mapping (SAM) in robotics and vision, using factor graphs and Bayes networks as the underlying computing paradigm rather than sparse matrices.
http://gtsam.org
Other
2.55k stars 755 forks source link

Python Wrapper Error #639

Closed dlee640 closed 3 years ago

dlee640 commented 3 years ago

Description

I have ubuntu 18.04, and I have used release 4.1.0 to install gtsam. My C++ version works fine (all the unittests work), but I am more familiar with python, therefore decided to install python wrapper. However, using python 3.6.9, I get an error saying python version of >= 3.7.x is required. Yet, if I set -DGTSAM_PYTHON_VERSION= to anything past 3.7.x, it throws me an error as well.

Steps to reproduce my error...

First attempt: Python 3.6.9 as default on my environment

  1. $ git clone https://github.com/borglab/gtsam.git

  2. $ cd gtsam

  3. $ mkdir build

  4. $ cd build

  5. $ pip install -r /python/requirements.txt # this is to install pyparsing

  6. $ cmake .. -DGTSAM_BUILD_PYTHON=1 -DGTSAM_PYTHON_VERSION=3.6.9 Here, it won't let me set python version => 3.7.x. Thus, I used 3.6.9 since the instruction says it has to be >3.6.x... This outputs: -- Found Eigen version: 3.3.7 -- GTSAM_POSE3_EXPMAP=ON, enabling GTSAM_ROT3_EXPMAP as well -- Could NOT find MKL (missing: MKL_INCLUDE_DIR MKL_LIBRARIES) -- Found PythonInterp: /usr/bin/python3.6 (found suitable exact version "3.6.9") -- Found PythonLibs: /usr/lib/x86_64-linux-gnu/libpython3.6m.so (found suitable exact version "3.6.9") -- pybind11 v2.6.0 dev1 -- Found PythonLibs: /usr/lib/x86_64-linux-gnu/libpython3.6m.so -- Performing Test HAS_FLTO -- Performing Test HAS_FLTO - Success -- Building 3rdparty -- Looking for execinfo.h -- Looking for execinfo.h - found -- Looking for getline -- Looking for getline - found -- checking for thread-local storage - found -- Could NOT find GeographicLib (missing: GeographicLib_LIBRARY_DIRS GeographicLib_LIBRARIES GeographicLib_INCLUDE_DIRS) -- Building base -- Building geometry -- Building inference -- Building symbolic -- Building discrete -- Building linear -- Building nonlinear -- Building sam -- Building sfm -- Building slam -- Building navigation -- GTSAM Version: 4.1.0 -- Install prefix: /usr/local -- Building GTSAM - shared: ON -- Building base_unstable -- Building geometry_unstable -- Building linear_unstable -- Building discrete_unstable -- Building dynamics_unstable -- Building nonlinear_unstable -- Building slam_unstable -- Building partition_unstable -- GTSAM_UNSTABLE Version: 4.1.0 -- Install prefix: /usr/local -- Wrote /home/dlee640/gtsam_py/gtsam/build/GTSAMConfig.cmake -- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE) -- =============================================================== -- ================ Configuration Options ====================== -- CMAKE_CXX_COMPILER_ID type : GNU -- CMAKE_CXX_COMPILER_VERSION : 7.5.0 -- CMake version : 3.10.2 -- CMake generator : Unix Makefiles -- CMake build tool : /usr/bin/make -- Build flags
    -- Build Tests : Enabled -- Build examples with 'make all' : Enabled -- Build timing scripts with 'make all' : Disabled -- Build shared GTSAM libraries : Enabled -- Put build type in library name : Enabled -- Build libgtsam_unstable : Enabled -- Build GTSAM unstable Python : Enabled -- Build MATLAB Toolbox for unstable : Disabled -- Build for native architecture : Enabled -- Build type : Release -- C compilation flags : -O3 -DNDEBUG -- C++ compilation flags : -O3 -DNDEBUG -- GTSAM_COMPILE_FEATURES_PUBLIC : cxx_std_11 -- GTSAM_COMPILE_OPTIONS_PUBLIC : -march=native -- GTSAM_COMPILE_DEFINITIONS_PUBLIC : -- GTSAM_COMPILE_OPTIONS_PUBLIC_DEBUG : -- GTSAM_COMPILE_DEFINITIONS_PUBLIC_DEBUG : -- GTSAM_COMPILE_OPTIONS_PUBLIC_RELEASE : -- GTSAM_COMPILE_DEFINITIONS_PUBLIC_RELEASE : -- GTSAM_COMPILE_OPTIONS_PUBLIC_TIMING : -- GTSAM_COMPILE_DEFINITIONS_PUBLIC_TIMING : -- GTSAM_COMPILE_OPTIONS_PUBLIC_PROFILING : -- GTSAM_COMPILE_DEFINITIONS_PUBLIC_PROFILING : -- GTSAM_COMPILE_OPTIONS_PUBLIC_RELWITHDEBINFO : -- GTSAM_COMPILE_DEFINITIONS_PUBLIC_RELWITHDEBINFO : -- GTSAM_COMPILE_OPTIONS_PUBLIC_MINSIZEREL : -- GTSAM_COMPILE_DEFINITIONS_PUBLIC_MINSIZEREL : -- Use System Eigen : OFF (Using version: 3.3.7) -- Use Intel TBB : Yes (Version: 2017.0) -- Eigen will use MKL : MKL not found -- Eigen will use MKL and OpenMP : OpenMP found but GTSAM_WITH_EIGEN_MKL is disabled -- Default allocator : TBB -- Cheirality exceptions enabled : YES -- Build with ccache : No -- Packaging flags -- CPack Source Generator : TGZ -- CPack Generator : TGZ -- GTSAM flags
    -- Quaternions as default Rot3 : Disabled -- Runtime consistency checking : Disabled -- Rot3 retract is full ExpMap : Enabled -- Pose3 retract is full ExpMap : Enabled -- Allow features deprecated in GTSAM 4.1 : Enabled -- Metis-based Nested Dissection : Enabled -- Use tangent-space preintegration : Enabled -- MATLAB toolbox flags -- Install MATLAB toolbox : Disabled -- Python toolbox flags
    -- Build Python module with pybind : Enabled -- Python version : 3.6.9 -- =============================================================== -- Configuring done -- Generating done -- Build files have been written to: /home/dlee640/gtsam_py/gtsam/build

  7. $ make

  8. $ sudo make python-install

  9. Above command returns this error below, its a long message, but pretty much throws a runtime error saying that python version >= 3.7 is required, which is something that I do not remember seeing as a requirement on github.

[sudo] password for dlee640: [ 23%] Built target metis-gtsam [ 76%] Built target gtsam [ 88%] Built target gtsam_unstable [ 88%] Built target gtsam_unstable_header [ 92%] Built target pybind_wrap_gtsam_unstable [ 96%] Built target gtsam_unstable_py [ 96%] Built target gtsam_header [ 96%] Built target pybind_wrap_gtsam [100%] Built target gtsam_py Scanning dependencies of target python-install PACKAGES: ['gtsam', 'gtsam_unstable', 'gtsam.utils', 'gtsam.examples', 'gtsam_unstable.tests', 'gtsam_unstable.examples'] /usr/lib/python3.6/distutils/dist.py:261: UserWarning: Unknown distribution option: 'long_description_content_type' warnings.warn(msg) running install running bdist_egg running egg_info creating gtsam.egg-info writing gtsam.egg-info/PKG-INFO writing dependency_links to gtsam.egg-info/dependency_links.txt writing requirements to gtsam.egg-info/requires.txt writing top-level names to gtsam.egg-info/top_level.txt writing manifest file 'gtsam.egg-info/SOURCES.txt' reading manifest file 'gtsam.egg-info/SOURCES.txt' writing manifest file 'gtsam.egg-info/SOURCES.txt' installing library code to build/bdist.linux-x86_64/egg running install_lib running build_py creating build creating build/lib creating build/lib/gtsam copying gtsam/init.py -> build/lib/gtsam copying gtsam/imuBias.py -> build/lib/gtsam copying gtsam/noiseModel.py -> build/lib/gtsam copying gtsam/symbol_shorthand.py -> build/lib/gtsam creating build/lib/gtsam_unstable copying gtsam_unstable/init.py -> build/lib/gtsam_unstable creating build/lib/gtsam/utils copying gtsam/utils/test_case.py -> build/lib/gtsam/utils copying gtsam/utils/plot.py -> build/lib/gtsam/utils copying gtsam/utils/init.py -> build/lib/gtsam/utils copying gtsam/utils/logging_optimizer.py -> build/lib/gtsam/utils copying gtsam/utils/circlePose3.py -> build/lib/gtsam/utils copying gtsam/utils/visual_data_generator.py -> build/lib/gtsam/utils copying gtsam/utils/visual_isam.py -> build/lib/gtsam/utils creating build/lib/gtsam/examples copying gtsam/examples/SFMExample.py -> build/lib/gtsam/examples copying gtsam/examples/ImuFactorISAM2Example.py -> build/lib/gtsam/examples copying gtsam/examples/init.py -> build/lib/gtsam/examples copying gtsam/examples/PlanarManipulatorExample.py -> build/lib/gtsam/examples copying gtsam/examples/ImuFactorExample.py -> build/lib/gtsam/examples copying gtsam/examples/DogLegOptimizerExample.py -> build/lib/gtsam/examples copying gtsam/examples/SFMdata.py -> build/lib/gtsam/examples copying gtsam/examples/PreintegrationExample.py -> build/lib/gtsam/examples copying gtsam/examples/GPSFactorExample.py -> build/lib/gtsam/examples copying gtsam/examples/Pose3SLAMExample_initializePose3Chordal.py -> build/lib/gtsam/examples copying gtsam/examples/VisualISAMExample.py -> build/lib/gtsam/examples copying gtsam/examples/Pose3SLAMExample_g2o.py -> build/lib/gtsam/examples copying gtsam/examples/ShonanAveragingCLI.py -> build/lib/gtsam/examples copying gtsam/examples/Pose2SLAMExample.py -> build/lib/gtsam/examples copying gtsam/examples/Pose2SLAMExample_g2o.py -> build/lib/gtsam/examples copying gtsam/examples/OdometryExample.py -> build/lib/gtsam/examples copying gtsam/examples/PlanarSLAMExample.py -> build/lib/gtsam/examples copying gtsam/examples/SFMExample_bal.py -> build/lib/gtsam/examples copying gtsam/examples/VisualISAM2Example.py -> build/lib/gtsam/examples copying gtsam/examples/TranslationAveragingExample.py -> build/lib/gtsam/examples copying gtsam/examples/SimpleRotation.py -> build/lib/gtsam/examples creating build/lib/gtsam_unstable/tests copying gtsam_unstable/tests/init.py -> build/lib/gtsam_unstable/tests copying gtsam_unstable/tests/test_FixedLagSmootherExample.py -> build/lib/gtsam_unstable/tests creating build/lib/gtsam_unstable/examples copying gtsam_unstable/examples/init.py -> build/lib/gtsam_unstable/examples copying gtsam_unstable/examples/TimeOfArrivalExample.py -> build/lib/gtsam_unstable/examples copying gtsam_unstable/examples/FixedLagSmootherExample.py -> build/lib/gtsam_unstable/examples copying gtsam/gtsam.cpython-36m-x86_64-linux-gnu.so -> build/lib/gtsam copying gtsam_unstable/gtsam_unstable.cpython-36m-x86_64-linux-gnu.so -> build/lib/gtsam_unstable creating build/bdist.linux-x86_64 creating build/bdist.linux-x86_64/egg creating build/bdist.linux-x86_64/egg/gtsam copying build/lib/gtsam/init.py -> build/bdist.linux-x86_64/egg/gtsam creating build/bdist.linux-x86_64/egg/gtsam/utils copying build/lib/gtsam/utils/test_case.py -> build/bdist.linux-x86_64/egg/gtsam/utils copying build/lib/gtsam/utils/plot.py -> build/bdist.linux-x86_64/egg/gtsam/utils copying build/lib/gtsam/utils/init.py -> build/bdist.linux-x86_64/egg/gtsam/utils copying build/lib/gtsam/utils/logging_optimizer.py -> build/bdist.linux-x86_64/egg/gtsam/utils copying build/lib/gtsam/utils/circlePose3.py -> build/bdist.linux-x86_64/egg/gtsam/utils copying build/lib/gtsam/utils/visual_data_generator.py -> build/bdist.linux-x86_64/egg/gtsam/utils copying build/lib/gtsam/utils/visual_isam.py -> build/bdist.linux-x86_64/egg/gtsam/utils copying build/lib/gtsam/gtsam.cpython-36m-x86_64-linux-gnu.so -> build/bdist.linux-x86_64/egg/gtsam creating build/bdist.linux-x86_64/egg/gtsam/examples copying build/lib/gtsam/examples/SFMExample.py -> build/bdist.linux-x86_64/egg/gtsam/examples copying build/lib/gtsam/examples/ImuFactorISAM2Example.py -> build/bdist.linux-x86_64/egg/gtsam/examples copying build/lib/gtsam/examples/init.py -> build/bdist.linux-x86_64/egg/gtsam/examples copying build/lib/gtsam/examples/PlanarManipulatorExample.py -> build/bdist.linux-x86_64/egg/gtsam/examples copying build/lib/gtsam/examples/ImuFactorExample.py -> build/bdist.linux-x86_64/egg/gtsam/examples copying build/lib/gtsam/examples/DogLegOptimizerExample.py -> build/bdist.linux-x86_64/egg/gtsam/examples copying build/lib/gtsam/examples/SFMdata.py -> build/bdist.linux-x86_64/egg/gtsam/examples copying build/lib/gtsam/examples/PreintegrationExample.py -> build/bdist.linux-x86_64/egg/gtsam/examples copying build/lib/gtsam/examples/GPSFactorExample.py -> build/bdist.linux-x86_64/egg/gtsam/examples copying build/lib/gtsam/examples/Pose3SLAMExample_initializePose3Chordal.py -> build/bdist.linux-x86_64/egg/gtsam/examples copying build/lib/gtsam/examples/VisualISAMExample.py -> build/bdist.linux-x86_64/egg/gtsam/examples copying build/lib/gtsam/examples/Pose3SLAMExample_g2o.py -> build/bdist.linux-x86_64/egg/gtsam/examples copying build/lib/gtsam/examples/ShonanAveragingCLI.py -> build/bdist.linux-x86_64/egg/gtsam/examples copying build/lib/gtsam/examples/Pose2SLAMExample.py -> build/bdist.linux-x86_64/egg/gtsam/examples copying build/lib/gtsam/examples/Pose2SLAMExample_g2o.py -> build/bdist.linux-x86_64/egg/gtsam/examples copying build/lib/gtsam/examples/OdometryExample.py -> build/bdist.linux-x86_64/egg/gtsam/examples copying build/lib/gtsam/examples/PlanarSLAMExample.py -> build/bdist.linux-x86_64/egg/gtsam/examples copying build/lib/gtsam/examples/SFMExample_bal.py -> build/bdist.linux-x86_64/egg/gtsam/examples copying build/lib/gtsam/examples/VisualISAM2Example.py -> build/bdist.linux-x86_64/egg/gtsam/examples copying build/lib/gtsam/examples/TranslationAveragingExample.py -> build/bdist.linux-x86_64/egg/gtsam/examples copying build/lib/gtsam/examples/SimpleRotation.py -> build/bdist.linux-x86_64/egg/gtsam/examples copying build/lib/gtsam/imuBias.py -> build/bdist.linux-x86_64/egg/gtsam copying build/lib/gtsam/noiseModel.py -> build/bdist.linux-x86_64/egg/gtsam copying build/lib/gtsam/symbol_shorthand.py -> build/bdist.linux-x86_64/egg/gtsam creating build/bdist.linux-x86_64/egg/gtsam_unstable creating build/bdist.linux-x86_64/egg/gtsam_unstable/tests copying build/lib/gtsam_unstable/tests/init.py -> build/bdist.linux-x86_64/egg/gtsam_unstable/tests copying build/lib/gtsam_unstable/tests/test_FixedLagSmootherExample.py -> build/bdist.linux-x86_64/egg/gtsam_unstable/tests copying build/lib/gtsam_unstable/init.py -> build/bdist.linux-x86_64/egg/gtsam_unstable creating build/bdist.linux-x86_64/egg/gtsam_unstable/examples copying build/lib/gtsam_unstable/examples/init.py -> build/bdist.linux-x86_64/egg/gtsam_unstable/examples copying build/lib/gtsam_unstable/examples/TimeOfArrivalExample.py -> build/bdist.linux-x86_64/egg/gtsam_unstable/examples copying build/lib/gtsam_unstable/examples/FixedLagSmootherExample.py -> build/bdist.linux-x86_64/egg/gtsam_unstable/examples copying build/lib/gtsam_unstable/gtsam_unstable.cpython-36m-x86_64-linux-gnu.so -> build/bdist.linux-x86_64/egg/gtsam_unstable byte-compiling build/bdist.linux-x86_64/egg/gtsam/init.py to init.cpython-36.pyc byte-compiling build/bdist.linux-x86_64/egg/gtsam/utils/test_case.py to test_case.cpython-36.pyc byte-compiling build/bdist.linux-x86_64/egg/gtsam/utils/plot.py to plot.cpython-36.pyc byte-compiling build/bdist.linux-x86_64/egg/gtsam/utils/init.py to init.cpython-36.pyc byte-compiling build/bdist.linux-x86_64/egg/gtsam/utils/logging_optimizer.py to logging_optimizer.cpython-36.pyc byte-compiling build/bdist.linux-x86_64/egg/gtsam/utils/circlePose3.py to circlePose3.cpython-36.pyc byte-compiling build/bdist.linux-x86_64/egg/gtsam/utils/visual_data_generator.py to visual_data_generator.cpython-36.pyc byte-compiling build/bdist.linux-x86_64/egg/gtsam/utils/visual_isam.py to visual_isam.cpython-36.pyc byte-compiling build/bdist.linux-x86_64/egg/gtsam/examples/SFMExample.py to SFMExample.cpython-36.pyc byte-compiling build/bdist.linux-x86_64/egg/gtsam/examples/ImuFactorISAM2Example.py to ImuFactorISAM2Example.cpython-36.pyc byte-compiling build/bdist.linux-x86_64/egg/gtsam/examples/init.py to init.cpython-36.pyc byte-compiling build/bdist.linux-x86_64/egg/gtsam/examples/PlanarManipulatorExample.py to PlanarManipulatorExample.cpython-36.pyc byte-compiling build/bdist.linux-x86_64/egg/gtsam/examples/ImuFactorExample.py to ImuFactorExample.cpython-36.pyc byte-compiling build/bdist.linux-x86_64/egg/gtsam/examples/DogLegOptimizerExample.py to DogLegOptimizerExample.cpython-36.pyc byte-compiling build/bdist.linux-x86_64/egg/gtsam/examples/SFMdata.py to SFMdata.cpython-36.pyc byte-compiling build/bdist.linux-x86_64/egg/gtsam/examples/PreintegrationExample.py to PreintegrationExample.cpython-36.pyc byte-compiling build/bdist.linux-x86_64/egg/gtsam/examples/GPSFactorExample.py to GPSFactorExample.cpython-36.pyc byte-compiling build/bdist.linux-x86_64/egg/gtsam/examples/Pose3SLAMExample_initializePose3Chordal.py to Pose3SLAMExample_initializePose3Chordal.cpython-36.pyc byte-compiling build/bdist.linux-x86_64/egg/gtsam/examples/VisualISAMExample.py to VisualISAMExample.cpython-36.pyc byte-compiling build/bdist.linux-x86_64/egg/gtsam/examples/Pose3SLAMExample_g2o.py to Pose3SLAMExample_g2o.cpython-36.pyc byte-compiling build/bdist.linux-x86_64/egg/gtsam/examples/ShonanAveragingCLI.py to ShonanAveragingCLI.cpython-36.pyc byte-compiling build/bdist.linux-x86_64/egg/gtsam/examples/Pose2SLAMExample.py to Pose2SLAMExample.cpython-36.pyc byte-compiling build/bdist.linux-x86_64/egg/gtsam/examples/Pose2SLAMExample_g2o.py to Pose2SLAMExample_g2o.cpython-36.pyc byte-compiling build/bdist.linux-x86_64/egg/gtsam/examples/OdometryExample.py to OdometryExample.cpython-36.pyc byte-compiling build/bdist.linux-x86_64/egg/gtsam/examples/PlanarSLAMExample.py to PlanarSLAMExample.cpython-36.pyc byte-compiling build/bdist.linux-x86_64/egg/gtsam/examples/SFMExample_bal.py to SFMExample_bal.cpython-36.pyc byte-compiling build/bdist.linux-x86_64/egg/gtsam/examples/VisualISAM2Example.py to VisualISAM2Example.cpython-36.pyc byte-compiling build/bdist.linux-x86_64/egg/gtsam/examples/TranslationAveragingExample.py to TranslationAveragingExample.cpython-36.pyc byte-compiling build/bdist.linux-x86_64/egg/gtsam/examples/SimpleRotation.py to SimpleRotation.cpython-36.pyc byte-compiling build/bdist.linux-x86_64/egg/gtsam/imuBias.py to imuBias.cpython-36.pyc byte-compiling build/bdist.linux-x86_64/egg/gtsam/noiseModel.py to noiseModel.cpython-36.pyc byte-compiling build/bdist.linux-x86_64/egg/gtsam/symbol_shorthand.py to symbol_shorthand.cpython-36.pyc byte-compiling build/bdist.linux-x86_64/egg/gtsam_unstable/tests/init.py to init.cpython-36.pyc byte-compiling build/bdist.linux-x86_64/egg/gtsam_unstable/tests/test_FixedLagSmootherExample.py to test_FixedLagSmootherExample.cpython-36.pyc byte-compiling build/bdist.linux-x86_64/egg/gtsam_unstable/init.py to init.cpython-36.pyc byte-compiling build/bdist.linux-x86_64/egg/gtsam_unstable/examples/init.py to init.cpython-36.pyc byte-compiling build/bdist.linux-x86_64/egg/gtsam_unstable/examples/TimeOfArrivalExample.py to TimeOfArrivalExample.cpython-36.pyc byte-compiling build/bdist.linux-x86_64/egg/gtsam_unstable/examples/FixedLagSmootherExample.py to FixedLagSmootherExample.cpython-36.pyc installing package data to build/bdist.linux-x86_64/egg running install_data creating build/bdist.linux-x86_64/egg/gtsam/Data copying /home/dlee640/gtsam_py/gtsam/examples/Data/KittiEquivBiasedImu_metadata.txt -> build/bdist.linux-x86_64/egg/./gtsam/Data copying /home/dlee640/gtsam_py/gtsam/examples/Data/w10000.graph -> build/bdist.linux-x86_64/egg/./gtsam/Data copying /home/dlee640/gtsam_py/gtsam/examples/Data/QPTEST.QPS -> build/bdist.linux-x86_64/egg/./gtsam/Data copying /home/dlee640/gtsam_py/gtsam/examples/Data/Plaza2_DR.txt -> build/bdist.linux-x86_64/egg/./gtsam/Data copying /home/dlee640/gtsam_py/gtsam/examples/Data/VO_calibration.txt -> build/bdist.linux-x86_64/egg/./gtsam/Data copying /home/dlee640/gtsam_py/gtsam/examples/Data/randomGrid3D.xml -> build/bdist.linux-x86_64/egg/./gtsam/Data copying /home/dlee640/gtsam_py/gtsam/examples/Data/w100.graph -> build/bdist.linux-x86_64/egg/./gtsam/Data copying /home/dlee640/gtsam_py/gtsam/examples/Data/HS35MOD.QPS -> build/bdist.linux-x86_64/egg/./gtsam/Data copying /home/dlee640/gtsam_py/gtsam/examples/Data/victoria_park.txt -> build/bdist.linux-x86_64/egg/./gtsam/Data copying /home/dlee640/gtsam_py/gtsam/examples/Data/Plaza2_TD.txt -> build/bdist.linux-x86_64/egg/./gtsam/Data copying /home/dlee640/gtsam_py/gtsam/examples/Data/optimizedNoisyToyGraph.txt -> build/bdist.linux-x86_64/egg/./gtsam/Data copying /home/dlee640/gtsam_py/gtsam/examples/Data/imuAndGPSdata.csv -> build/bdist.linux-x86_64/egg/./gtsam/Data copying /home/dlee640/gtsam_py/gtsam/examples/Data/orientationsNoisyToyGraph.txt -> build/bdist.linux-x86_64/egg/./gtsam/Data copying /home/dlee640/gtsam_py/gtsam/examples/Data/Plaza1_TD.txt -> build/bdist.linux-x86_64/egg/./gtsam/Data copying /home/dlee640/gtsam_py/gtsam/examples/Data/5pointExample2.txt -> build/bdist.linux-x86_64/egg/./gtsam/Data copying /home/dlee640/gtsam_py/gtsam/examples/Data/VO_camera_poses_large.txt -> build/bdist.linux-x86_64/egg/./gtsam/Data copying /home/dlee640/gtsam_py/gtsam/examples/Data/pose2example.txt -> build/bdist.linux-x86_64/egg/./gtsam/Data copying /home/dlee640/gtsam_py/gtsam/examples/Data/example_with_vertices.g2o -> build/bdist.linux-x86_64/egg/./gtsam/Data copying /home/dlee640/gtsam_py/gtsam/examples/Data/example.graph -> build/bdist.linux-x86_64/egg/./gtsam/Data copying /home/dlee640/gtsam_py/gtsam/examples/Data/pose3example.txt -> build/bdist.linux-x86_64/egg/./gtsam/Data copying /home/dlee640/gtsam_py/gtsam/examples/Data/HS52.QPS -> build/bdist.linux-x86_64/egg/./gtsam/Data copying /home/dlee640/gtsam_py/gtsam/examples/Data/Klaus3.g2o -> build/bdist.linux-x86_64/egg/./gtsam/Data copying /home/dlee640/gtsampy/gtsam/examples/Data/Plaza2.mat -> build/bdist.linux-x86_64/egg/./gtsam/Data copying /home/dlee640/gtsam_py/gtsam/examples/Data/sphere_smallnoise.graph -> build/bdist.linux-x86_64/egg/./gtsam/Data copying /home/dlee640/gtsam_py/gtsam/examples/Data/ISAM2_SmartFactorStereo_IMU.txt -> build/bdist.linux-x86_64/egg/./gtsam/Data copying /home/dlee640/gtsam_py/gtsam/examples/Data/5pointExample1.txt -> build/bdist.linux-x86_64/egg/./gtsam/Data copying /home/dlee640/gtsam_py/gtsam/examples/Data/VO_camera_poses00.txt -> build/bdist.linux-x86_64/egg/./gtsam/Data copying /home/dlee640/gtsam_py/gtsam/examples/Data/w20000.txt -> build/bdist.linux-x86_64/egg/./gtsam/Data copying /home/dlee640/gtsam_py/gtsam/examples/Data/toy3D.xml -> build/bdist.linux-x86_64/egg/./gtsam/Data copying /home/dlee640/gtsam_py/gtsam/examples/Data/pose3example-offdiagonal.txt -> build/bdist.linux-x86_64/egg/./gtsam/Data copying /home/dlee640/gtsam_py/gtsam/examples/Data/Balbianello.out -> build/bdist.linux-x86_64/egg/./gtsam/Data copying /home/dlee640/gtsam_py/gtsam/examples/Data/dubrovnik-3-7-18-pre.txt -> build/bdist.linux-x86_64/egg/./gtsam/Data copying /home/dlee640/gtsam_py/gtsam/examples/Data/toyExample.g2o -> build/bdist.linux-x86_64/egg/./gtsam/Data copying /home/dlee640/gtsampy/gtsam/examples/Data/Plaza1.mat -> build/bdist.linux-x86_64/egg/./gtsam/Data copying /home/dlee640/gtsam_py/gtsam/examples/Data/sphere2500_groundtruth.txt -> build/bdist.linux-x86_64/egg/./gtsam/Data copying /home/dlee640/gtsam_py/gtsam/examples/Data/VO_calibration00.txt -> build/bdist.linux-x86_64/egg/./gtsam/Data copying /home/dlee640/gtsam_py/gtsam/examples/Data/noisyToyGraph.txt -> build/bdist.linux-x86_64/egg/./gtsam/Data copying /home/dlee640/gtsam_py/gtsam/examples/Data/dubrovnik-1-1-pre.txt -> build/bdist.linux-x86_64/egg/./gtsam/Data copying /home/dlee640/gtsam_py/gtsam/examples/Data/QPExample.QPS -> build/bdist.linux-x86_64/egg/./gtsam/Data copying /home/dlee640/gtsam_py/gtsam/examples/Data/sphere2500.txt -> build/bdist.linux-x86_64/egg/./gtsam/Data copying /home/dlee640/gtsam_py/gtsam/examples/Data/HS51.QPS -> build/bdist.linux-x86_64/egg/./gtsam/Data copying /home/dlee640/gtsam_py/gtsam/examples/Data/VO_stereo_factors00s.txt -> build/bdist.linux-x86_64/egg/./gtsam/Data copying /home/dlee640/gtsam_py/gtsam/examples/Data/pose3example-grid.txt -> build/bdist.linux-x86_64/egg/./gtsam/Data copying /home/dlee640/gtsam_py/gtsam/examples/Data/simpleGraph10gradIter.txt -> build/bdist.linux-x86_64/egg/./gtsam/Data copying /home/dlee640/gtsam_py/gtsam/examples/Data/VO_calibration00s.txt -> build/bdist.linux-x86_64/egg/./gtsam/Data copying /home/dlee640/gtsam_py/gtsam/examples/Data/KittiEquivBiasedImu.txt -> build/bdist.linux-x86_64/egg/./gtsam/Data copying /home/dlee640/gtsam_py/gtsam/examples/Data/pose3Localizationexample.txt -> build/bdist.linux-x86_64/egg/./gtsam/Data copying /home/dlee640/gtsam_py/gtsam/examples/Data/VO_camera_poses00s.txt -> build/bdist.linux-x86_64/egg/./gtsam/Data copying /home/dlee640/gtsam_py/gtsam/examples/Data/VO_stereo_factors00.txt -> build/bdist.linux-x86_64/egg/./gtsam/Data copying /home/dlee640/gtsam_py/gtsam/examples/Data/pose3example-offdiagonal-rewritten.txt -> build/bdist.linux-x86_64/egg/./gtsam/Data copying /home/dlee640/gtsam_py/gtsam/examples/Data/dubrovnik-3-7-pre.txt -> build/bdist.linux-x86_64/egg/./gtsam/Data copying /home/dlee640/gtsam_py/gtsam/examples/Data/VO_stereo_factors_large.txt -> build/bdist.linux-x86_64/egg/./gtsam/Data copying /home/dlee640/gtsam_py/gtsam/examples/Data/KittiGps_converted.txt -> build/bdist.linux-x86_64/egg/./gtsam/Data copying /home/dlee640/gtsam_py/gtsam/examples/Data/HS268.QPS -> build/bdist.linux-x86_64/egg/./gtsam/Data copying /home/dlee640/gtsam_py/gtsam/examples/Data/Plaza1_DR.txt -> build/bdist.linux-x86_64/egg/./gtsam/Data copying /home/dlee640/gtsam_py/gtsam/examples/Data/Balbianello/BalbianelloMedium-1.key.gz -> build/bdist.linux-x86_64/egg/./gtsam/Data copying /home/dlee640/gtsam_py/gtsam/examples/Data/Balbianello/BalbianelloMedium-2.key.gz -> build/bdist.linux-x86_64/egg/./gtsam/Data copying /home/dlee640/gtsam_py/gtsam/examples/Data/Balbianello/BalbianelloMedium-2.jpg -> build/bdist.linux-x86_64/egg/./gtsam/Data copying /home/dlee640/gtsam_py/gtsam/examples/Data/Balbianello/BalbianelloMedium-5.key.gz -> build/bdist.linux-x86_64/egg/./gtsam/Data copying /home/dlee640/gtsam_py/gtsam/examples/Data/Balbianello/BalbianelloMedium-4.jpg -> build/bdist.linux-x86_64/egg/./gtsam/Data copying /home/dlee640/gtsam_py/gtsam/examples/Data/Balbianello/BalbianelloMedium-4.key.gz -> build/bdist.linux-x86_64/egg/./gtsam/Data copying /home/dlee640/gtsam_py/gtsam/examples/Data/Balbianello/BalbianelloMedium-1.jpg -> build/bdist.linux-x86_64/egg/./gtsam/Data copying /home/dlee640/gtsam_py/gtsam/examples/Data/Balbianello/BalbianelloMedium-5.jpg -> build/bdist.linux-x86_64/egg/./gtsam/Data copying /home/dlee640/gtsam_py/gtsam/examples/Data/Balbianello/BalbianelloMedium-3.jpg -> build/bdist.linux-x86_64/egg/./gtsam/Data copying /home/dlee640/gtsam_py/gtsam/examples/Data/Balbianello/BalbianelloMedium-3.key.gz -> build/bdist.linux-x86_64/egg/./gtsam/Data copying /home/dlee640/gtsam_py/gtsam/examples/Data/HS21.QPS -> build/bdist.linux-x86_64/egg/./gtsam/Data copying /home/dlee640/gtsam_py/gtsam/examples/Data/HS35.QPS -> build/bdist.linux-x86_64/egg/./gtsam/Data creating build/bdist.linux-x86_64/egg/EGG-INFO copying gtsam.egg-info/PKG-INFO -> build/bdist.linux-x86_64/egg/EGG-INFO copying gtsam.egg-info/SOURCES.txt -> build/bdist.linux-x86_64/egg/EGG-INFO copying gtsam.egg-info/dependency_links.txt -> build/bdist.linux-x86_64/egg/EGG-INFO copying gtsam.egg-info/not-zip-safe -> build/bdist.linux-x86_64/egg/EGG-INFO copying gtsam.egg-info/requires.txt -> build/bdist.linux-x86_64/egg/EGG-INFO copying gtsam.egg-info/top_level.txt -> build/bdist.linux-x86_64/egg/EGG-INFO writing build/bdist.linux-x86_64/egg/EGG-INFO/native_libs.txt creating dist creating 'dist/gtsam-4.1.0-py3.6.egg' and adding 'build/bdist.linux-x86_64/egg' to it removing 'build/bdist.linux-x86_64/egg' (and everything under it) Processing gtsam-4.1.0-py3.6.egg removing '/usr/local/lib/python3.6/dist-packages/gtsam-4.1.0-py3.6.egg' (and everything under it) creating /usr/local/lib/python3.6/dist-packages/gtsam-4.1.0-py3.6.egg Extracting gtsam-4.1.0-py3.6.egg to /usr/local/lib/python3.6/dist-packages gtsam 4.1.0 is already the active version in easy-install.pth

Installed /usr/local/lib/python3.6/dist-packages/gtsam-4.1.0-py3.6.egg Processing dependencies for gtsam==4.1.0 Searching for numpy Reading https://pypi.python.org/simple/numpy/ Downloading https://files.pythonhosted.org/packages/81/46/ecc1ea3e5819eb0d83306a8f468693785c94ed5467fcbb6f2529abf0102f/numpy-1.20.0rc1.zip#sha256=98f4e754f1c3db7ca53e53b1ef6474703b167af75f3784f99b1fe4dd936ea77f Best match: numpy 1.20.0rc1 Processing numpy-1.20.0rc1.zip Writing /tmp/easy_install-oy_hscvn/numpy-1.20.0rc1/setup.cfg Running numpy-1.20.0rc1/setup.py -q bdist_egg --dist-dir /tmp/easy_install-oy_hscvn/numpy-1.20.0rc1/egg-dist-tmp-suzlfkur Traceback (most recent call last): File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 154, in save_modules yield saved File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 195, in setup_context yield File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 250, in run_setup _execfile(setup_script, ns) File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 45, in _execfile exec(code, globals, locals) File "/tmp/easy_install-oy_hscvn/numpy-1.20.0rc1/setup.py", line 30, in url='https://gtsam.org/', RuntimeError: Python version >= 3.7 required.

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/dlee640/gtsam_py/gtsam/build/python/setup.py", line 56, in zip_safe=False, File "/usr/lib/python3/dist-packages/setuptools/init.py", line 129, in setup return distutils.core.setup(attrs) File "/usr/lib/python3.6/distutils/core.py", line 148, in setup dist.run_commands() File "/usr/lib/python3.6/distutils/dist.py", line 955, in run_commands self.run_command(cmd) File "/usr/lib/python3.6/distutils/dist.py", line 974, in run_command cmd_obj.run() File "/usr/lib/python3/dist-packages/setuptools/command/install.py", line 67, in run self.do_egg_install() File "/usr/lib/python3/dist-packages/setuptools/command/install.py", line 117, in do_egg_install cmd.run() File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 437, in run self.easy_install(spec, not self.no_deps) File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 679, in easy_install return self.install_item(None, spec, tmpdir, deps, True) File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 726, in install_item self.process_distribution(spec, dist, deps) File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 771, in process_distribution [requirement], self.local_index, self.easy_install File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 774, in resolve replace_conflicting=replace_conflicting File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 1057, in best_match return self.obtain(req, installer) File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 1069, in obtain return installer(requirement) File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 698, in easy_install return self.install_item(spec, dist.location, tmpdir, deps) File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 724, in install_item dists = self.install_eggs(spec, download, tmpdir) File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 909, in install_eggs return self.build_and_install(setup_script, setup_base) File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 1177, in build_and_install self.run_setup(setup_script, setup_base, args) File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 1163, in run_setup run_setup(setup_script, args) File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 253, in run_setup raise File "/usr/lib/python3.6/contextlib.py", line 99, in exit self.gen.throw(type, value, traceback) File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 195, in setup_context yield File "/usr/lib/python3.6/contextlib.py", line 99, in exit self.gen.throw(type, value, traceback) File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 166, in save_modules saved_exc.resume() File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 141, in resume six.reraise(type, exc, self._tb) File "/usr/lib/python3/dist-packages/setuptools/_vendor/six.py", line 685, in reraise raise value.with_traceback(tb) File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 154, in save_modules yield saved File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 195, in setup_context yield File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 250, in run_setup _execfile(setup_script, ns) File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 45, in _execfile exec(code, globals, locals) File "/tmp/easy_install-oy_hscvn/numpy-1.20.0rc1/setup.py", line 30, in url='https://gtsam.org/', RuntimeError: Python version >= 3.7 required. python/CMakeFiles/python-install.dir/build.make:58: recipe for target 'python/CMakeFiles/python-install' failed make[3]: ** [python/CMakeFiles/python-install] Error 1 CMakeFiles/Makefile2:1167: recipe for target 'python/CMakeFiles/python-install.dir/all' failed make[2]: [python/CMakeFiles/python-install.dir/all] Error 2 CMakeFiles/Makefile2:1174: recipe for target 'python/CMakeFiles/python-install.dir/rule' failed make[1]: [python/CMakeFiles/python-install.dir/rule] Error 2 Makefile:288: recipe for target 'python-install' failed make: [python-install] Error 2

If I try to set python to 3.7 (also tried 3.8), it returns following error:

cmake .. -DGTSAM_BUILD_PYTHON=1 -DGTSAM_PYTHON_VERSION=3.7.9 -- Found Eigen version: 3.3.7 -- GTSAM_POSE3_EXPMAP=ON, enabling GTSAM_ROT3_EXPMAP as well -- Could NOT find MKL (missing: MKL_INCLUDE_DIR MKL_LIBRARIES) -- Found PythonInterp: /usr/bin/python3.7 (found suitable exact version "3.7.9") CMake Error at /usr/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:137 (message): Could NOT find PythonLibs: Found unsuitable version "3.6.9", but required is exact version "3.7.9" (found /usr/lib/x86_64-linux-gnu/libpython3.6m.so) Call Stack (most recent call first): /usr/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:376 (_FPHSA_FAILURE_MESSAGE) /usr/share/cmake-3.10/Modules/FindPythonLibs.cmake:262 (FIND_PACKAGE_HANDLE_STANDARD_ARGS) wrap/cmake/PybindWrap.cmake:17 (find_package) python/CMakeLists.txt:19 (include)

-- Configuring incomplete, errors occurred! See also "/home/dlee640/gtsam_py/gtsam/build/CMakeFiles/CMakeOutput.log". See also "/home/dlee640/gtsam_py/gtsam/build/CMakeFiles/CMakeError.log".

Someone please help. Thanks!

Expected behavior

Python wrapper was supposed to compile clean without errors.

varunagrawal commented 3 years ago
  1. I don't understand why you are using sudo make python-install. make python-install (without the sudo) should be sufficient. Nowhere in the instructions do we recommend using sudo when installing the python wrapper.
  2. The issue from what I can see, seems to be that you are using numpy 1.20.0rc1 which enforces a requirement for Python 3.7 and greater. I don't understand why you would need 1.20.0 when 1.19 is available on PyPI and works great (unless you don't know how it was installed in the first place). This might be related to your use of sudo in the previous point.
dlee640 commented 3 years ago

Dear Varun,

Thank you for your response. I closed the issue regarding python wrapper documentation, since

$ cmake .. -DGTSAM_BUILD_PYTHON=1 -DGTSAM_PYTHON_VERSION=3.6.9 ..
$ make -j4
$ make python-install

all worked successfully. Only thing I couldnt not get to run was the last line, where I still had to use sudo despite having numpy 1.19 on my system.

However, upon running unittests for python, I get following error (ALL tests fail with same error, so I only attached code for one case):

======================================================================
ERROR: test_logging_optimizer (unittest.loader._FailedTest)
----------------------------------------------------------------------
ImportError: Failed to import test module: test_logging_optimizer
Traceback (most recent call last):
  File "/usr/lib/python3.6/unittest/loader.py", line 428, in _find_test_path
    module = self._get_module_from_name(name)
  File "/usr/lib/python3.6/unittest/loader.py", line 369, in _get_module_from_name
    __import__(name)
  File "/home/dlee640/gtsam/python/gtsam/tests/test_logging_optimizer.py", line 16, in <module>
    import gtsam
  File "/home/dlee640/.local/lib/python3.6/site-packages/gtsam/__init__.py", line 1, in <module>
    from .gtsam import *
ImportError: /home/dlee640/.local/lib/python3.6/site-packages/gtsam/gtsam.so: invalid ELF header

I followed instructions on the github,

cd <GTSAM_SOURCE_DIRECTORY>/python/gtsam/tests
python -m unittest discover

Is there something I am missing from the python installation phase? Thank you.

varunagrawal commented 3 years ago

What is the output when you run sudo python -V?

dlee640 commented 3 years ago

python 3.6.9

varunagrawal commented 3 years ago

Looks like something went wrong during your build, most likely due to all the python version switching or something else.

Can you rebuild the entire thing again from scratch following the process that works for you?

varunagrawal commented 3 years ago

Also, I believe you'll have a faster response by asking this question on the Google group.

dlee640 commented 3 years ago

Varun, thank you for your help. After following the instructions about the HandlePython file and making corrections, my unittests for python binding passed.

Only concern was that during $ make -j4, I needed to attempt it 3 times in order for it to compile.

varunagrawal commented 3 years ago

That's strange. I don't understand why you would need to run make multiple times.

What errors do you get in the initial runs?

dlee640 commented 3 years ago

Screenshot from 2020-12-29 16-34-53 This is the screenshot I took when the error occured. As you can see, when I attempted another $ make -j4, it ended up compiling successfully.

varunagrawal commented 3 years ago

Hmm it seems that you're potentially running out of RAM. I recommend turning off building of examples via ccmake. The wrapper is a real memory hog and we've not figured out the best way to tackle it thus far.