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: TypeError: unhashable type: 'Typename' #1184

Closed
xiaocaiyaa opened this issue May 2, 2022 · 5 comments · Fixed by #1205
Closed

Error in building MATLAB wrapper: TypeError: unhashable type: 'Typename' #1184

xiaocaiyaa opened this issue May 2, 2022 · 5 comments · Fixed by #1205
Assignees
Labels
bug Bug report

Comments

@xiaocaiyaa
Copy link

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

...
[ 94%] Built target SmartProjectionFactorExample
[ 94%] Built target FixedLagSmootherExample
[ 97%] Built target SmartRangeExample_plaza1
[ 97%] Generating ../wrap/gtsam/gtsam_wrapper.cpp
[MatlabWrapper] Ignoring classes: ['gtsam::Point2', 'gtsam::Point3', 'gtsam::CustomFactor']
Traceback (most recent call last):
File "/home/air/gtsam-develop/wrap/scripts/matlab_wrap.py", line 58, in
cc_content = wrapper.wrap(sources, path=args.out)
File "/home/air/gtsam-develop/wrap/gtwrap/matlab_wrapper/wrapper.py", line 1639, in wrap
self.wrap_namespace(module)
File "/home/air/gtsam-develop/wrap/gtwrap/matlab_wrapper/wrapper.py", line 1034, in wrap_namespace
self.wrap_namespace(element)
File "/home/air/gtsam-develop/wrap/gtwrap/matlab_wrapper/wrapper.py", line 1040, in wrap_namespace
class_text = self.wrap_instantiated_class(
File "/home/air/gtsam-develop/wrap/gtwrap/matlab_wrapper/wrapper.py", line 964, in wrap_instantiated_class
self.wrap_class_constructors(
File "/home/air/gtsam-develop/wrap/gtwrap/matlab_wrapper/wrapper.py", line 660, in wrap_class_constructors
varargin=self._wrap_variable_arguments(
File "/home/air/gtsam-develop/wrap/gtwrap/matlab_wrapper/wrapper.py", line 237, in _wrap_variable_arguments
check_type = self._format_type_name(
File "/home/air/gtsam-develop/wrap/gtwrap/matlab_wrapper/mixins.py", line 134, in _format_type_name
self._format_type_name(type_name.instantiations[idx],
File "/home/air/gtsam-develop/wrap/gtwrap/matlab_wrapper/mixins.py", line 112, in _format_type_name
formatted_type_name += self.data_type.get(name) or name
TypeError: unhashable type: 'Typename'
make[2]: *** [matlab/CMakeFiles/gtsam_matlab_wrapper.dir/build.make:76:wrap/gtsam/gtsam_wrapper.cpp] error 1
make[1]: *** [CMakeFiles/Makefile2:32161:matlab/CMakeFiles/gtsam_matlab_wrapper.dir/all] error 2
make: *** [Makefile:163:all] error 2

Could you help me to find what's wrong with it?
Python 3.8.10
Ubuntu 20.04.1 LTS
GTSAM 4.1.1

@richardXia7462
Copy link

I also meet this problem

@water137780117
Copy link

water137780117 commented May 15, 2022

The same issue.
Python 3.10.4
macOS 12.3.1 (M1)
GTSAM 4.2a6

@carlatcrown
Copy link

Same issue
Ubuntu Focal 20.04
MatLab 2020b

Works with 4.2a5, fails with 4.2a6.

cmake: CMAKE_ARGS=-DGTSAM_USE_SYSTEM_EIGEN:BOOLEAN=FALSE -DGTSAM_WITH_EIGEN_MKL:BOOLEAN=FALSE -DGTSAM_WITH_TBB:BOOLEAN=FALSE -DGTSAM_BUILD_EXAMPLES_ALWAYS:BOOL=FALSE -DGTSAM_BUILD_UNSTABLE:OPTION=OFF -DCMAKE_BUILD_TYPE:STRING=Release -DGTSAM_BUILD_WITH_MARCH_NATIVE:BOOL=OFF -DGTSAM_INSTALL_MATLAB_TOOLBOX:BOOLEAN=true -DMEX_COMMAND:STRING=/usr/local/MATLAB/R2020b/bin/mex
CXX_FLAGS=-DEIGEN_DONT_VECTORIZE -DEIGEN_DISABLE_UNALIGNED_ARRAY_ASSERT -march=skylake

@varunagrawal
Copy link
Collaborator

Sorry for the late response. I was able to reproduce and fix the issue. Once #1205 gets merged, you can just get the latest develop and everything should work.

If you still face any problems, please feel free to open a new issue.

@varunagrawal varunagrawal self-assigned this May 25, 2022
@varunagrawal varunagrawal added the bug Bug report label May 25, 2022
@carlatcrown
Copy link

Thanks for the fix - confirmed working.

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

Successfully merging a pull request may close this issue.

5 participants