Modelica translator error message

Dear Ms./Mr.

When I tried to run Xcos example RLC circuit, I met the following error message:

Modelica translator error message.

Would you advice how I work it out?

Thank you.

Best regards,
Wang RD

Here’s the error message:

“c_pass1: build the modelica meta-block failed”

“xcos_simulate: Error during block parameters update.”

You need to have a compiler on your system (I recommend to install Visual Studio Community edition 2022).

I have the same issue. I installed the compiler, but not certain I did it correctly. I don’t know how to check that. I still have the same issue as described above.

Hello,

Which compiler ? Latest version of minGW Scilab Toolbox should work (if properly installed, see the toobox page ATOMS : MinGw toolbox details), but we now recommend Visual Studio Communitty (Visual Studio 2022 Community Edition – Télécharger la dernière version gratuite).

S.

I’m investigating the “if properly installed”. with minGW… I have since installed Visual Studio Community and the recommended toolbox for that but still no change in behavior. I’m trying to make time to work on this again today. Appreciate your direction and support.

Microsoft Visual Studio Community 2022
Version 17.8.0
VisualStudio.17.Release/17.8.0+34309.116
Microsoft .NET Framework
Version 4.8.09032

Installed Version: Community

Visual C++ 2022 00482-90000-00000-AA309
Microsoft Visual C++ 2022
C# Tools 4.8.0-7.23558.1+e091728607ca0fc9efca55ccfb3e59259c6b5a0a
C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.
TypeScript Tools 17.0.20920.2001
TypeScript Tools for Microsoft Visual Studio

Visual Basic Tools 4.8.0-7.23558.1+e091728607ca0fc9efca55ccfb3e59259c6b5a0a
Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Ok. Did you uninstall the minGW toolbox ?

S.

yes. So far no change in translator error message.

→ msvc=findmsvccompiler()
msvc =

“Visual Studio Community 2022”

Hello,

Can you test the compiler within Scilab by running the C and C++ dynamic link examples in the help page of ilib_build (type help ilib_build on Scilab’s command line) ?

It if fails, can you give us the error messages here ?

S.

The C File does not look like it failed.
→ ilib_build(‘build_c’,[‘fun1’,‘sci_fun1’],files,);
Generate a gateway file
Generate a loader file
Generate a Makefile
Running the makefile
Compilation of build_c.cpp
Compilation of build_c.h
Compilation of build_c.hxx
Compilation of fun1.c
Compilation of fun2.c
Compilation of sci_fun1.c
Building shared library (be patient)
Generate a cleaner file

→ // load the shared library

→ exec loader.sce;
Shared archive loaded.
Link done.

→ //using the new primitive

→ fun1(33)
ans =

0.0160328

ilib_build(‘ilib_build_cpp’,[‘cppfind’,‘sci_cppfind’],files,);
Generate a gateway file
Generate a loader file
Generate a Makefile
Running the makefile
Compilation of ilib_build_cpp.cpp
Compilation of ilib_build_cpp.h
Compilation of ilib_build_cpp.hxx
Compilation of sci_cppfind.cxx
Building shared library (be patient)
Generate a cleaner file

→ // load the shared library

→ exec loader.sce;
Shared archive loaded.
Link done.

→ // Small test to see if the function is actually working.

→ if cppfind(“my very long string”,“long”) <> 8 pause, end

→ if cppfind(“my very long string”,“very”) <> 3 pause, end

→ if cppfind(“my very long string”,“short”) <> -1 pause, end

Hello,

OK, everything is OK with “basic” dynamic link, so it seems to be another issue. Can you give all the lines printed on Scilab command line during the failed compilation of the RLC Modelica demo ? Lines start with:

 Main Modelica :...
Flat Modelica :...../RLC_Modelica_imf.mo
 Simulation C code :..../RLC_Modelica_im.c
   Generate a loader file
   Generate a Makefile
   ilib_gen_Make: Copy compilation files (Makefile*, libtool...) to TMPDIR
   ilib_gen_Make: Copy RLC_Modelica_im.c to TMPDIR
   ilib_gen_Make: configure : Generate Makefile.
   ilib_gen_Make: Modification of the Makefile in TMPDIR.
   Running the Makefile

The part of the log giving more details is after “Running the Makefile”.

Note: use code blocks when you include code or logs in your post, your previous messages were automatically flagged because the full logs were included as basic text (see the posting guidelines: Welcome to the Scilab discourse forum!)

S.

Main Modelica : C:\Users\PLATTE~1\AppData\Local\Temp\SCI_TMP_9768_31669\RLC_Modelica_im.mo


  "c_pass1: build the modelica meta-block failed"

  "xcos_simulate: Error during block parameters update."

You said you wanted the message from “Main Modelica” onward. That is the same as the original message issue.

This is the message before, for clarity:

at line     1 of executed string 
at line    50 of function        loadXcosLibs ( C:\Users\Plattenberger\AppData\Local\scilab-2023.1.0\modules\xcos\macros\loadXcosLibs.sci line 65 )

It is not possible to redefine the Branchinglib primitive this way (see clearfun).

Your problem is not a compilation problem. There is likely a redefinition problem. Which toolbox are currrently installed in your Scilab ? Please uninstall all your toolboxes then test again the Modelica demo.

S.

 Main Modelica : C:\Users\PLATTE~1\AppData\Local\Temp\SCI_TMP_2524_7026\RLC_Modelica_im.mo


  "c_pass1: build the modelica meta-block failed"

  "xcos_simulate: Error during block parameters update."

I removed 3 toolboxes.

Coselica
SciPowerLab
xlsLink

Dear @KapitalP,

This issue seems to be solved in latest Coselica version. You can try to install it using the following commands:

atomsSystemUpdate();
atomsInstall("coselica")

Vincent

That would be:no change.