Cannot compile Modelica program as max memory allocation for array has been reached (Compiler is out of heap space)

1

I'm currently attempting to compile a Modelica program in Dymola. I have been running into issues which says the compiler is out of heap space (fatal error C1060), the total size of array must not exceed 0x7fffffff bytes (error C2148) and warning C4307: '*': signed integral constant overflow.

I've tried setting the compiler flag to /Zm in order to increase the allocation of memory upon compile, as well as setting Advanced.CompileWith64=2. So far I have had no success in compiling my program, any suggestions would be appreciated.

Here are some websites I've visited that might help:

https://docs.microsoft.com/en-us/cpp/build/reference/zm-specify-precompiled-header-memory-allocation-limit?view=vs-2019

https://www.claytex.com/blog/dymola-compilation-process/?fbclid=IwAR2_GM6Hrj

https://www.claytex.com/blog/stepping-through-dymosim-exe/

c++
compiler-errors
modelica
dymola
asked on Stack Overflow Sep 19, 2020 by G_Pic

1 Answer

1

To me there are two likely explanations:

  • You use a large table that is included in the C-sources. The best solution is to have the table externally (using Modelica.Blocks.Tables.CombiTable* or similarly), possibly with 64-bit compilation (so that it fits in the address space).
  • Something went wrong in the translation and the array shouldn't be that large, and in that case it's difficult to say more without the model.
answered on Stack Overflow Sep 21, 2020 by Hans Olsson • edited Sep 21, 2020 by Hans Olsson

User contributions licensed under CC BY-SA 3.0