Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows operating system not being detected correctly (crash due to time measurement) #49

Open
pablokrupa opened this issue Feb 19, 2024 · 1 comment
Labels
bug Something isn't working as intended

Comments

@pablokrupa
Copy link
Member

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:

#if WIN32
measure_time_windows_style();
#else
measure_time_linux_style();
#endif 

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.

@pablokrupa pablokrupa added the bug Something isn't working as intended label Feb 19, 2024
@lordmendonca
Copy link

The exact error is attached.
This was reported for MATLAB R2023b on Windows 10 Enterprise version
2024-02-19_13h11_57

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working as intended
Projects
None yet
Development

No branches or pull requests

2 participants