CATIA-Systems / FMIKit-Simulink

Import and export Functional Mock-up Units with Simulink
Other
157 stars 51 forks source link

Error in FMU Export using Simscape library #386

Closed kananisagar04 closed 1 year ago

kananisagar04 commented 1 year ago

I am trying to build a 2-Axis robot using the Simscape library. For FMU export I used FMI Kit 3.0 and the system target file is grtfmi.tlc chosen.

Matlab_Simulink.zip

Errors are:

hadrianhu888 commented 1 year ago

I am having the same issue here:

https://github.com/hadrianhu888/fmi_test_6

Specifically, test_FMI_GRT_1.slx file has a Simscape file that does not compile with GRTFMI.

I am not sure what I did wrong in terms of settings.

hadrianhu888 commented 1 year ago

I am having the following error when I try to make a simple simscape system in Simulink. This is the error I am getting when I use slbuild('model') command, and I get similar errors of 'too many input arguments':

`>> slbuild('fmi_test_GRT_3')

Generating code and artifacts to 'Model specific' folder structure

Generating code into build folder: F:\GitHubRepos\FMI_test_6\fmi_test_GRT_3_grt_fmi_rtw

Generating code for Physical Networks associated with solver block 'fmi_test_GRT_3/Subsystem/Solver Configuration' ...

done.

Invoking Target Language Compiler on fmi_test_GRT_3.rtw

Using System Target File: D:\Program Files\Matlab\rtw\c\FMIKit-Simulink-3.0\grtfmi\grtfmi.tlc

Loading TLC function libraries

........

Initial pass through model to cache user defined code

...

Caching model source code

...........................

Generating TLC interface API.

........................

Writing source file fmi_test_GRT_3_capi.c

.......

Writing header file fmi_test_GRT_3_capi.h

..................................................

Writing header file fmi_test_GRT_3_types.h

Writing header file fmi_test_GRT_3.h

Writing header file rtwtypes.h

Writing header file builtin_typeid_types.h

Writing header file multiword_types.h

.

Writing source file fmi_test_GRT_3.c

Writing header file fmi_test_GRT_3_private.h

Writing header file rtmodel.h

TLC code generation complete (took 11.429s).

Writing modelDescription.xml

.

Writing buildDescription.xml

.

Creating HTML report file index.html

Saving binary information cache.

Running CMake generator

Build Summary

Top model targets built:

Model Action Rebuild Reason

fmi_test_GRT_3 Failed Code generation information file does not exist.

0 of 1 models built (0 models already up to date) Build duration: 0h 1m 36.137s Error using coder.internal.callMakeHook The call to grtfmi_make_rtw_hook, during the after_make hook generated the following error: SubSystem block (mask) does not have a parameter named 'CMakeCompilerOptimizationLevel'

The build process will terminate as a result.

Error in coder.internal.ModelBuilder>@(lBuildInfoArg,lBuildOptsArg)coder.internal.callMakeHook('after_make',lMakeOptions,lBuildOptsArg,'FolderToRunFrom',mainCompileFolder,'ModelReferenceTargetType',lModelReferenceTargetType,'BuildDirectory',mainCompileFolder,'ModelName',lModelName,'BuildInfo',lBuildInfoArg,'LocalAnchorFolder',compileAnchorDir,'TemplateMakefile',lTemplateMakefile,'MakeRTWHookFile',lMakeRTWHookFile,'Verbose',iBuildArgs.Verbose,'DispHook',lDispHook,'SlBuildProfileIsOn',iBuildArgs.SlbuildProfileIsOn) (line 1185) coder.internal.callMakeHook(...

Error in coder.internal.ModelBuilder>i_wrapAfterMakeHook (line 2936) lPostCompileSTFHooks.after_make(lBuildInfo, lBuildOpts);

Error in coder.internal.ModelBuilder>i_buildProcedure (line 1603) i_wrapAfterMakeHook...

Error in coder.internal.ModelBuilder.make_rtw (line 119) [buildResult, mainObjFolder] = i_buildProcedure...

Error in build_target

Error in build_target

Error in build_standalone_rtw_target

Error in slbuild_private

Error in slbuild_private

Error in sl_feval

Error in slbuild

Error in slbuild - Show complete stack trace Caused by: Error using grtfmi_make_rtw_hook SubSystem block (mask) does not have a parameter named 'CMakeCompilerOptimizationLevel' - Show complete stack trace`

@t-sommer, this is the following model

image

I am not sure what to do with the error messages.

Any ideas on how to fix it?

Thanks

hadrianhu888 commented 1 year ago

Any idea when this bug will be fixed? I am still waiting on this feature. Thanks.

t-sommer commented 1 year ago

This should work with 227d0c37ad7292389292e5006fa3475305ca9f22.