-
Notifications
You must be signed in to change notification settings - Fork 56
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
Problem with rtwsfcnfmi.tlc target #371
Comments
I have the same problem, and I also tried to trace the problem in the source code. This is my error log after trying to build with rtwsfcnfmi.tlc target: `### Generating code and artifacts to 'Model specific' folder structure Generating code into build folder: F:\GitHubRepos\FMI_test_3\test_circuit_FMI_sfcn_rtw_fmiWarning: File 'codedescriptor.dmr' not found. Invoking Target Language Compiler on test_circuit_FMI.rtwUsing System Target File: D:\Program Files\Matlab\rtw\c\FMIKit-Simulink-3.0\rtwsfcnfmi\rtwsfcnfmi.tlc
Initial pass through model to cache user defined code. Generating code for S Function : /State-SpaceCaching model source codeWriting header file test_circuit_FMI_sf_types.hWriting header file test_circuit_FMI_sf.h. Writing header file rtwtypes.hWriting header file multiword_types.hWriting source file test_circuit_FMI_sf.cWriting header file test_circuit_FMI_sf_private.hWriting header file test_circuit_FMI_sid.hWriting header file test_circuit_FMI_mid.h. Writing source file test_circuit_FMI_sf_data.cWriting header file rtGetNaN.hWriting source file rtGetNaN.cWriting header file rt_nonfinite.hWriting source file rt_nonfinite.c. Writing header file rt_defines.hWriting header file rtGetInf.hWriting source file rtGetInf.cTLC code generation complete.Writing modelDescription.xml. Creating HTML report file index.htmlSaving binary information cache.Generating project-- Selecting Windows SDK version 10.0.19041.0 to target Windows 10.0.18362. Building FMUMSBuild version 17.3.0+f67e3d35e for .NET Framework Model Action Rebuild Reasontest_circuit_FMI Failed Code generation information file does not exist. 0 of 1 models built (0 models already up to date) The build process will terminate as a result. Caused by: I tried with Stateflow, Simulink blocks and Simulink PowerGUI elements to test out rtwsfcnfmi.tlc, and I got the same error. There is some problem with use ODE solvers, and the discrete solvers as well. Please provide some fixes for this. Thanks |
I now have the following errors when I try to use rtwsfcnfmi.tlc: "sfunction.obj : error LNK2019: unresolved external symbol ssSetRegInputPortDimensionInfoFcn referenced in function CreateSimStructForFMI [C:\Users\lordx\Desktop\TestFMI_4\test_fmi_sfcn_rtw_fmi\test_fmi.vcxproj] I am using Matlab R2022b and the system is a simple subsystem with one input port and one output port. Thanks |
Can you share the model to reproduce the problem? |
For what it’s worth, my original simulink model is in the zip file attached in the first post. |
When I tried to test out rtwsfcnfsmi.tlc with a simple In1 and Out1 Simulink model, I keep getting errors regarding multiplication or the math settings. I have attached all of the models in the following repo: https://github.com/hadrianhu888/FMI_test_4 The grtfmi worked. I think a guide of some kind to guide users on which kind of simulation should use which settings for which types of FMU generation would be helpful. Right now, there is a lot of trial and error to get the FMU to work. I am certain I messed up a setting somewhere, or the Simulink model itself is incorrect as noted in the error message when I ran regarding "Invalid expression. Check for missing multiplication operator, missing or unbalanced delimiters, or other syntax error. To construct matrices, use brackets instead of parentheses." |
to fix compilation on R2022a fixes #371
Can you give 7cf44c3 a try? |
Hi,
This fix did not work either
Thanks
On Tue, Sep 27, 2022 at 08:23 Torsten Sommer ***@***.***> wrote:
Can you give 7cf44c3
<7cf44c3>
a try?
—
Reply to this email directly, view it on GitHub
<#371 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFQE42ZZ77BZSS55JUJYEWDWALRLRANCNFSM53Q6X35Q>
.
You are receiving this because you commented.Message ID:
***@***.***>
--
Hadrian
|
From what I can say, applying @t-sommer 's correction made it work for me in R2022a (just tested on a simple model, but still, that's encouraging !). Build output
|
I got the same error messages about input port and output port errors. I
tried the fix in my work computer and I got the math error message.
I will try again later on my personal computer.
Thanks
On Tue, Sep 27, 2022 at 22:15 Guillaume VIRY ***@***.***> wrote:
From what I can say, applying @t-sommer <https://github.com/t-sommer> 's
correction made it work for me in R2022a (just tested on a simple model,
but still, that's encouraging !).
However, things break again when trying on the newer R2022b release. So
@hadrianhu888 <https://github.com/hadrianhu888> 's issue seems to be
support for R2022b.
On my side, here is the log I get
Build output
``` === Model Load (Elapsed: 0.87 sec) === Warning:model (configSet0.xml,
line 418): System target file 'rtwsfcnfmi.tlc' cannot be found. === Build
(Elapsed: 55 sec) === Target definition is different from that in the
model. Updating target according to the new definition. The following
parameters were updated: Type definition ### Generating code and artifacts
to 'Model specific' folder structure ### Generating code into build folder:
D:\ToBeSaved\Documents\MATLAB\model_sfcn_rtw_fmi ### Invoking Target
Language Compiler on model.rtw ### Using System Target File:
D:\FMIKit-Simulink-3.0\rtwsfcnfmi\rtwsfcnfmi.tlc ### Loading TLC function
libraries ### Initial pass through model to cache user defined code ###
Caching model source code Warning:Simulink Coder -- In block "model/Scope",
block type "Scope": Scope blocks not currently supported for S-Function
code format. Block disabled. ### Writing header file model_sf_types.h ###
Writing header file model_sf.h ### Writing source file model_sf.c ###
Writing header file rtwtypes.h ### Writing header file multiword_types.h .
### Writing header file rt_nonfinite.h ### Writing source file
rt_nonfinite.c ### Writing header file rtGetInf.h ### Writing source file
rtGetInf.c ### Writing header file rtGetNaN.h . ### Writing source file
rtGetNaN.c ### Writing header file model_sf_private.h ### Writing header
file model_sid.h ### Writing header file model_mid.h ### Writing source
file model_sf_data.c ### Writing header file rt_defines.h . ### TLC code
generation complete (took 4.396s). ### Writing modelDescription.xml . ###
Saving binary information cache. ### Generating project -- Selecting
Windows SDK version 10.0.22621.0 to target Windows 10.0.19044. -- The C
compiler identification is MSVC 19.33.31630.0 -- The CXX compiler
identification is MSVC 19.33.31630.0 -- Detecting C compiler ABI info --
Detecting C compiler ABI info - done -- Check for working C compiler:
C:/Program Files/Microsoft Visual
Studio/2022/Professional/VC/Tools/MSVC/14.33.31629/bin/Hostx64/x64/cl.exe -
skipped -- Detecting C compile features -- Detecting C compile features -
done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info
- done -- Check for working CXX compiler: C:/Program Files/Microsoft Visual
Studio/2022/Professional/VC/Tools/MSVC/14.33.31629/bin/Hostx64/x64/cl.exe -
skipped -- Detecting CXX compile features -- Detecting CXX compile features
- done FIPXT_SHARED_MODULE -- Configuring done -- Generating done -- Build
files have been written to:
D:/ToBeSaved/Documents/MATLAB/model_sfcn_rtw_fmi ### Building FMU MSBuild
version 17.3.1+2badb37d1 for .NET Framework ode1.c ode1.vcxproj ->
D:\ToBeSaved\Documents\MATLAB\model_sfcn_rtw_fmi\Release\ode1.lib
fmi2Functions.c D:\FMIKit-Simulink-3.0\rtwsfcnfmi\fmi2Functions.c(130,58):
warning C4113: 'void (__cdecl *)(Model *,int,const char *,...)' differs in
parameter lists from 'logMessageCallback'
[D:\ToBeSaved\Documents\MATLAB\model_sfcn_rtw_fmi\model.vcxproj]
D:\FMIKit-Simulink-3.0\rtwsfcnfmi\fmi2Functions.c(273,69): warning C4113:
'void (__cdecl *)(Model *,int,const char *,...)' differs in parameter lists
from 'logMessageCallback'
[D:\ToBeSaved\Documents\MATLAB\model_sfcn_rtw_fmi\model.vcxproj]
sfunction.c model_interface.c model_sf_data.c rtGetInf.c rtGetNaN.c
sfcn_fmi.c Generating Code... Creating library
D:/ToBeSaved/Documents/MATLAB/model_sfcn_rtw_fmi/Release/model.lib and
object D:/ToBeSaved/Documents/MATLAB/model_sfcn_rtw_fmi/Release/model.exp
sfunction.obj : error LNK2019: unresolved external symbol
ssSetRegInputPortDimensionInfoFcn referenced in function
CreateSimStructForFMI
[D:\ToBeSaved\Documents\MATLAB\model_sfcn_rtw_fmi\model.vcxproj]
sfunction.obj : error LNK2019: unresolved external symbol
ssSetRegOutputPortDimensionInfoFcn referenced in function
CreateSimStructForFMI
[D:\ToBeSaved\Documents\MATLAB\model_sfcn_rtw_fmi\model.vcxproj]
D:\ToBeSaved\Documents\MATLAB\model_sfcn_rtw_fmi\Release\model.dll : fatal
error LNK1120: 2 unresolved externals
[D:\ToBeSaved\Documents\MATLAB\model_sfcn_rtw_fmi\model.vcxproj] Top model
targets built:
Model Action Rebuild Reason
=================================================================
model Failed Code generation information file does not exist.
0 of 1 models built (0 models already up to date)
Build duration: 0h 0m 52.682s
Error:The call to rtwsfcnfmi_make_rtw_hook, during the after_make hook generated the following error:
Failed to build FMU
The build process will terminate as a result.
Caused by:
Failed to build FMU
</p>
</details>
—
Reply to this email directly, view it on GitHub
<#371 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFQE423Q3NUGUOC4NAJPXZLWAOS4ZANCNFSM53Q6X35Q>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
--
Hadrian
|
@t-sommer and @AlphaScorpii-dev With a simple In1 and Out1 in 2022b, I get this error when using ModelExchange with rtwsfncfmi.tlc:
My settings are: My Solver is Fixed Step with Auto Solver. The setting to denomial number is Gradual Underflow. I hope the input configuration settings data along with my matlab settings and output logs can help solve this weird Build issue. Thanks |
Note that the above reply refers to the Github repo at: (https://github.com/hadrianhu888/FMI_test_4 Where the results are kept. |
Can you give 4f10c23 at try with R2022b? |
Hi,
I can try it after 12 pm today.
On Mon, Oct 10, 2022 at 09:45 Torsten Sommer ***@***.***> wrote:
Can you give 4f10c23
<4f10c23>
at try with R2022b?
—
Reply to this email directly, view it on GitHub
<#371 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFQE426EKIWGNSP2YNH2SV3WCQMW5ANCNFSM53Q6X35Q>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
--
Hadrian
|
Hi,
The change did not seem to work.
This is the error message:
Top Model Build
### Generating code and artifacts to 'Model specific' folder structure ###
Generating code into build folder:
F:\GitHubRepos\FMI_test_4\test_fmi_rtwsfncfmi_mdlxchnge_sfcn_rtw_fmi
Build Summary
Top model targets built: Model Action Rebuild Reason
=========================================================================================
test_fmi_rtwsfncfmi_mdlxchnge Failed Code generation information file does
not exist. 0 of 1 models built (0 models already up to date) Build
duration: 0h 0m 3.2578s
Invalid expression. Check for missing multiplication operator, missing or
unbalanced delimiters, or other syntax error. To construct matrices, use
brackets instead of parentheses.
Component:Simulink | Category:Block diagram error
See the repository at: https://github.com/hadrianhu888/FMI_test_4.
…On Mon, 10 Oct 2022 at 09:46, Hadrian H ***@***.***> wrote:
Hi,
I can try it after 12 pm today.
On Mon, Oct 10, 2022 at 09:45 Torsten Sommer ***@***.***>
wrote:
> Can you give 4f10c23
> <4f10c23>
> at try with R2022b?
>
> —
> Reply to this email directly, view it on GitHub
> <#371 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AFQE426EKIWGNSP2YNH2SV3WCQMW5ANCNFSM53Q6X35Q>
> .
> You are receiving this because you were mentioned.Message ID:
> ***@***.***>
>
--
Hadrian
--
Hadrian
B. Eng.
|
On my side, the FMU build goes on without mistake. |
2ee227f should work for Co-Simulation now. |
Hi,
In the same repo I shared, I tried with both CS and ME with Matlab r2022b,
and the changes did not help with the FMU generation.
I got the same error as I shared yesterday night.
Thanks,
Top Model Build
### Generating code and artifacts to 'Model specific' folder structure ###
Generating code into build folder:
F:\GitHubRepos\FMI_test_4\test_fmi_rtwsfncfmi_mdlxchnge_sfcn_rtw_fmi
Build Summary
Top model targets built: Model Action Rebuild Reason
=========================================================================================
test_fmi_rtwsfncfmi_mdlxchnge Failed Code generation information file does
not exist. 0 of 1 models built (0 models already up to date) Build
duration: 0h 0m 3.2578s
Invalid expression. Check for missing multiplication operator, missing or
unbalanced delimiters, or other syntax error. To construct matrices, use
brackets instead of parentheses.
Component:Simulink | Category:Block diagram error
See the repository at: https://github.com/hadrianhu888/FMI_test_4.
I made sure to pull in the changes each time.
Thanks,
…On Tue, 11 Oct 2022 at 07:51, Torsten Sommer ***@***.***> wrote:
2ee227f
<2ee227f>
should work for Co-Simulation now.
—
Reply to this email directly, view it on GitHub
<#371 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFQE42ZIPEYGL7V34CIOG6TWCVIE7ANCNFSM53Q6X35Q>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
--
Hadrian
B. Eng.
|
I cannot reproduce the problem with R2022b. |
to fix compilation on R2022a see #371
and use integer MATLAB_VERSION fixes #371
to fix compilation on R2022a see #371
If the problem persists, please open a new issue and provide steps to reproduce the problem. |
I tested the issue with r2022b tonight, and the build went successfully. I also updated my Cmake to 3.25.0-rc1, and both CS and ME work. See the repository at: https://github.com/hadrianhu888/FMI_test_4. Is there some way to do a pull request to incorporate the changes I made on my local machine into the repo? I would love to more directly contribute to this repo and learn what to update in the source code for rtwsfcnfmi and grtfmi as Matlab moves to matlab r2023a and matlab r2023b versions. Thanks. |
I am having issues with the latest version of FMIKit 3.0, when trying to create a ME FMU with the rtwsfcnfmi.tlc target.
The original model, in Simulink R2022a, is just a source plugged to an output, so nothing stellar.
Diagnostic viewer
=== Build (Elapsed: 2 sec) === Top model targets built:=== Build (Elapsed: 19 sec) ===
### Generating code and artifacts to 'Model specific' folder structure
### Generating code into build folder: D:\ToBeSaved\Documents\MATLAB\model_grt_fmi_rtw
### Invoking Target Language Compiler on model.rtw
### Using System Target File: D:\FMIKit-Simulink-3.0\grtfmi\grtfmi.tlc
### Loading TLC function libraries
### Initial pass through model to cache user defined code
.
### Caching model source code
### Writing header file model_types.h
.
### Writing header file model.h
### Writing header file model_private.h
### Writing header file rtwtypes.h
### Writing header file multiword_types.h
### Writing header file rt_nonfinite.h
### Writing source file rt_nonfinite.c
.
### Writing header file rtGetInf.h
### Writing source file rtGetInf.c
### Writing header file rtGetNaN.h
### Writing source file rtGetNaN.c
### Writing source file model.c
### Writing header file rtmodel.h
.
### Writing source file model_data.c
### TLC code generation complete.
### Writing modelDescription.xml
### Saving binary information cache.
### Running CMake generator
### Generating project
-- Selecting Windows SDK version 10.0.19041.0 to target Windows 10.0.19044.
-- The C compiler identification is MSVC 19.32.31332.0
-- The CXX compiler identification is MSVC 19.32.31332.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Professional/VC/Tools/MSVC/14.32.31326/bin/Hostx64/x64/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2022/Professional/VC/Tools/MSVC/14.32.31326/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMAKE_C_FLAGS_RELEASE /O2 /Ob2 /DNDEBUG
CMAKE_C_FLAGS_RELEASE /Od /Ob2 /DNDEBUG
-- Configuring done
-- Generating done
-- Build files have been written to: D:/ToBeSaved/Documents/MATLAB/model_grt_fmi_rtw
### Building FMU
Microsoft (R) Build Engine version 17.2.1+52cd2da31 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.
Checking Build System
Building Custom Rule D:/FMIKit-Simulink-3.0/grtfmi/CMakeLists.txt
rt_matrx.c
model.c
model_data.c
rtGetInf.c
rtGetNaN.c
rt_nonfinite.c
fmi2Functions.c
Generating Code...
Creating library D:/ToBeSaved/Documents/MATLAB/model_grt_fmi_rtw/Release/model.lib and object D:/ToBeSaved/Documents/MATLAB/model_grt_fmi_rtw/Release/model.exp
model.vcxproj -> D:\ToBeSaved\Documents\MATLAB\model_grt_fmi_rtw\Release\model.dll
modelDescription.xml
binaries
binaries/win64
binaries/win64/model.dll
model.png
Building Custom Rule D:/FMIKit-Simulink-3.0/grtfmi/CMakeLists.txt
### Simulink cache artifacts for 'model' were created in 'D:\ToBeSaved\Documents\MATLAB\model.slxc'.
Build process completed successfully
Top model targets built:
=== Build (Elapsed: 17 sec) ===
### Generating code and artifacts to 'Model specific' folder structure
### Generating code into build folder: D:\ToBeSaved\Documents\MATLAB\model_sfcn_rtw_fmi
### Invoking Target Language Compiler on model.rtw
### Using System Target File: D:\FMIKit-Simulink-3.0\rtwsfcnfmi\rtwsfcnfmi.tlc
### Loading TLC function libraries
### Initial pass through model to cache user defined code
.
### Caching model source code
Warning:Simulink Coder -- In block "model/Scope", block type "Scope": Scope blocks not currently supported for S-Function code format. Block disabled.
### Writing header file model_sf_types.h
.
### Writing header file model_sf.h
### Writing source file model_sf.c
### Writing header file rtwtypes.h
### Writing header file multiword_types.h
### Writing header file rt_nonfinite.h
### Writing source file rt_nonfinite.c
.
### Writing header file rtGetInf.h
### Writing source file rtGetInf.c
### Writing header file rtGetNaN.h
### Writing source file rtGetNaN.c
### Writing header file model_sf_private.h
### Writing header file model_sid.h
.
### Writing header file model_mid.h
### Writing source file model_sf_data.c
### Writing header file rt_defines.h
### TLC code generation complete.
### Writing modelDescription.xml
.
### Saving binary information cache.
### Generating project
-- Selecting Windows SDK version 10.0.19041.0 to target Windows 10.0.19044.
-- The C compiler identification is MSVC 19.32.31332.0
-- The CXX compiler identification is MSVC 19.32.31332.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Professional/VC/Tools/MSVC/14.32.31326/bin/Hostx64/x64/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2022/Professional/VC/Tools/MSVC/14.32.31326/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
FIPXT_SHARED_MODULE
-- Configuring done
-- Generating done
-- Build files have been written to: D:/ToBeSaved/Documents/MATLAB/model_sfcn_rtw_fmi
### Building FMU
Microsoft (R) Build Engine version 17.2.1+52cd2da31 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.
ode1.c
D:\MATLAB\R2022a\rtw\c\src\odesup.h(160,5): warning C4047: '=': 'int_T *' differs in levels of indirection from 'int' [D:\ToBeSaved\Documents\MATLAB\model_sfcn_rtw_fmi\ode1.vcxproj]
ode1.vcxproj -> D:\ToBeSaved\Documents\MATLAB\model_sfcn_rtw_fmi\Release\ode1.lib
fmi2Functions.c
D:\FMIKit-Simulink-3.0\rtwsfcnfmi\fmi2Functions.c(130,58): warning C4113: 'void (__cdecl *)(Model *,int,const char *,...)' differs in parameter lists from 'logMessageCallback' [D:\ToBeSaved\Documents\MATLAB\model_sfcn_rtw_fmi\model.vcxproj]
D:\FMIKit-Simulink-3.0\rtwsfcnfmi\fmi2Functions.c(273,69): warning C4113: 'void (__cdecl *)(Model *,int,const char *,...)' differs in parameter lists from 'logMessageCallback' [D:\ToBeSaved\Documents\MATLAB\model_sfcn_rtw_fmi\model.vcxproj]
sfunction.c
rt_matrx.c
model_interface.c
model_sf_data.c
rtGetInf.c
rtGetNaN.c
sfcn_fmi.c
Generating Code...
Creating library D:/ToBeSaved/Documents/MATLAB/model_sfcn_rtw_fmi/Release/model.lib and object D:/ToBeSaved/Documents/MATLAB/model_sfcn_rtw_fmi/Release/model.exp
ode1.lib(ode1.obj) : error LNK2019: unresolved external symbol ssGetNumContStatesPtr referenced in function rt_CreateIntegrationData [D:\ToBeSaved\Documents\MATLAB\model_sfcn_rtw_fmi\model.vcxproj]
D:\ToBeSaved\Documents\MATLAB\model_sfcn_rtw_fmi\Release\model.dll : fatal error LNK1120: 1 unresolved externals [D:\ToBeSaved\Documents\MATLAB\model_sfcn_rtw_fmi\model.vcxproj]
Top model targets built:
=== Build (Elapsed: 21 sec) ===
### Generating code and artifacts to 'Model specific' folder structure
### Generating code into build folder: D:\ToBeSaved\Documents\MATLAB\model_sfcn_rtw_fmi
### Invoking Target Language Compiler on model.rtw
### Using System Target File: D:\FMIKit-Simulink-3.0\rtwsfcnfmi\rtwsfcnfmi.tlc
### Loading TLC function libraries
### Initial pass through model to cache user defined code
.
### Caching model source code
Warning:Simulink Coder -- In block "model/Scope", block type "Scope": Scope blocks not currently supported for S-Function code format. Block disabled.
### Writing header file model_sf_types.h
.
### Writing header file model_sf.h
### Writing source file model_sf.c
### Writing header file rtwtypes.h
### Writing header file multiword_types.h
### Writing header file rt_nonfinite.h
### Writing source file rt_nonfinite.c
.
### Writing header file rtGetInf.h
### Writing source file rtGetInf.c
### Writing header file rtGetNaN.h
### Writing source file rtGetNaN.c
### Writing header file model_sf_private.h
### Writing header file model_sid.h
.
### Writing header file model_mid.h
### Writing source file model_sf_data.c
### Writing header file rt_defines.h
### TLC code generation complete.
### Writing modelDescription.xml
.
### Saving binary information cache.
### Generating project
-- Selecting Windows SDK version 10.0.19041.0 to target Windows 10.0.19044.
-- The C compiler identification is MSVC 19.32.31332.0
-- The CXX compiler identification is MSVC 19.32.31332.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Professional/VC/Tools/MSVC/14.32.31326/bin/Hostx64/x64/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2022/Professional/VC/Tools/MSVC/14.32.31326/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
FIPXT_SHARED_MODULE
-- Configuring done
-- Generating done
-- Build files have been written to: D:/ToBeSaved/Documents/MATLAB/model_sfcn_rtw_fmi
### Building FMU
Microsoft (R) Build Engine version 17.2.1+52cd2da31 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.
ode1.c
D:\MATLAB\R2022a\rtw\c\src\odesup.h(160,5): warning C4047: '=': 'int_T *' differs in levels of indirection from 'int' [D:\ToBeSaved\Documents\MATLAB\model_sfcn_rtw_fmi\ode1.vcxproj]
ode1.vcxproj -> D:\ToBeSaved\Documents\MATLAB\model_sfcn_rtw_fmi\Release\ode1.lib
fmi2Functions.c
D:\FMIKit-Simulink-3.0\rtwsfcnfmi\fmi2Functions.c(130,58): warning C4113: 'void (__cdecl *)(Model *,int,const char *,...)' differs in parameter lists from 'logMessageCallback' [D:\ToBeSaved\Documents\MATLAB\model_sfcn_rtw_fmi\model.vcxproj]
D:\FMIKit-Simulink-3.0\rtwsfcnfmi\fmi2Functions.c(273,69): warning C4113: 'void (__cdecl *)(Model *,int,const char *,...)' differs in parameter lists from 'logMessageCallback' [D:\ToBeSaved\Documents\MATLAB\model_sfcn_rtw_fmi\model.vcxproj]
sfunction.c
rt_matrx.c
model_interface.c
model_sf_data.c
rtGetInf.c
rtGetNaN.c
sfcn_fmi.c
Generating Code...
Creating library D:/ToBeSaved/Documents/MATLAB/model_sfcn_rtw_fmi/Release/model.lib and object D:/ToBeSaved/Documents/MATLAB/model_sfcn_rtw_fmi/Release/model.exp
ode1.lib(ode1.obj) : error LNK2019: unresolved external symbol ssGetNumContStatesPtr referenced in function rt_CreateIntegrationData [D:\ToBeSaved\Documents\MATLAB\model_sfcn_rtw_fmi\model.vcxproj]
D:\ToBeSaved\Documents\MATLAB\model_sfcn_rtw_fmi\Release\model.dll : fatal error LNK1120: 1 unresolved externals [D:\ToBeSaved\Documents\MATLAB\model_sfcn_rtw_fmi\model.vcxproj]
Top model targets built:
=== Build (Elapsed: 18 sec) ===
### Generating code and artifacts to 'Model specific' folder structure
### Generating code into build folder: D:\ToBeSaved\Documents\MATLAB\model_sfcn_rtw_fmi
### Invoking Target Language Compiler on model.rtw
### Using System Target File: D:\FMIKit-Simulink-3.0\rtwsfcnfmi\rtwsfcnfmi.tlc
### Loading TLC function libraries
### Initial pass through model to cache user defined code
.
### Caching model source code
Warning:Simulink Coder -- In block "model/Scope", block type "Scope": Scope blocks not currently supported for S-Function code format. Block disabled.
### Writing header file model_sf_types.h
.
### Writing header file model_sf.h
### Writing source file model_sf.c
### Writing header file rtwtypes.h
### Writing header file multiword_types.h
### Writing header file rt_nonfinite.h
### Writing source file rt_nonfinite.c
.
### Writing header file rtGetInf.h
### Writing source file rtGetInf.c
### Writing header file rtGetNaN.h
### Writing source file rtGetNaN.c
### Writing header file model_sf_private.h
### Writing header file model_sid.h
.
### Writing header file model_mid.h
### Writing source file model_sf_data.c
### Writing header file rt_defines.h
### TLC code generation complete.
### Writing modelDescription.xml
.
### Saving binary information cache.
### Generating project
-- Selecting Windows SDK version 10.0.19041.0 to target Windows 10.0.19044.
-- The C compiler identification is MSVC 19.32.31332.0
-- The CXX compiler identification is MSVC 19.32.31332.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Professional/VC/Tools/MSVC/14.32.31326/bin/Hostx64/x64/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2022/Professional/VC/Tools/MSVC/14.32.31326/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
FIPXT_SHARED_MODULE
-- Configuring done
-- Generating done
-- Build files have been written to: D:/ToBeSaved/Documents/MATLAB/model_sfcn_rtw_fmi
### Building FMU
Microsoft (R) Build Engine version 17.2.1+52cd2da31 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.
Checking Build System
Building Custom Rule D:/FMIKit-Simulink-3.0/rtwsfcnfmi/CMakeLists.txt
ode1.c
D:\MATLAB\R2022a\rtw\c\src\odesup.h(160,5): warning C4047: '=': 'int_T *' differs in levels of indirection from 'int' [D:\ToBeSaved\Documents\MATLAB\model_sfcn_rtw_fmi\ode1.vcxproj]
ode1.vcxproj -> D:\ToBeSaved\Documents\MATLAB\model_sfcn_rtw_fmi\Release\ode1.lib
Building Custom Rule D:/FMIKit-Simulink-3.0/rtwsfcnfmi/CMakeLists.txt
fmi2Functions.c
D:\FMIKit-Simulink-3.0\rtwsfcnfmi\fmi2Functions.c(130,58): warning C4113: 'void (__cdecl *)(Model *,int,const char *,...)' differs in parameter lists from 'logMessageCallback' [D:\ToBeSaved\Documents\MATLAB\model_sfcn_rtw_fmi\model.vcxproj]
D:\FMIKit-Simulink-3.0\rtwsfcnfmi\fmi2Functions.c(273,69): warning C4113: 'void (__cdecl *)(Model *,int,const char *,...)' differs in parameter lists from 'logMessageCallback' [D:\ToBeSaved\Documents\MATLAB\model_sfcn_rtw_fmi\model.vcxproj]
sfunction.c
rt_matrx.c
model_interface.c
model_sf_data.c
rtGetInf.c
rtGetNaN.c
sfcn_fmi.c
Generating Code...
Creating library D:/ToBeSaved/Documents/MATLAB/model_sfcn_rtw_fmi/Release/model.lib and object D:/ToBeSaved/Documents/MATLAB/model_sfcn_rtw_fmi/Release/model.exp
ode1.lib(ode1.obj) : error LNK2019: unresolved external symbol ssGetNumContStatesPtr referenced in function rt_CreateIntegrationData [D:\ToBeSaved\Documents\MATLAB\model_sfcn_rtw_fmi\model.vcxproj]
D:\ToBeSaved\Documents\MATLAB\model_sfcn_rtw_fmi\Release\model.dll : fatal error LNK1120: 1 unresolved externals [D:\ToBeSaved\Documents\MATLAB\model_sfcn_rtw_fmi\model.vcxproj]
Top model targets built:
When looking at the C code, I find a ssGetNumContStatesPtr definition in simstruc_internal.h, but conditioned by a flag
This flag is itself set in another header
Building directly from Visual Studio fails as well.
Here is the project generated : model_sfcn_rtw_fmi.zip
The text was updated successfully, but these errors were encountered: