Open YeZhao opened 7 years ago
Hey. I had recently problems making the matlab interface on Sierra, although I do not recall the exact error. Switching from clang to gcc fixed it for me. Careful though that you actually are indeed using gcc, since on mac, the gcc command is aliased to clang. Hope that helps!
Thanks for the reply, @dkouzoup. I think mex in the Matlab of Mac only uses Clang, though I can switch among different versions of Xcode (e.g., non-default version compiler). I also tried to switch the compiler with mex -setup C++
and the error still pops up. Hmm... I wonder whether it makes sense to ask for a precompiled version of qpDUNES, since I just want to test a few function calls from qpDUNES literally (i guess it highly depends on matlab and Mac OS version). Thanks.
I saw a similar error when running qpOASES. When I removed -D__MATLAB__
in CPPFLAGS
, the bug is fixed! Now the mex file can be generated. So I manipulated with the flag settings in make.m
of qpDUNES in similar ways, and still trying to check whether any flag adjustment could fix the issue above.
Hey. Thanks for looking into this. It is actually possible to change the compiler in matlab. Type in the command window:
edit /Users/YOUR_USER/.matlab/R2015a/mex_C_maci64.xml
and change all instances of clang to gcc, i.e.:
CC="/usr/local/bin/gcc-6"
if you have gcc-6 installed. Same for mex_C++_maci64.xml of course. I could also send you my compiled code if that helps.
Hello, when I build qpDUNES in ./interfaces/matlab by running 'make.m', the following error shows up.
Besides the non-constant-expression error, another error that I am trying to fix is the mex cmd error. My cmd is
mex -v CC="gcc" CXX="gcc" LD="gcc" COPTIMFLAGS="$COPTIMFLAGS -O3" -output qpDUNES -I. -I../../include -I../../externals/qpOASES-3.0beta/include -I../../interfaces/mpc -largeArrayDims -D__cpluplus -D__MATLAB__ -cxx -O -DLINUX CFLAGS='$CFLAGS -fPIC' qpDUNES.cpp ../../src/stage_qp_solver_clipping.c ../../src/stage_qp_solver_qpoases.cpp ../../src/qpdunes_utils.c ../../src/dual_qp.c ../../src/matrix_vector.c ../../src/setup_qp.c ../../interfaces/mpc/setup_mpc.c
Does anyone know the potential reason for this issue? Thank you. Build qpDUNES in its root directory works fine in my case (run
make
in terminal) and I can run the examples. I am using matlab R2015a in MacOS Sierra 10.12.1.