coin-or / qpOASES

Open-source C++ implementation of the recently proposed online active set strategy
GNU Lesser General Public License v2.1
376 stars 127 forks source link

Matlab interface does not compile under OSX #27

Open svigerske opened 4 years ago

svigerske commented 4 years ago

Issue created by migration from Trac.

Original creator: ferreau

Original creation time: 2014-11-04 09:33:23

Assignee: ckirches

Version: 3.0.0

When I run the make script in interfaces/matlab directory, I get the following error:

In file included from qpOASES.cpp:36:
In file included from ../../include/qpOASES.hpp:50:
../../src/Matrices.cpp:1164:4: warning: add explicit braces to avoid
      dangling else [-Wdangling-else]
                        else return RET_NO_DIAGONAL_AVAILABLE;
                        ^
../../src/Matrices.cpp:1826:4: warning: add explicit braces to avoid
      dangling else [-Wdangling-else]
                        else return RET_NO_DIAGONAL_AVAILABLE;
                        ^
In file included from qpOASES.cpp:36:
In file included from ../../include/qpOASES.hpp:53:
../../src/Flipper.cpp:120:13: warning: comparison of unsigned expression
      < 0 is always false [-Wtautological-compare]
        if ( ( _nV < 0 ) || ( _nC < 0 ) )
               ~~~ ^ ~
../../src/Flipper.cpp:120:28: warning: comparison of unsigned expression
      < 0 is always false [-Wtautological-compare]
        if ( ( _nV < 0 ) || ( _nC < 0 ) )
                              ~~~ ^ ~
In file included from qpOASES.cpp:42:
In file included from ./qpOASES_matlab_utils.hpp:49:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/vector:264:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config:226:20: error: 
      typedef redefinition with different types ('char16_t' vs
      'unsigned short')
typedef __char16_t char16_t;
                   ^
<command line>:2:18: note: expanded from here
#define char16_t uint16_T
                 ^
/Applications/MATLAB_R2013a.app/extern/include/tmwtypes.h:257:19: note: 
      previous definition is here
 typedef UINT16_T uint16_T;
                  ^
In file included from qpOASES.cpp:42:
In file included from ./qpOASES_matlab_utils.hpp:49:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/vector:265:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__bit_reference:15:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/algorithm:624:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits:320:29: error: 
      redefinition of 'std::__1::__libcpp_is_integral<uint16_T>'
  ...<>          struct __libcpp_is_integral<unsigned short>     : pub...
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits:316:29: note: 
      previous definition is here
template <>          struct __libcpp_is_integral<char16_t...
                            ^
4 warnings and 2 errors generated.

    mex: compile of ' "qpOASES.cpp"' failed.

Error using mex (line 206)
Unable to complete successfully.

Error in make (line 115)
            eval( cmd );

My Matlab version is R2013a. I am using the following compiler:

Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 6.0 (clang-600.0.54) (based on LLVM 3.5svn)
Target: x86_64-apple-darwin13.4.0
Thread model: posix
svigerske commented 4 years ago

Comment by ferreau created at 2015-02-12 15:02:05

Ticket retargeted after milestone closed

svigerske commented 4 years ago

Comment by ferreau created at 2015-09-01 19:07:33

Ticket retargeted after milestone closed