-
Notifications
You must be signed in to change notification settings - Fork 802
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
Wrapper Update #727
Wrapper Update #727
Conversation
3eff76f60 Merge pull request #53 from borglab/feature/refactor 13215dfa7 Merge pull request #52 from borglab/fix/tests 696913b11 install setuptools 9523328ba Merge branch 'master' into fix/tests 7c630b361 some more cleanup 656993a71 cleaned up Typename a16f6f38e move qualified and basis type outside to their own class scope 72ead8bd7 Merge pull request #51 from borglab/fix/test-interface-parser 6deefd4fc added tests for interface_parser 50d490a85 Merge pull request #50 from borglab/feature/refs-all-types be4511290 updated docs for BasisType 0e80b0d8c update MATLAB tests 0015d7397 added support for shared pointer and ref for basis types 86d2158f1 remove std::string from list of Basis types 94f928441 ignore code coverage reports 2033dd345 replace prints with log.debug statements ae98091b3 fix deprecation in doc tests 13a2f66c4 Merge pull request #46 from borglab/feature/new-shared-pointer 3c7d85865 updated docs 6d7897088 use @ for raw pointer, go back to * for shared pointer 1d6194c57 updated matlab wrapper to handle both raw and shared pointers 1448f6924 fix some failing tests 2ab1dae32 Merge branch 'master' into feature/new-shared-pointer 96f8a56bd Merge pull request #47 from borglab/fix/ci 6003203f3 run CI only for pull requests a8f29ead1 fix the python version yml key fcae17227 check if directory exists when testing f592f08c9 explicit pip3 so that we don't use Python2 d49c2f3c2 correct call for pip dfe360526 fix the CI 149b7c523 docs for templated functions f2189acc6 support typedefing for templated functions 965458a2b added test for templated functions eaff6e6ab made is_const common for all types 3d9c70b32 added tests and cleaned up a bit 010b89626 support for simple pointers on basis types 6b98fd80c new syntax for shared_ptr ff7ad0b78 support for templated functions a1a443c8d Merge pull request #43 from borglab/fix/cmake-and-matlab 2f3a055e4 remove accidentally committed file 770d055e2 set proper paths for cmake and eschew relative paths 773d01ae1 fix bug in matlab wrapper 721ef740f Merge pull request #41 from borglab/feature/type-hints 67aac9758 minor refactor of CI yml e6a63ae0c fix all mypy issues a3aaa3e7c remove a lot of linter issues from matlab_wrapper a96db522f static typing for interface_parser git-subtree-dir: wrap git-subtree-split: 3eff76f604b5ba9e71cf4947654e288142ed7a94
@carlmorgan can you please use this branch to check for yourself? |
Off the bat:
With the generator patch / hack from my original issue post, this then generates For running the tests, I had to modify my Matlab libstdc++ to use the ubuntu base system one (but this step maybe a legacy of previous hacking on my local machine)
Then running the tests
|
@mksoccer Is also interested in having a working MATLAB wrapper. Adding him on this issue. |
548e61b1f Merge pull request #57 from borglab/fix/configurable-matlab-include b58eabaf1 set correct template file path 483cdab9c fix 1f393516d fix CI syntax 8f0a3543f more concise cmake command because we don't care about the extra files generated 641ad1326 update CI to run cmake de6b9260f added CMake variable to configure the include directory for matlab.h cbe5f18bc Merge pull request #54 from borglab/feature/refactor2 cc78ee3bb test formatting 046a50b01 break down interface_parser into a submodule of smaller parts git-subtree-dir: wrap git-subtree-split: 548e61b1fbf02759d2e4a52435c2f1b3cbde98f0
29628426d Merge pull request #59 from borglab/fixes a95429ea0 Merge pull request #56 from borglab/fix/this-instantiation 3e22d6516 more documenatation and some formatting 526301499 updated the test to test for non-templated This cdb75f36f Merge branch 'master' into fix/this-instantiation 0f5ae3b7f moved example pybind template to templates directory d55f5db38 remove extra whitespace 21891ad3d skip tests until we figure out what's going on 2ea6307c3 better way of handling the matlab includes in the matlab wrapper d0f8a392c Merge pull request #55 from borglab/feature/refactor3 57d47cbd9 create directories to store generated output 4788a1e37 fixed This instantiation 61d2cbfc4 add namespace test to matlab wrapper ec39023e6 added more, smaller tests for Python wrapper 19c35b857 test for matlab class inheritance and some clean up 06ca5da13 test for matlab functions cb05d7379 minor clean up and separate tests for geometry and class 8d8145cc4 break down test interface file into smaller files that can be easily debugged 97328f057 restructured test files and added dedicated fixtures directory git-subtree-dir: wrap git-subtree-split: 29628426d2c1a7bb728e40307c0f25cb468cd1bc
@carlmorgan I believe I have figure out the include file issue. |
Built and passed tests (both 04b9625 and 82d6e68) for us, BIONIC and FOCAL (w/Matlab 2020b1) - I will try and run a few other configs if I can this evening, but all looks good. |
Misc testing (with no depth of understanding) - let me know if you want separate issues / or feel free to move them: With Python bindings enabled, wrap/scripts/pybind_wrap.py is not executable, needed chmod 755 for it to continue.
I think there might also be issues with GTSAM_UNSTABLE_INSTALL_MATLAB_TOOLBOX:BOOL=TRUE, If I include with Without it - everything goes through / builds / tests fine, with it cmake failures possibly around pthread lib inclusion (which is used elsewhere) |
That permission denied issue is super weird. There should be no reason for that since we CMake doesn't touch that file other than to invoke it at binding. Can you share the error message for the unstable toolbox build along with any relevant system info? |
I'm going to try and reproduce the permission denied issue. |
I found out the problem with the second issue. Will add the fix to this PR. @carlmorgan your cmake command really helped me out with this one so you deserve full credit for it. |
Figured out and fixed the permission denied issue as well. Great catch and reporting @carlmorgan. |
399c30c
to
729953e
Compare
9a467794e Merge pull request #61 from borglab/fix/python-variables 6bae7af99 added more status messages and set the PYBIND11_PYTHON_VERSION each time 5129cf3b9 set both sets of Python variables and find python version when including PybindWrap 5a67b526c Merge pull request #60 from borglab/fix/multi-template-methods 4a73b29ef better method names for testing templated methods 989fdf946 added unit test for multi-template methods a56908c21 add namespace qualification to instantiations a25d9631e graceful handling of templated method instantiations 0baa5ab5d multiple templates in methods git-subtree-dir: wrap git-subtree-split: 9a467794e8542872b2782cdaec338aaa30a92e33
729953e
to
1e8973e
Compare
Okay making some big changes. Plus I broke something on the Matlab wrapper parser so need to figure that out as well. |
More 'other testing', [ develop + 1e8973e - Focal x86_64 / Matlab2020b1 / Python 3.8.5 ] - will stop until you let me know the other 'big changes' have been resolved. unstable matlab ON
Python ON, Unstable Matlab OFFLooks like the chmod might have been lost again.
|
96ccdfd0b Merge pull request #65 from borglab/fix/special-cases 04c06b7e6 Merge pull request #63 from borglab/fix/cmake bf2c91bd2 fix issue in template instantiation generator 152dbcb12 test for special cases d03004b24 fixed the cmake to discover the correct python version and set all corresponding variables 4cf66e0da Merge pull request #61 from borglab/fix/python-variables 80558e35b added more status messages and set the PYBIND11_PYTHON_VERSION each time 73afd1b0a set both sets of Python variables and find python version when including PybindWrap REVERT: 9a467794e Merge pull request #61 from borglab/fix/python-variables REVERT: 6bae7af99 added more status messages and set the PYBIND11_PYTHON_VERSION each time REVERT: 5129cf3b9 set both sets of Python variables and find python version when including PybindWrap git-subtree-dir: wrap git-subtree-split: 96ccdfd0b84a4dbf1b3e9ed31b95ebc2758be9cc
@carlmorgan just pushed the fixes. |
HEAD is now at 92ce070 Merging 'master' into 'wrap' Still no execute bit - maybe your editor is 'resetting' it? |
That shouldn't quite matter since we're exclusively calling the python executable on that file |
As checked in in GIT - fails to build, after chmod builds fine.
PYTHONPATH is set, but no python executable is specified on the command line. |
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=ON -DGTSAM_USE_QUATERNIONS:BOOL=TRUE -DGTSAM_BUILD_TESTS:BOOL=ON -DCMAKE_BUILD_TYPE:STRING=Release -DGDB:BOOL=TRUE -DDEBUG:BOOLEAN=TRUE -DASSERT:BOOLEAN=TRUE -DASSERT2:BOOLEAN=TRUE -DGTSAM_BUILD_PYTHON:BOOL=TRUE -DGTSAM_UNSTABLE_INSTALL_MATLAB_TOOLBOX:BOOLEAN=true -DGTSAM_INSTALL_MATLAB_TOOLBOX:BOOLEAN=true -DMEX_COMMAND:STRING=/usr/local/MATLAB/R2020b/bin/mex UNSTABLE ON, MATLAB UNSTABLE ON, PYTHON ONBuilds / completes / unit tests / matlab tests [ Focal x86_64 / Matlab2020b1 / Python 3.8.5 ] |
Are you using a virtual environment? |
Basically what is happening is that CMake is unable to find the python package on your system. It needs that to specify the interpreter and python versions |
No venv involved. Stock ubuntu python tooling. Looks like CMake is finding it.
CMakeCache.txt
It is also building the matlab_wrap.py without issue. I'll try digging further and let you know. Understood it shouldn't be needed. |
Testing on 92ce070
Haven't been able to run the python unit tests yet - can't get it to install to non system directories etc. .py chmod / CMake python executable issue not seen again on latest PR so I'll put down to 'ghosts' |
I wouldn't count on python 2 working for you. It's EOL and unsupported so best to upgrade or ignore it. Also, something to note is that the wrap directory is a git subtree so changes have to be first made and approved in the wrap repo. There might be some disconnect between when I pulled in some fixes and you tested the wrapper. At this point I'd like to land this PR and then take your feedback forward in the next one. |
Xenial and bionic both have python3, so could you test against the system Python 3 instead? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR is hard to review: Is it simply pulling in the new wrap from the other repo? In that case, I'll approve modulo CI succeeding. If there are any other changes (to .i files etc) I think they should go in a subsequent PR.
No changes to the .i files, but some CMake changes to get it to work correctly and address the issues @carlmorgan brought up. Also, 92ce070 has all the latest fixes for the chmod/permission-denied issue so super glad to see it works for you. |
Thanks for the merge - great to have everything back in a working state. @varunagrawal @ProfFan CMake will find 'python' but if the requirement for a support version is version 3.5+ (/whatever) it would be good to report at configure time (rather than compilation) - not an 'issue' per-se - I'm just being a 'user' :) From what I can see in the docs - official supported platforms are 16.04 & 18.04 which now are getting older - is there a plan for making 20.04 a primary platform? |
@carlmorgan you're correct and I agree with you. It should be reported at configuration time and we should make that happen soon. Thank you so so much for all your feedback though. It's been invaluable in fixing all the small bugs that crept in wrt the new wrapper. 🙂 |
I run GTSAM on Ubuntu 20.04 so it definitely works on there. Documentation is another thing that needs improvement, but for now let's enjoy a well-deserved weekend. |
Updated the wrapper so we have all the new goodies!