- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » Model check without error but fails...
Model check without error but fails to compile
Model check without error but fails to compile
gcc -falign-functions -msse2 -mfpmath=sse -I"C:/OpenModelica1.9.0//include/omc" -I. -L"C:/Dymola" -c -o Sterilisation.Tests_assemblage.Test.o Sterilisation.Tests_assemblage.Test.c
cc1.exe: out of memory allocating 65536 bytes
mingw32-make: *** [Sterilisation.Tests_assemblage.Test.o] Error 1
The same model compiles well with dymola (using the MSVC++)
Thank you for your help,
Assaad
Re: Model check without error but fails to compile
How much RAM does your computer have?
- sjoelund.se
- 1700 Posts
Re: Model check without error but fails to compile
OK, but running Windows so limited to 3GB per process. I would recommend Linux and clang You can also change to MSVC using OpenModelica, but it uses up more memory than GCC.
- sjoelund.se
- 1700 Posts
Re: Model check without error but fails to compile
Hi,
The story is a bit more involved.
The MinGW GCC that comes with OpenModelica is a 32 bit executable and compiles to 32 bit executable.
So basically gcc can use only 2GB of memory when compiling.
I did change gcc.exe to be large address aware (but i don't remember if i did that too for cc1.exe)
which means it can go up to 4GB of memory.
You could try to compile with omc +target=msvc which uses cl (Visual Studio) compiler to compile the executable.
Also you could try to restart your computer and then try to compile immediately after that as you'll have more
contiguous memory available that way.
Cheers,
Adrian Pop/
- adrpo
- 885 Posts
Re: Model check without error but fails to compile
Disabling some optimizations for gcc might also help, so instead of -O3 you could use -O0.
I think you can do that via MODELICAUSERCFLAGS env. variable, set it to -O0.
Cheers,
Adrian Pop/
- adrpo
- 885 Posts
Re: Model check without error but fails to compile
Or using getCFlags() + setCompilerFlags(... + "-O0") API (don't ask me why they are different...)
- sjoelund.se
- 1700 Posts
Re: Model check without error but fails to compile
Thanks for these ideas.
I didn't succeed with setting the parameter to -O0.
However I have problem to switch the compiler to msvc. I used in openmodelica shell setCompiler("msvc") but i have a message saying that MinGW32 doest not recognize msvc which mean that it is still GCC that compiles.
How I can do this switch?
Thanks
Re: Model check without error but fails to compile
You need to use +target=msvc. It needs to create a different set of makefiles.
See also https://openmodelica.org/index.php/foru … =892#p3340
- sjoelund.se
- 1700 Posts
- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » Model check without error but fails...