I've just received information about a problem with Windows not being correctly identified when compiling the MEX function. We currently use the WIN23 flag to detect the Windows operating system, but this seems to not always work. This leads to a compilation error of the MEX function due to the Linux time measurement routing being called, which obviously fails in Windows. This is because our code does the following:
We need to change this. To avoid issues, I think the best is to define our own flags and detect the operating system using Matlab's built-in functions for OS identification (isunix, ispc and ismac). We can then define flags SP_IS_WIN, SP_IS_UNIX and SP_IS_MAC and use these in place of the WIN32.
Additionally, we need to make sure that "time measurement" is disabled if 'platform' == 'C', since these time-measurement routines only make sense for prototyping as MEX functions. They wont exists in a generic C-based embedded system.
I've just received information about a problem with Windows not being correctly identified when compiling the MEX function. We currently use the
WIN23
flag to detect the Windows operating system, but this seems to not always work. This leads to a compilation error of the MEX function due to the Linux time measurement routing being called, which obviously fails in Windows. This is because our code does the following:We need to change this. To avoid issues, I think the best is to define our own flags and detect the operating system using Matlab's built-in functions for OS identification (
isunix
,ispc
andismac
). We can then define flagsSP_IS_WIN
,SP_IS_UNIX
andSP_IS_MAC
and use these in place of theWIN32
.Additionally, we need to make sure that "time measurement" is disabled if
'platform' == 'C'
, since these time-measurement routines only make sense for prototyping as MEX functions. They wont exists in a generic C-based embedded system.