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

Build devel branch fails on MacOS when USES_MATLAB is ON #675

Closed
lrapetti opened this issue Apr 21, 2020 · 15 comments
Closed

Build devel branch fails on MacOS when USES_MATLAB is ON #675

lrapetti opened this issue Apr 21, 2020 · 15 comments
Assignees

Comments

@lrapetti
Copy link
Member

At first it failed with the same error experienced in #630, fixed by recompiling a clean build.

However, after turning IDYNTREE_USES_MATLAB ON, it was failing with the following message:

[ 99%] Building CXX object bindings/matlab/CMakeFiles/iDynTreeMEX.dir/autogenerated/iDynTreeMATLAB_wrap.cxx.o
/Users/lorenzorapetti/Software/robotology-superbuild/robotology/iDynTree/bindings/matlab/autogenerated/iDynTreeMATLAB_wrap.cxx:4549:30: error: non-constant-expression cannot be narrowed from type 'int' to 'mwSize' (aka 'unsigned long') in initializer list [-Wc++11-narrowing]
        const mwSize dims[]={nMatrices,nRows,nCols};
                             ^~~~~~~~~
/Users/lorenzorapetti/Software/robotology-superbuild/robotology/iDynTree/bindings/matlab/autogenerated/iDynTreeMATLAB_wrap.cxx:4549:30: note: insert an explicit cast to silence this issue
        const mwSize dims[]={nMatrices,nRows,nCols};
                             ^~~~~~~~~
                             static_cast<mwSize>( )
/Users/lorenzorapetti/Software/robotology-superbuild/robotology/iDynTree/bindings/matlab/autogenerated/iDynTreeMATLAB_wrap.cxx:4549:40: error: non-constant-expression cannot be narrowed from type 'int' to 'mwSize' (aka 'unsigned long') in initializer list [-Wc++11-narrowing]
        const mwSize dims[]={nMatrices,nRows,nCols};
                                       ^~~~~
/Users/lorenzorapetti/Software/robotology-superbuild/robotology/iDynTree/bindings/matlab/autogenerated/iDynTreeMATLAB_wrap.cxx:4549:40: note: insert an explicit cast to silence this issue
        const mwSize dims[]={nMatrices,nRows,nCols};
                                       ^~~~~
                                       static_cast<mwSize>( )
/Users/lorenzorapetti/Software/robotology-superbuild/robotology/iDynTree/bindings/matlab/autogenerated/iDynTreeMATLAB_wrap.cxx:4549:46: error: non-constant-expression cannot be narrowed from type 'int' to 'mwSize' (aka 'unsigned long') in initializer list [-Wc++11-narrowing]
        const mwSize dims[]={nMatrices,nRows,nCols};
                                             ^~~~~
/Users/lorenzorapetti/Software/robotology-superbuild/robotology/iDynTree/bindings/matlab/autogenerated/iDynTreeMATLAB_wrap.cxx:4549:46: note: insert an explicit cast to silence this issue
        const mwSize dims[]={nMatrices,nRows,nCols};
                                             ^~~~~
                                             static_cast<mwSize>( )
/Users/lorenzorapetti/Software/robotology-superbuild/robotology/iDynTree/bindings/matlab/autogenerated/iDynTreeMATLAB_wrap.cxx:88975:5: warning: delete called on 'iDynTree::DiscreteExtendedKalmanFilterHelper' that is abstract but has non-virtual destructor [-Wdelete-non-virtual-dtor]
    delete arg1;
    ^
1 warning and 3 errors generated.
make[2]: *** [bindings/matlab/CMakeFiles/iDynTreeMEX.dir/autogenerated/iDynTreeMATLAB_wrap.cxx.o] Error 1
make[1]: *** [bindings/matlab/CMakeFiles/iDynTreeMEX.dir/all] Error 2
make: *** [all] Error 2

@lrapetti
Copy link
Member Author

CC @claudia-lat

@claudia-lat
Copy link
Contributor

I just tried to build it and it failed in the very same way.

@lrapetti
Copy link
Member Author

The problem was introduced in #668

@traversaro
Copy link
Member

So, there are two main problems here:

@traversaro
Copy link
Member

Let me know if no one is able to handle the fix discussed in the previous comment, then I can handle it. @fjandrad @lrapetti @claudia-lat

@lrapetti
Copy link
Member Author

Let me know if no one is able to handle the fix discussed in the previous comment, then I can handle it. @fjandrad @lrapetti @claudia-lat

I can take care of regenerating the bindings

@traversaro
Copy link
Member

Great, thanks! Remember to separate the commit that modifies the .i file and the one that add the generated bindings (as documented in https://github.com/robotology/idyntree/blob/master/doc/dev/faqs.md#how-to-add-wrap-a-new-class-or-function-with-swig). Instead you don't need to update the Changelog, as this fix is fixing a bug that was never included in a released version of iDynTree.

@lrapetti
Copy link
Member Author

PR opened at #676

traversaro added a commit that referenced this issue Apr 21, 2020
@claudia-lat
Copy link
Contributor

The PR has been merged. Now it works! Thanks @lrapetti @traversaro

@lrapetti
Copy link
Member Author

  • The fact that this was not catched by the CI. Probably to fix this we just need to add brew install octave and pass -DIDYNTREE_USES_OCTAVE:BOOL=ON to the macOS build.

I have opened a PR also for adding the test in #677

@traversaro
Copy link
Member

  • The fact that this was not catched by the CI. Probably to fix this we just need to add brew install octave and pass -DIDYNTREE_USES_OCTAVE:BOOL=ON to the macOS build.

I have opened a PR also for adding the test in #677

Thanks!

@lrapetti
Copy link
Member Author

Both #676 and #677 have been merged. We can close this issue.

@traversaro
Copy link
Member

Thanks @lrapetti !

@fjandrad
Copy link
Contributor

Sorry for the late response I was without a computer for two days. I'm glad is fixed. Why does it only affect MACOS?

@traversaro
Copy link
Member

I guess it is something related to the default settings of Clang (used in macOS) that are different from the one in GCC (used in Linux).

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

No branches or pull requests

4 participants