Closed andreadelprete closed 9 years ago
This seems the same problem described here.
But.. reading again the issue, maybe I understood the problem.
We are setting the option for C++, but simulink is trying to compile a .c file.
@andreadelprete can you try to set CFLAGS="$CFLAGS -fexceptions -std=c11"
?
PS: I can't understand why my matlab works PPS: In Matlab2014 the mex configuration is different. Mathwork has been migrating to XML files instead of the old config one. But.. it is still the default one.
I tried to set CFLAGS
as you suggested, but nothing changed!
Hello guys,
Andrea, since I don't have Mac OS X myself I will at least try to explain why Matlab is however doing some sort of compilation (I will however check this on @iron76 's laptop). At the beginning of every simulation it does some compiling, but different from the MEX files compilation. If you check the MEX directory in $CODYCO_SUPERBUILD_DIR/build/install/mex you will notice that the libraries we compile are robotState
(the main one for most of the blocks), minJerkGenerator
, ySynchronizer
, yRead
and yWrite
. There's no WBCLibrary_sfun. The Simulink Engine has a model compiler that converts the Simulink model into an executable besides doing some optimization process before actually running into the simulation cycle. I believe it's there that it's failing. You can find more on this here:
So, in the directory of any of your models after you run the simulation, this initial compilation process generates also a file xxxx_sfun.mexXXX.
I also noticed a backward compatibility problem since I've upgrade to Matlab R2014a and I just realized the library has to be exported for compatibility with earlier versions of Matlab. I'll be back to you guys soon. I'm testing things with @iron76 ... @francesco-romano You might not be experiencing the same issues due to the fact that also you are using my Matlab version.
I am not entirely sure if this can be related to your problem but I have saved the Toolbox compatible with earlier versions of Matlab and it is working for @iron76 . Can you try again please and let me know it it had any influence?
I would also like to throw some hints. @iron76 had a similar issue in the past and he solved it by commenting some stuff in the CMakeLists of the WBIToolbox. It might throw some hints: https://github.com/robotology/codyco/commit/8010141d0869e6c25f6254f63e7b048d1f4b2d98#commitcomment-6566181
I add my R2012b
mexopts.sh
configuration file.
CC='clang'
SDKROOT='/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk'
MACOSX_DEPLOYMENT_TARGET='10.5'
ARCHS='x86_64'
CFLAGS="-fno-common -no-cpp-precomp -arch $ARCHS -isysroot $SDKROOT -mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET -Dchar16_t=UINT16_T"
CFLAGS="$CFLAGS -fexceptions"
CLIBS="$MLIBS"
COPTIMFLAGS='-O2 -DNDEBUG'
CDEBUGFLAGS='-g'
#
CLIBS="$CLIBS -lc++" #CLIBS="$CLIBS -lstdc++"
# C++keyName: GNU C++
# C++keyManufacturer: GNU
# C++keyLanguage: C++
# C++keyVersion:
# C++keyLinkerName:
# C++keyLinkerVersion:
CXX='clang++'
CXXFLAGS="-fno-common -no-cpp-precomp -fexceptions -arch $ARCHS -isysroot $SDKROOT -mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET"
CXXLIBS="$MLIBS -lc++" #CXXLIBS="$MLIBS -lstdc++"
CXXOPTIMFLAGS='-O2 -DNDEBUG'
CXXDEBUGFLAGS='-g'
#
# FortrankeyName: GNU Fortran
# FortrankeyManufacturer: GNU
# FortrankeyLanguage: Fortran
# FortrankeyVersion:
# FortrankeyLinkerName:
# FortrankeyLinkerVersion:
FC='gfortran'
FFLAGS='-fexceptions -m64 -fbackslash'
FC_LIBDIR=`$FC -print-file-name=libgfortran.dylib 2>&1 | sed -n '1s/\/*libgfortran\.dylib//p'`
FC_LIBDIR2=`$FC -print-file-name=libgfortranbegin.a 2>&1 | sed -n '1s/\/*libgfortranbegin\.a//p'`
FLIBS="$MLIBS -L$FC_LIBDIR -lgfortran -L$FC_LIBDIR2 -lgfortranbegin"
FOPTIMFLAGS='-O'
FDEBUGFLAGS='-g'
#
LD="$CC"
LDEXTENSION='.mexmaci64'
LDFLAGS="-Wl,-twolevel_namespace -undefined error -arch $ARCHS -Wl,-syslibroot,$SDKROOT -mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET"
LDFLAGS="$LDFLAGS -bundle -Wl,-exported_symbols_list,$TMW_ROOT/extern/lib/$Arch/$MAPFILE"
LDOPTIMFLAGS='-O'
LDDEBUGFLAGS='-g'
#
POSTLINK_CMDS=':'
Hi @jeljaik , sorry I'm late but I couldn't test your solution until today. I updated the codyco superbuild using make update-all
but that didn't solve the problem.
However, with @francesco-romano we found a VERY DIRTY fix, that is to add the following line in the mexopts.sh
:
CFLAGS="$CFLAGS -Dchar16_t=uint16_T"
Of course, this is not a solution, but only a workaround. Moreover, now when I open the simulink model I get a bunch of warnings (I report here only the firsts, since they're all of the same kind):
Warning: Loading model 'WBCLibrary' generated with a newer version (8.3) of Simulink
In general/private/openmdl at 13
In general/private/openslx at 9
In open at 159
In uiopen at 196
Warning: WBCLibrary.mdl, line 105: block_diagram does not have a parameter named
'CovEnableCumulative'
In general/private/openmdl at 13
In general/private/openslx at 9
In open at 159
In uiopen at 196
Warning: WBCLibrary.mdl, line 112: block_diagram does not have a parameter named
'CovSFcnEnable'
In general/private/openmdl at 13
In general/private/openslx at 9
In open at 159
In uiopen at 196
...
I had a similar issue and I solved it by specifying a proper SDKROOT and a proper MACOSX_DEPLOYMENT_TARGET. In my case:
SDKROOT='/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk' MACOSX_DEPLOYMENT_TARGET='10.7'
However, these variables should be configured according to your system configuration. Francesco
Francesco Nori Robotics Brain Cognitive Science Department Cognitive Humanoids Lab Istituto Italiano di Tecnologia Via Morego, 30 16163 Genova, Italy http://people.liralab.it/iron/ francesco.nori@iit.itmailto:francesco.nori@iit.it
On Jun 23, 2014, at 11:49 AM, Andrea Del Prete wrote:
Hi @jeljaikhttps://github.com/jeljaik , sorry I'm late but I couldn't test your solution until today. I updated the codyco superbuild using make update-all but that didn't solve the problem. However, with @francesco-romanohttps://github.com/francesco-romano we found a VERY DIRTY fix, that is to add the following line in the mexopts.sh: CFLAGS="$CFLAGS -Dchar16_t=uint16_T" Of course, this is not a solution, but only a workaround. Moreover, now when I open the simulink model I get a bunch of warnings (I report here only the firsts, since they're all of the same kind):
Warning: Loading model 'WBCLibrary' generated with a newer version (8.3) of Simulink In general/private/openmdl at 13 In general/private/openslx at 9 In open at 159 In uiopen at 196 Warning: WBCLibrary.mdl, line 105: block_diagram does not have a parameter named 'CovEnableCumulative' In general/private/openmdl at 13 In general/private/openslx at 9 In open at 159 In uiopen at 196 Warning: WBCLibrary.mdl, line 112: block_diagram does not have a parameter named 'CovSFcnEnable' In general/private/openmdl at 13 In general/private/openslx at 9 In open at 159 In uiopen at 196 ...
— Reply to this email directly or view it on GitHubhttps://github.com/robotology-playground/WBI-Toolbox/issues/2#issuecomment-46824801.
Closing as solution has been described above and no feedback was ever given.
I'm experiencing a problem when trying to run any simulink controller using the WBI-Toolbox. I installed CoDyCo-superbuild on Mac OS X 10.9 and I'm using Matlab 2013a. When I try to run (e.g.)
controllerWithHandControl.slx
(located in the foldertorqueBalancing
) I get the following error:With the help of @francesco-romano I tried to solve it by modifying the Matlab's configuration file
mexopts.sh
so as to force the use of the c++11 standard library (because char16t has been introduced in c++11):Unfortunately, this had no effect on the error. To try and solve this problem @francesco-romano and I would like to gain an insight into the steps taken by simulink when one runs the model. In particular, why is simulink trying to compile
WBCLibrary_sfun.c
to generate a mex file? I thought all mex files were generated when compiling the WBI toolbox. Maybe @jeljaik can help us on this?