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

Error in building MATLAB wrapper: No module named 'gtwrap' #1118

Closed
SarveshS325 opened this issue Feb 22, 2022 · 36 comments · Fixed by #1140, borglab/wrap#149 or #1235
Closed

Error in building MATLAB wrapper: No module named 'gtwrap' #1118

SarveshS325 opened this issue Feb 22, 2022 · 36 comments · Fixed by #1140, borglab/wrap#149 or #1235
Assignees
Labels
matlab Related to MATLAB wrapper wrapper Related to the wrapper

Comments

@SarveshS325
Copy link

SarveshS325 commented Feb 22, 2022

Description

I am trying to build the MATLAB wrapper. Getting the following error

Traceback (most recent call last):
  File "/home/sarvesh/Libraries/gtsam/wrap/scripts/matlab_wrap.py", line 11, in <module>
    from gtwrap.matlab_wrapper import MatlabWrapper
ModuleNotFoundError: No module named 'gtwrap'
matlab/CMakeFiles/gtsam_matlab_wrapper.dir/build.make:86: recipe for target 'wrap/gtsam/gtsam_wrapper.cpp' failed
make[2]: *** [wrap/gtsam/gtsam_wrapper.cpp] Error 1
CMakeFiles/Makefile2:30583: recipe for target 'matlab/CMakeFiles/gtsam_matlab_wrapper.dir/all' failed
make[1]: *** [matlab/CMakeFiles/gtsam_matlab_wrapper.dir/all] Error 2
Makefile:165: recipe for target 'all' failed
make: *** [all] Error 2

Steps to reproduce

cmake -DCMAKE_BUILD_TYPE=Release -DGTSAM_TOOLBOX_INSTALL_PATH:PATH=$HOME/matlab/toolbox  -DGTSAM_BUILD_UNSTABLE:OPTION=ON  -DGTSAM_INSTALL_MATLAB_TOOLBOX=ON ..
  1. make

Environment

Ubuntu 18.04
gtsam 4.1.1
MATLAB 2018a
Python 3.8.12 (conda env)

Additional information

I am able to build the python wrapper just fine

cmake -DCMAKE_BUILD_TYPE=Release -DGTSAM_BUILD_UNSTABLE:OPTION=ON -DGTSAM_PYTHON_VERSION=3.8.12 -DGTSAM_BUILD_PYTHON=1 ..
@varunagrawal varunagrawal self-assigned this Feb 22, 2022
@varunagrawal
Copy link
Collaborator

Thanks for reporting! It'll be about a few days before I can look into this (since we're all trying to make IROS 22 deadlines), but it looks like it should be a simple fix.

@SarveshS325
Copy link
Author

Any idea where the problem could be arising from?

@frank-Regal
Copy link

also getting the same error when building, any resolution?

@dellaert
Copy link
Member

@varunagrawal we don’t’ have to “git clone” with some sub tree flag, right? At least, I remember it works out of the box for me.

@varunagrawal
Copy link
Collaborator

@SarveshS325 the issue is that you're using a conda environment, so you'll need to specify the values for GTSAM_PYTHON_VERSION and PYTHON_EXECUTABLE in CMake (using ccmake for example).

@SarveshS325
Copy link
Author

@varunagrawal, if that were the case I should not have been able to build python bindings either. I have tried with system python3 outside conda environment and setting the GTSAM_PYTHON_VERSION variable, same result.

@varunagrawal
Copy link
Collaborator

Fair point. Can you please share the GTSAM branch and commit you are trying to build?

@SarveshS325
Copy link
Author

I am building from the source archive of the 4.1.1 release

@varunagrawal
Copy link
Collaborator

Oh then it seems like a bug creeped in that was subsequently fixed. We don't have a CI for Matlab which is why it wasn't caught before, so I apologize for that.

Do you mind building the latest develop branch? It should have the fixes and there should be no impact to your existing code.

@varunagrawal
Copy link
Collaborator

Quick update: even develop has some issues :-( I'll put in a PR in a few minutes.

@SarveshS325
Copy link
Author

SarveshS325 commented Mar 18, 2022

Yup, just checked.
Also, there is another related issue in the latest commit when GTSAM_UNSTABLE_INSTALL_MATLAB_TOOLBOX is ON

CMake Error at matlab/CMakeLists.txt:95 (matlab_wrap):
  matlab_wrap Function invoked with incorrect arguments for function named:
  matlab_wrap

@varunagrawal
Copy link
Collaborator

@SarveshS325 @frank-Regal can you please try with the latest develop?

@SarveshS325
Copy link
Author

SarveshS325 commented Mar 22, 2022

@varunagrawal No, still the same issue

Traceback (most recent call last):
  File "/home/sarvesh/Libraries/gtsam/wrap/scripts/matlab_wrap.py", line 11, in <module>
    from gtwrap.matlab_wrapper import MatlabWrapper
ModuleNotFoundError: No module named 'gtwrap'
matlab/CMakeFiles/gtsam_matlab_wrapper.dir/build.make:86: recipe for target 'wrap/gtsam/gtsam_wrapper.cpp' failed

@varunagrawal
Copy link
Collaborator

Can you please post the error message?

@SarveshS325
Copy link
Author

It is the same as in the original issue

Traceback (most recent call last):
  File "/home/sarvesh/Libraries/gtsam/wrap/scripts/matlab_wrap.py", line 11, in <module>
    from gtwrap.matlab_wrapper import MatlabWrapper
ModuleNotFoundError: No module named 'gtwrap'
matlab/CMakeFiles/gtsam_matlab_wrapper.dir/build.make:86: recipe for target 'wrap/gtsam/gtsam_wrapper.cpp' failed
make[2]: *** [wrap/gtsam/gtsam_wrapper.cpp] Error 1
CMakeFiles/Makefile2:30583: recipe for target 'matlab/CMakeFiles/gtsam_matlab_wrapper.dir/all' failed
make[1]: *** [matlab/CMakeFiles/gtsam_matlab_wrapper.dir/all] Error 2
Makefile:165: recipe for target 'all' failed
make: *** [all] Error 2

@varunagrawal varunagrawal reopened this Mar 22, 2022
@varunagrawal
Copy link
Collaborator

Can you change that line in matlab_wrap.py to from gtwrap.matlab_wrapper.wrapper import MatlabWrapper?

@varunagrawal
Copy link
Collaborator

This is very weird, especially since the python wrapper works for you. Both wrappers have a line from gtwrap.X import Y so if your system is able to build the python wrapper, then it should be able to build the Matlab wrapper.

Would you mind clearing your build directory and recompiling from scratch? The CMake cache may not have updated. Also please make sure you're on commit d0a1852.

@SarveshS325
Copy link
Author

SarveshS325 commented Mar 23, 2022

I have tried starting with a squeaky clean build and I am on d0a1852. Maybe there is a difference between how pybind_wrap.py and matlab_wrap.py are being invoked

@SarveshS325 SarveshS325 reopened this Mar 23, 2022
@varunagrawal varunagrawal added matlab Related to MATLAB wrapper wrapper Related to the wrapper labels Apr 2, 2022
@wxchencn
Copy link

I have the same problem, is there a solution now?

  • Ubuntu 18.04
  • gtsam 4.0.2
  • MATLAB R2022a
  • Python 3.6.9

Error message:

Traceback (most recent call last):
  File "/home/wxchen/Project/tactile/shape-map-3D/gtsam/wrap/scripts/matlab_wrap.py", line 11, in <module>
    from gtwrap.matlab_wrapper import MatlabWrapper
ModuleNotFoundError: No module named 'gtwrap'
matlab/CMakeFiles/gtsam_matlab_wrapper.dir/build.make:92: recipe for target 'wrap/gtsam/gtsam_wrapper.cpp' failed
make[2]: *** [wrap/gtsam/gtsam_wrapper.cpp] Error 1

@varunagrawal
Copy link
Collaborator

@SarveshS325 @wxchencn I recently made some updates to the wrapper. Can you please try again?

@YeXiaoYu539
Copy link

@varunagrawal I have tried the latest version '4.2a7' , but it doesn't seem to be working, the same error occurs.

  • Ubuntu18.04
  • gtsam 4.2a7
  • MATLAB R2021a
  • Python 3.6.9

Error message:
Traceback (most recent call last): File "/home/yexiaoyu/gtsam-4.2a7/wrap/scripts/matlab_wrap.py", line 11, in <module> from gtwrap.matlab_wrapper import MatlabWrapper ModuleNotFoundError: No module named 'gtwrap' matlab/CMakeFiles/gtsam_matlab_wrapper.dir/build.make:75: recipe for target 'wrap/gtsam/gtsam_wrapper.cpp' failed make[2]: *** [wrap/gtsam/gtsam_wrapper.cpp] Error 1 CMakeFiles/Makefile2:37600: recipe for target 'matlab/CMakeFiles/gtsam_matlab_wrapper.dir/all' failed

Thanks very much!

@varunagrawal
Copy link
Collaborator

Can you try the latest develop branch please?

@YeXiaoYu539
Copy link

Can you try the latest develop branch please?

I have tried the latest develop branch and have the same error.
File "/home/yexiaoyu/gtsam/wrap/scripts/matlab_wrap.py", line 11, in <module> from gtwrap.matlab_wrapper import MatlabWrapper ModuleNotFoundError: No module named 'gtwrap' matlab/CMakeFiles/gtsam_matlab_wrapper.dir/build.make:75: recipe for target 'wrap/gtsam/gtsam_wrapper.cpp' failed

Thanks very much!

@YeXiaoYu539
Copy link

Can you try the latest develop branch please?

I try the version GTSAM 4.0.3 Release , and the problem does not appear.

Thanks very much!

  • Ubuntu18.04
  • GTSAM 4.0.3
  • MATLAB R2018a
  • Python 3.6.9

@varunagrawal
Copy link
Collaborator

Can you add this on line 254 of MatlabWrap.cmake and give us the output?

message(">>>>>>>>>>> PYTHONPATH=${GTWRAP_PACKAGE_DIR}${GTWRAP_PATH_SEPARATOR}$ENV{PYTHONPATH}")

@varunagrawal
Copy link
Collaborator

Also please paste the full message here please, starting from the output of CMake.

@varunagrawal
Copy link
Collaborator

@SarveshS325 @YeXiaoYu539 please give us the full message and error log so we can see what is going on in your settings. We have an idea of what the issue may be but we need to confirm it.

@varunagrawal
Copy link
Collaborator

Can you also provide your CMake versions?

@YeXiaoYu539
Copy link

Can you add this on line 254 of MatlabWrap.cmake and give us the output?

message(">>>>>>>>>>> PYTHONPATH=${GTWRAP_PACKAGE_DIR}${GTWRAP_PATH_SEPARATOR}$ENV{PYTHONPATH}")
  • Ubuntu18.04
  • GTSAM 4.0.3
  • MATLAB R2018a
  • Python 3.6.9
  • CMake version : 3.10.2

Cmake Output

~/gtsam-4.0.3/build
$ cmake -DEXAMPLES_BUILD_MATLAB_TOOLBOX:OPTION=ON -DGTSAM_TOOLBOX_INSTALL_PATH:PATH=/path/install/toolbox ..
-- GTSAM_SOURCE_ROOT_DIR: [/home/yexiaoyu/gtsam-4.0.3]
-- Could NOT find MKL (missing: MKL_INCLUDE_DIR MKL_LIBRARIES) 
-- Found OpenMP_C: -fopenmp  
-- Found OpenMP_CXX: -fopenmp  
-- Found OpenMP: TRUE   
-- Found Eigen version: 3.3.7
-- Building 3rdparty
-- 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 smart
-- Building navigation
-- GTSAM Version: 4.0.3
-- Install prefix: /usr/local
-- Building GTSAM - shared: ON
-- Building wrap module gtsam
-- Installing Matlab Toolbox to /path/install/toolbox
-- 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.0.3
-- Install prefix: /usr/local
-- Building wrap module gtsam_unstable
-- Installing Matlab Toolbox to /path/install/toolbox
-- Wrote /home/yexiaoyu/gtsam-4.0.3/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 for native architecture  : Enabled
--   Build type                     : Release
--   C compilation flags            :  -O3 -DNDEBUG
--   C++ compilation flags          :  -Wno-misleading-indentation -O3 -DNDEBUG
--  GTSAM_COMPILE_FEATURES_PUBLIC                    : cxx_std_11
--  GTSAM_COMPILE_OPTIONS_PRIVATE                    : -Wall;-fPIC;$<$<CONFIG:Debug>:-g;-fno-inline>;$<$<CONFIG:Release>:-O3>;$<$<CONFIG:Timing>:-g;-O3>;$<$<CONFIG:Profiling>:-O3>;$<$<CONFIG:RelWithDebInfo>:-g;-O3>;-Wno-unused-local-typedefs
--  GTSAM_COMPILE_OPTIONS_PUBLIC                     : -march=native
--  GTSAM_COMPILE_DEFINITIONS_PRIVATE                : $<$<CONFIG:Debug>:_DEBUG;EIGEN_INITIALIZE_MATRICES_BY_NAN>;$<$<CONFIG:Release>:NDEBUG>;$<$<CONFIG:Timing>:NDEBUG;ENABLE_TIMING>;$<$<CONFIG:Profiling>:NDEBUG>;$<$<CONFIG:RelWithDebInfo>:NDEBUG>
--  GTSAM_COMPILE_DEFINITIONS_PUBLIC                 : 
--  GTSAM_COMPILE_OPTIONS_PRIVATE_DEBUG              : -g;-fno-inline
--  GTSAM_COMPILE_OPTIONS_PUBLIC_DEBUG               : 
--  GTSAM_COMPILE_DEFINITIONS_PRIVATE_DEBUG          : _DEBUG;EIGEN_INITIALIZE_MATRICES_BY_NAN
--  GTSAM_COMPILE_DEFINITIONS_PUBLIC_DEBUG           : 
--  GTSAM_COMPILE_OPTIONS_PRIVATE_RELEASE            : -O3
--  GTSAM_COMPILE_OPTIONS_PUBLIC_RELEASE             : 
--  GTSAM_COMPILE_DEFINITIONS_PRIVATE_RELEASE        : NDEBUG
--  GTSAM_COMPILE_DEFINITIONS_PUBLIC_RELEASE         : 
--  GTSAM_COMPILE_OPTIONS_PRIVATE_TIMING             : -g;-O3
--  GTSAM_COMPILE_OPTIONS_PUBLIC_TIMING              : 
--  GTSAM_COMPILE_DEFINITIONS_PRIVATE_TIMING         : NDEBUG;ENABLE_TIMING
--  GTSAM_COMPILE_DEFINITIONS_PUBLIC_TIMING          : 
--  GTSAM_COMPILE_OPTIONS_PRIVATE_PROFILING          : -O3
--  GTSAM_COMPILE_OPTIONS_PUBLIC_PROFILING           : 
--  GTSAM_COMPILE_DEFINITIONS_PRIVATE_PROFILING      : NDEBUG
--  GTSAM_COMPILE_DEFINITIONS_PUBLIC_PROFILING       : 
--  GTSAM_COMPILE_OPTIONS_PRIVATE_RELWITHDEBINFO     : -g;-O3
--  GTSAM_COMPILE_OPTIONS_PUBLIC_RELWITHDEBINFO      : 
--  GTSAM_COMPILE_DEFINITIONS_PRIVATE_RELWITHDEBINFO : NDEBUG
--  GTSAM_COMPILE_DEFINITIONS_PUBLIC_RELWITHDEBINFO  : 
--  GTSAM_COMPILE_OPTIONS_PRIVATE_MINSIZEREL         : 
--  GTSAM_COMPILE_OPTIONS_PUBLIC_MINSIZEREL          : 
--  GTSAM_COMPILE_DEFINITIONS_PRIVATE_MINSIZEREL     : 
--  GTSAM_COMPILE_DEFINITIONS_PUBLIC_MINSIZEREL      : 
--   Use System Eigen                : OFF (Using version: 3.3.7)
--   Use Intel TBB                   : Yes
--   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
--   Deprecated in GTSAM 4 allowed   : Enabled
--   Point3 is typedef to Vector3    : Disabled
--   Metis-based Nested Dissection   : Enabled
--   Use tangent-space preintegration: Enabled
--   Build Wrap                      : Enabled
-- MATLAB toolbox flags                                      
--   Install MATLAB toolbox          : Enabled
--   MATLAB root                     : /home/yexiaoyu/gtsam-4.0.3/build/matlab
--   MEX binary                      : /home/yexiaoyu/gtsam-4.0.3/build/matlab/bin/mex
-- Cython toolbox flags                                      
--   Install Cython toolbox          : Disabled
-- ===============================================================
-- Configuring done
-- Generating done
CMake Warning:
  Manually-specified variables were not used by the project:

    EXAMPLES_BUILD_MATLAB_TOOLBOX


-- Build files have been written to: /home/yexiaoyu/gtsam-4.0.3/build

@YeXiaoYu539
Copy link

@SarveshS325 @YeXiaoYu539 please give us the full message and error log so we can see what is going on in your settings. We have an idea of what the issue may be but we need to confirm it.

  • Ubuntu18.04
  • GTSAM 4.2a7
  • MATLAB R2018a
  • Python 3.6.9
  • CMake version : 3.10.2
/gtsam/build$ cmake -DEXAMPLES_BUILD_MATLAB_TOOLBOX:OPTION=ON -DGTSAM_TOOLBOX_INSTALL_PATH:PATH=/path/install/toolbox ..
-- GTSAM Version: 4.2a7
-- GTSAM_POSE3_EXPMAP=ON, enabling GTSAM_ROT3_EXPMAP as well
-- Found Eigen version: 3.3.7
-- checking for thread-local storage - found
-- Could NOT find MKL (missing: MKL_INCLUDE_DIR MKL_LIBRARIES) 
-- Building 3rdparty
-- Could NOT find GeographicLib (missing: GeographicLib_LIBRARY_DIRS GeographicLib_LIBRARIES GeographicLib_INCLUDE_DIRS) 
-- Building base
-- Building basis
-- Building geometry
-- Building inference
-- Building symbolic
-- Building discrete
-- Building hybrid
-- Building linear
-- Building nonlinear
-- Building sam
-- Building sfm
-- Building slam
-- Building navigation
-- GTSAM Version: 4.2.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.2.0
-- Install prefix: /usr/local
CMake Warning at wrap/cmake/GtwrapUtils.cmake:96 (find_package):
  By not providing "FindPython.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "Python", but
  CMake did not find one.

  Could not find a package configuration file provided by "Python" (requested
  version 3.6.9) with any of the following names:

    PythonConfig.cmake
    python-config.cmake

  Add the installation prefix of "Python" to CMAKE_PREFIX_PATH or set
  "Python_DIR" to a directory containing one of the above files.  If "Python"
  provides a separate development package or SDK, be sure it has been
  installed.
Call Stack (most recent call first):
  wrap/CMakeLists.txt:10 (gtwrap_get_python_version)


-- gtwrap Package config : /usr/local/lib/cmake/gtwrap
-- gtwrap version        : 1.0
-- gtwrap CMake path     : /usr/local/lib/cmake/gtwrap
-- gtwrap library path   : /usr/local/lib/gtwrap
-- gtwrap binary path    : /usr/local/bin/gtwrap
-- gtwrap header path    : /usr/local/include/gtwrap
-- Building wrap module gtsam
-- Installing Matlab Toolbox to /path/install/toolbox
-- GTSAM_SOURCE_ROOT_DIR: [/home/yexiaoyu/gtsam]
-- Wrote /home/yexiaoyu/gtsam/build/GTSAMConfig.cmake
-- Wrote /home/yexiaoyu/gtsam/build/GTSAM_UNSTABLEConfig.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                     : 
--  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 System Metis                                 : OFF
--  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                           : Enabled
--  MATLAB root                                      : /XXX/Matlab
--  MEX binary                                       : /XXX/Matlab/bin/mex
-- Python toolbox flags                                      
--  Build Python module with pybind                  : Disabled
-- ===============================================================
-- Configuring done
-- Generating done
-- Build files have been written to: /home/yexiaoyu/gtsam/build

@YeXiaoYu539
Copy link

  • Ubuntu18.04
  • GTSAM 4.2a7
  • MATLAB R2018a
  • Python 3.6.9
  • CMake version : 3.10.2
~/gtsam/build$ make -j12
[  2%] Built target CppUnitLite
[ 17%] Built target metis-gtsam
[ 58%] Built target gtsam
[ 58%] Built target UGM_small
[ 58%] Built target UGM_chain
[ 58%] Built target StereoVOExample
[ 58%] Built target SolverComparer
[ 58%] Built target StereoVOExample_large
[ 58%] Built target TimeTBB
[ 58%] Built target Pose3SLAMExample_changeKeys
[ 58%] Built target ImuFactorsExample2
[ 58%] Built target PlanarSLAMExample
[ 58%] Built target SimpleRotation
[ 58%] Built target ShonanAveragingCLI
[ 58%] Built target Pose2SLAMStressTest
[ 58%] Built target Pose2SLAMExample_graph
[ 58%] Built target HMMExample
[ 58%] Built target CameraResectioning
[ 58%] Built target IMUKittiExampleGPS
[ 58%] Built target SFMExample_bal
[ 58%] Built target DiscreteBayesNet_FG
[ 58%] Built target ISAM2Example_SmartFactor
[ 58%] Built target Pose3SLAMExampleExpressions_BearingRangeWithTransform
[ 58%] Built target CombinedImuFactorsExample
[ 58%] Built target OdometryExample
[ 58%] Built target SFMExample_bal_COLAMD_METIS
[ 61%] Built target Pose2SLAMExample_g2o
[ 61%] Built target Pose3Localization
[ 61%] Built target Pose2SLAMExampleExpressions
[ 61%] Built target DiscreteBayesNetExample
[ 61%] Built target easyPoint2KalmanFilter
[ 64%] Built target CreateSFMExampleData
[ 64%] Built target METISOrderingExample
[ 64%] Built target Pose2SLAMExample
[ 64%] Built target LocalizationExample
[ 66%] Built target VisualISAMExample
[ 69%] Built target Pose3SLAMExample_initializePose3Chordal
[ 69%] Built target Pose2SLAMExample_graphviz
[ 69%] Built target InverseKinematicsExampleExpressions
[ 71%] Built target Pose2SLAMwSPCG
[ 71%] Built target Pose3SLAMExample_g2o
[ 71%] Built target SFMExample
[ 71%] Built target Pose3SLAMExample_initializePose3Gradient
[ 71%] Built target SFMExample_SmartFactor
[ 74%] Built target SFMExampleExpressions_bal
[ 74%] Built target RangeISAMExample_plaza2
[ 74%] Built target SFMExample_SmartFactorPCG
[ 74%] Built target SFMExampleExpressions
[ 74%] Built target VisualISAM2Example
[ 74%] Generating ../wrap/gtsam/gtsam_wrapper.cpp
[ 74%] Built target ImuFactorsExample
[ 76%] Built target SelfCalibrationExample
[ 76%] Built target FisheyeExample
[ 76%] Built target Pose2SLAMExample_lago
[ 87%] Built target gtsam_unstable
Traceback (most recent call last):
  File "/home/yexiaoyu/gtsam/wrap/scripts/matlab_wrap.py", line 11, in <module>
    from gtwrap.matlab_wrapper import MatlabWrapper
ModuleNotFoundError: No module named 'gtwrap'
matlab/CMakeFiles/gtsam_matlab_wrapper.dir/build.make:75: recipe for target 'wrap/gtsam/gtsam_wrapper.cpp' failed
make[2]: *** [wrap/gtsam/gtsam_wrapper.cpp] Error 1
CMakeFiles/Makefile2:37985: recipe for target 'matlab/CMakeFiles/gtsam_matlab_wrapper.dir/all' failed
make[1]: *** [matlab/CMakeFiles/gtsam_matlab_wrapper.dir/all] Error 2
make[1]: *** 正在等待未完成的任务....
[ 89%] Built target schedulingQuals13
[ 92%] Built target FixedLagSmootherExample
[ 94%] Built target TimeOfArrivalExample
[ 94%] Built target schedulingExample
[ 94%] Built target GncPoseAveragingExample
[ 94%] Built target schedulingQuals12
[ 94%] Built target SmartStereoProjectionFactorExample
[ 94%] Built target ConcurrentCalibration
[ 97%] Built target ISAM2_SmartFactorStereo_IMU
[100%] Built target SmartRangeExample_plaza2
[100%] Built target SmartProjectionFactorExample
Makefile:162: recipe for target 'all' failed
make: *** [all] Error 2

@varunagrawal
Copy link
Collaborator

Thanks for the info. Can you try fixing that Cmake warning? That may actually be your issue (and we should make that an error rather than a warning).

@varunagrawal
Copy link
Collaborator

If you're using the system python, the fix is to do apt install python3-dev

@varunagrawal
Copy link
Collaborator

@SarveshS325 @YeXiaoYu539 @frank-Regal I figured out the issue!!! PR #1235 fixes this. 🎉

@varunagrawal
Copy link
Collaborator

Can you please comment on whether the latest develop branch works for you?

@YeXiaoYu539
Copy link

Can you please comment on whether the latest develop branch works for you?

Thanks very much! I have already tried the latest develop branch, it indeed fixes the problem!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
matlab Related to MATLAB wrapper wrapper Related to the wrapper
Projects
None yet
6 participants