Idyntree: Build devel branch fails on MacOS when USES_MATLAB is ON

Created on 21 Apr 2020  路  15Comments  路  Source: robotology/idyntree

At first it failed with the same error experienced in https://github.com/robotology/idyntree/issues/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

All 15 comments

CC @claudia-lat

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

The problem was introduced in https://github.com/robotology/idyntree/pull/668

So, there are two main problems here:

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

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

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.

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

  • 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 https://github.com/robotology/idyntree/pull/677

  • 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!

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

Thanks @lrapetti !

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

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).

Was this page helpful?
0 / 5 - 0 ratings