Info

此问题已关闭。 请重新打开它进行编辑或回答。

Simscape Electrical Model Linux Building Issue

1 次查看(过去 30 天)
Bibin
Bibin 2019-5-3
关闭: Bibin 2019-5-22
Hello,
I was trying to build one of the example Simscape electrical models in Linux Matlab and I am running into an issue.
The model name I am using is elec_motor_dc_pwm.slx which is the example model available with the toolbox.I wanted to build it with ert.tlc system target file and wanted to run the executable stand alone. I was able to do this in Windows, but somehow getting a build error on Linux. So here is what I tried so far
  1. Changed the system target file of the model to ert.tlc (I tried it with grt.tlc as well, but still the same build error)
  2. Chnaged the solver to Fixed step, and changed the sample time to 0.1 Secs
  3. Changed the solver configuration block in the simscape model to use Local solver
  4. Then I hit Cntrl+B to build to generate executable
  5. It builds perfectly fine and giving the executable in Windows. But on Linux it generates code, compiles the C file to object file, but I guess there is some linker error. Copying the error below.
Really appreciate any help on this. Please let me know if you need any more details.
Error From Matlab Command Window
### Creating standalone executable ../elec_motor_dc_pwm_v2 ...
g++ -Wl,-rpath,"/apps/matlab/R2018b/bin/glnxa64",-L"/apps/matlab/R2018b/bin/glnxa64" -o ../elec_motor_dc_pwm_v2 elec_motor_dc_pwm_v2_3cfe243b_1_ds.o elec_motor_dc_pwm_v2_3cfe243b_1_ds_obs_all.o elec_motor_dc_pwm_v2_3cfe243b_1_ds_obs_act.o elec_motor_dc_pwm_v2_3cfe243b_1_ds_obs_exp.o elec_motor_dc_pwm_v2_3cfe243b_1_ds_log.o elec_motor_dc_pwm_v2_3cfe243b_1_ds_f.o elec_motor_dc_pwm_v2_3cfe243b_1.o elec_motor_dc_pwm_v2_3cfe243b_1_gateway.o pm_printf.o rt_logging.o rt_backsubrr_dbl.o rt_forwardsubrr_dbl.o rt_lu_real.o rt_matrixlib_dbl.o elec_motor_dc_pwm_v2.o rtGetInf.o rtGetNaN.o rt_nonfinite.o rt_main.o /apps/matlab/R2018b/toolbox/physmod/simscape/engine/sli/lib/glnxa64/ssc_sli_std.a /apps/matlab/R2018b/toolbox/physmod/simscape/engine/core/lib/glnxa64/ssc_core_std.a /apps/matlab/R2018b/toolbox/physmod/network_engine/lib/glnxa64/ne_std.a /apps/matlab/R2018b/toolbox/physmod/common/math/core/lib/glnxa64/mc_std.a /apps/matlab/R2018b/toolbox/physmod/common/external/library/lib/glnxa64/ex_std.a /apps/matlab/R2018b/toolbox/physmod/common/foundation/core/lib/glnxa64/pm_std.a -lm
/bin/ld: ssc_sli_0bd269e6.o: access beyond end of merged section (8934)
/bin/ld: ssc_sli_0bd269e6.o: access beyond end of merged section (7646)
/bin/ld: ssc_sli_0bd269e6.o: access beyond end of merged section (7442)
/bin/ld: ssc_sli_0bd269e6.o: access beyond end of merged section (9163)
/bin/ld: ssc_sli_0bd269e6.o: access beyond end of merged section (6760)
/bin/ld: ssc_sli_0bd269e6.o: access beyond end of merged section (8041)
/bin/ld: ssc_sli_0bd269e6.o: access beyond end of merged section (7823)
/bin/ld: ssc_sli_0bd269e6.o: access beyond end of merged section (6828)
/bin/ld: ssc_sli_0bd269e6.o: access beyond end of merged section (6593)
/bin/ld: ssc_sli_0bd269e6.o: access beyond end of merged section (6783)
/bin/ld: ssc_sli_0bd269e6.o: access beyond end of merged section (8285)
/bin/ld: ssc_sli_0bd269e6.o: access beyond end of merged section (9530)
/bin/ld: ssc_sli_0bd269e6.o: access beyond end of merged section (9509)
/bin/ld: ssc_sli_0bd269e6.o: access beyond end of merged section (9551)
/bin/ld: ssc_sli_0bd269e6.o: access beyond end of merged section (9572)
/bin/ld: ssc_sli_0bd269e6.o: access beyond end of merged section (9593)
/bin/ld: ssc_sli_0bd269e6.o: access beyond end of merged section (9467)
/bin/ld: ssc_sli_0bd269e6.o: access beyond end of merged section (9488)
/bin/ld: ssc_sli_0bd269e6.o: access beyond end of merged section (5908)
/bin/ld: ssc_sli_0bd269e6.o: access beyond end of merged section (5879)
/bin/ld: ssc_sli_0bd269e6.o: access beyond end of merged section (5966)
/bin/ld: ssc_sli_0bd269e6.o: access beyond end of merged section (5995)
/bin/ld: ssc_sli_0bd269e6.o: access beyond end of merged section (6024)
/bin/ld: ssc_sli_0bd269e6.o: access beyond end of merged section (6082)
/bin/ld: ssc_sli_0bd269e6.o: access beyond end of merged section (5821)
/bin/ld: ssc_sli_0bd269e6.o: access beyond end of merged section (5850)
/bin/ld: ssc_sli_0bd269e6.o: access beyond end of merged section (6053)
/bin/ld: ssc_sli_0bd269e6.o: access beyond end of merged section (5937)
/bin/ld: ssc_sli_0bd269e6.o: access beyond end of merged section (8903)
/bin/ld: ssc_sli_0bd269e6.o: access beyond end of merged section (8841)
/bin/ld: ssc_sli_0bd269e6.o: access beyond end of merged section (8872)
/bin/ld: ssc_sli_0bd269e6.o: access beyond end of merged section (9036)
/bin/ld: ssc_sli_0bd269e6.o: access beyond end of merged section (7410)
/bin/ld: ssc_sli_0bd269e6.o: access beyond end of merged section (7346)
/bin/ld: ssc_sli_0bd269e6.o: access beyond end of merged section (7378)
/bin/ld: ssc_sli_0bd269e6.o: access beyond end of merged section (7525)
/bin/ld: ssc_sli_0bd269e6.o: access beyond end of merged section (7557)
/bin/ld: ssc_sli_0bd269e6.o: access beyond end of merged section (9371)
/bin/ld: ssc_sli_0bd269e6.o: access beyond end of merged section (6168)
/bin/ld: ssc_sli_0bd269e6.o: access beyond end of merged section (6728)
/bin/ld: ssc_sli_0bd269e6.o: access beyond end of merged section (8778)
/bin/ld: ssc_sli_0bd269e6.o: access beyond end of merged section (8658)
/bin/ld: ssc_sli_0bd269e6.o: access beyond end of merged section (8569)
/bin/ld: ssc_sli_0bd269e6.o: access beyond end of merged section (7131)
/bin/ld: ssc_sli_0bd269e6.o: access beyond end of merged section (9074)
/bin/ld: ssc_sli_0bd269e6.o: access beyond end of merged section (8051)
/bin/ld: ssc_sli_0bd269e6.o: access beyond end of merged section (9703)
/bin/ld: ssc_sli_0bd269e6.o: access beyond end of merged section (8114)
/bin/ld: ssc_sli_0bd269e6.o: access beyond end of merged section (6142)
/bin/ld: ssc_sli_0bd269e6.o: access beyond end of merged section (7289)
/bin/ld: ssc_sli_0bd269e6.o: access beyond end of merged section (8423)
/bin/ld: ssc_sli_0bd269e6.o: access beyond end of merged section (8228)
/bin/ld: ssc_sli_0bd269e6.o: access beyond end of merged section (6384)
/bin/ld: ssc_sli_0bd269e6.o: access beyond end of merged section (8721)
/bin/ld: ssc_sli_0bd269e6.o: access beyond end of merged section (6671)
/bin/ld: ssc_sli_0bd269e6.o: access beyond end of merged section (8632)
/bin/ld: ssc_sli_0bd269e6.o: access beyond end of merged section (8140)
/bin/ld: ssc_sli_0bd269e6.o: access beyond end of merged section (8721)
/bin/ld: ssc_sli_0bd269e6.o: access beyond end of merged section (6567)
/bin/ld: ssc_sli_0bd269e6.o: access beyond end of merged section (9106)
/bin/ld: ssc_sli_0bd269e6.o: access beyond end of merged section (7983)
/bin/ld: ssc_sli_0bd269e6.o: access beyond end of merged section (7957)
/bin/ld: ssc_sli_0bd269e6.o: access beyond end of merged section (7894)
/bin/ld: ssc_sli_0bd269e6.o: access beyond end of merged section (9805)
/bin/ld: ssc_sli_0bd269e6.o: access beyond end of merged section (6912)
/bin/ld: ssc_sli_0bd269e6.o: access beyond end of merged section (9729)
/bin/ld: ssc_sli_0bd269e6.o: access beyond end of merged section (7006)
/bin/ld: ssc_sli_0bd269e6.o: access beyond end of merged section (6849)
/bin/ld: ssc_sli_0bd269e6.o: access beyond end of merged section (9614)
/bin/ld: ssc_sli_0bd269e6.o: access beyond end of merged section (8480)
/bin/ld: ssc_sli_0bd269e6.o: access beyond end of merged section (6410)
/bin/ld: ssc_sli_0bd269e6.o: access beyond end of merged section (7163)
/bin/ld: ssc_sli_0bd269e6.o: access beyond end of merged section (9245)
/bin/ld: ssc_sli_0bd269e6.o: access beyond end of merged section (6797)
/bin/ld: ssc_sli_0bd269e6.o: access beyond end of merged section (9742)
/bin/ld: ssc_sli_0bd269e6.o: access beyond end of merged section (6944)
/bin/ld: ssc_sli_0bd269e6.o: access beyond end of merged section (7100)
/bin/ld: ssc_sli_0bd269e6.o: access beyond end of merged section (7258)
/bin/ld: /apps/matlab/R2018b/toolbox/physmod/simscape/engine/sli/lib/glnxa64/ssc_sli_std.a(ssc_sli_0bd269e6.o)(.debug_info+0x850): reloc against `.debug_str': error 2
/bin/ld: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status
gmake: *** [../elec_motor_dc_pwm_v2] Error 1
### Build procedure for model: 'elec_motor_dc_pwm_v2' aborted due to an error.
Error using coder.make.Builder/coder_diagnose
Error(s) encountered while building "elec_motor_dc_pwm_v2":
### Failed to generate all binary outputs.
Error in coder.make.Builder/coder_build
Error in coder.make.Builder/run
Error in coder.make.invokeBuilder
Error in RTW/genMakefileAndBuild
Error in RTW/genMakefileAndBuildWrapper
Error in coder.internal.compileStage
Error in coder.internal.ModelBuilder/buildProcedure (line 1301)
compileResult = coder.internal.compileStage...
Error in coder.internal.ModelBuilder/make_rtw (line 212)
buildResult = buildProcedure...
Error in coder.internal.ModelCodegenMgr/make_rtw (line 8)
buildResult = obj.make_rtw(varargin);
Error in make_rtw (line 20)
buildResult = h.make_rtw(buildArgs, varargin{:});
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 (line 15)
[varargout{1:nargout}]=feval(varargin{:});
Error in slbuild (line 83)
sl('slbuild_private', mdl, target, varargin{2:end});
Error in rtwbuild (line 234)
slbuild(sys, 'StandaloneRTWTarget', ...

回答(0 个)

此问题已关闭。

社区

更多回答在  Power Electronics Control

Community Treasure Hunt

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

Start Hunting!

Translated by