Filter löschen
Filter löschen

Simulink FMU co-simulation model build error

17 Ansichten (letzte 30 Tage)
Giritharan Vijay Iswaran
Giritharan Vijay Iswaran am 1 Jun. 2023
Kommentiert: Rubiks24 am 8 Jun. 2023
Hey,
I am trying to build FMU co-simulation model in simulink. Following are my errors where I try to perform matrix multiplication (matrices of sizes 4x4 and 4x1). The equation takes a form dx/dt = Cx, where C is parameter matrix and x is 4x1 vector. The build model failed. Appreciated if you could provide me some insignts in rectifying the error.
Error:
Could not find include file <emmintrin.h>
Error curreqn_sphim.c: 20 undeclared identifier '__m128d'
Error curreqn_sphim.c: 20 Syntax error; missing semicolon before `tmp'
Error curreqn_sphim.c: 20 undeclared identifier 'tmp'
Error curreqn_sphim.c: 20 Syntax error; missing semicolon before `tmp_0'
Error curreqn_sphim.c: 20 undeclared identifier 'tmp_0'
5 errors, 1 warning gmake: *** [curreqn_sphim.obj] Error 1
The make command returned an error of 2

Antworten (1)

Anurag Ojha
Anurag Ojha am 5 Jun. 2023
Hello Vijay,
The errors seem to be related to the inclusion of the <emmintrin.h> header file, which is typically used for SSE (Streaming SIMD Extensions) instructions in C/C++ code. This header file may not be available or compatible with the version of Simulink you are using, leading to the error messages.
To rectify the errors, you can try the following steps:
  1. Remove the line #include <emmintrin.h> from your code. This header file is not necessary for performing matrix multiplication in Simulink.
  2. Check if you have any other unnecessary or conflicting header file includes in your code. Removing those can help resolve any further errors related to missing or undeclared identifiers.
  3. Make sure you have defined all the necessary variables, such as __m128d, tmp, and tmp_0, before using them in your code. Check if there are any typos or missing declarations.
  4. Ensure that the dimensions of your matrices (C and x) are correct. The matrix C should be 4x4, and x should be 4x1.
  5. Verify that your code is syntactically correct, including proper semicolon placement and correct variable usage.
  6. Double-check the build settings and compiler options in Simulink to ensure they are configured correctly for your project.
If you continue to encounter errors after following these steps, provide more details about your code, including the relevant sections where the errors occur
  1 Kommentar
Rubiks24
Rubiks24 am 8 Jun. 2023
I don't think this answers the question. I am in the same situation with a model, and don't have any generated code, so I can't follow your steps.
Do you have any advice for trying to generate a Standalone FMU from a Simulink Model, where I get the same error?

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Create Standalone FMU finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by