eigenpy icon indicating copy to clipboard operation
eigenpy copied to clipboard

example: custom numeric type

Open ofloveandhate opened this issue 2 years ago • 5 comments

This pull request is an example of building against EigenPy to expose Eigen objects with custom numeric types from C++. This is in response to #365.

This example at time of PR builds and installs, but not fully correctly. It doesn't install usable Python bindings, so the example Python code is not runnable. Maybe you could do that last step? So that the built bindings can actually be used in Python?

ofloveandhate avatar May 18 '23 20:05 ofloveandhate

TODO:

  • [ ] Remove useless files
  • [ ] SImplify cmake usage
  • [ ] Extend Python test with the creation of Numpy arrays used by a C++ program

jcarpent avatar May 19 '23 09:05 jcarpent

I tried to use the code in this PR, and it doesn't install correctly on my Mac. I observe the following issues:

  • I needed to change line 3 in CMakeLists.txt to cmake_minimum_required(VERSION 3.10)
  • The built library, when installed, has extension .dylib instead of .so
  • The build library's name starts with lib, but it needs to just start with the actual name of the library.
  • If imported, I get missing symbols:
import libeigenpy_example_custom_numeric_type

ImportError: dlopen(/usr/local/lib/libeigenpy_example_custom_numeric_type.so, 0x0002): symbol not found in flat namespace '_EIGENPY_ARRAY_API'

I think all of these are issues with the CMakeLists.txt file.

ofloveandhate avatar Sep 20 '23 17:09 ofloveandhate

I would love to be able to build upon this to work on some problems I'm seeing with custom numeric types in EigenPy, and make this example more complete, but I am finding the setup stuff is a barrier. Thanks!

ofloveandhate avatar Sep 20 '23 17:09 ofloveandhate