Archived OpenModelica forums. Posting is disabled.

Alternative forums include GitHub discussions or StackOverflow (make sure to read the Stack Overflow rules; you need to have well-formed questions)


Forgot password? | Forgot username? | Register

gcc not recognized

gcc not recognized

Hi I have installed OpenModelica 1.8.0 two days ago, I didn't have time to see if it is working I assumed it did, now when I try a simple example I get the following error:

record SimulationResult
    resultFile = "",
    simulationOptions = "startTime = 0.0, stopTime = 1.0, numberOfIntervals = 500, tolerance = 1e-006, method = 'dassl', fileNamePrefix = 'hw', storeInTemp = false, noClean = false, options = '', outputFormat = 'mat', variableFilter = '.*', measureTime = false, cflags = ''",
    messages = "Simulation failed for model: hw
Error: Error building simulator. Buildlog: gcc  -O3 -falign-functions -msse2 -mfpmath=sse   -I\"C:/OpenModelica1.8.0//include/omc\" -I.    -c -o hw.o hw.c
'gcc' is not recognized as an internal or external command,
operable program or batch file.
\\MinGW\\bin\\mingw32-make: *** [hw.o] Error 1

",
    timeFrontend = 0.0,
    timeBackend = 0.0,
    timeSimCode = 0.0,
    timeTemplates = 0.0,
    timeCompile = 0.0,
    timeSimulation = 0.0,
    timeTotal = 0.0
end SimulationResult;

it seems that gcc it is not recognised. I have set the path to direct to MinGW\bin where this command is. It is still doesn't work even if in the comand window this command is recognised. I have looked at the enviroment variables and they seem to be ok, below you can see them:

DRMODELICAHOME="C:\OpenModelica1.8.0\share/omnotebook/drmodelica"
OPENMODELICAHOME=C:\OpenModelica1.8.0\
OPENMODELICALIBRARY=C:\OpenModelica1.8.0\lib/omlibrary
OS=Windows_NT
Path=C:\OpenModelica1.8.0\MinGW\bin;C:\Program Files\NVIDIA Corporation\PhysX\Co
mmon;C:\WINDOWS\system32;C:\WINDOWS;.......

where the error can be?

Re: gcc not recognized

Hi,

Yeah, I've been trying to fix an issue for people that have several MinGW and Msys installed (and
some of them are in the path) and I've ended up breaking our compile script for Windows.

Download Compile.bat from here:
http://openmodelica.org/svn/OpenModelic … r/scripts/
user: anonymous
pass: none <- write "none" here
and replace it in the OpenModelica installation here:
C:\OpenModelica1.8.0\share\omc\scripts
Let me know if this one works for you.

Cheers,
Adrian Pop/

Re: gcc not recognized

I have tried what you said but now I get the following error:

record SimulationResult
    resultFile = "",
    simulationOptions = "startTime = 0.0, stopTime = 4.0, numberOfIntervals = 500, tolerance = 1e-006, method = 'dassl', fileNamePrefix = 'HelloWorld', storeInTemp = false, noClean = false, options = '', outputFormat = 'mat', variableFilter = '.*', measureTime = false, cflags = ''",
    messages = "Simulation failed for model: HelloWorld
Error: Error building simulator. Buildlog: The system cannot find the path specified.
gcc  -O3 -falign-functions -msse2 -mfpmath=sse   -I\"C:/OpenModelica1.8.0//include/omc\" -I.    -c -o HelloWorld.o helloworld.c
'gcc' is not recognized as an internal or external command,
operable program or batch file.
\\MinGW\\bin\\mingw32-make: *** [HelloWorld.o] Error 1

",
    timeFrontend = 0.0,
    timeBackend = 0.0,
    timeSimCode = 0.0,
    timeTemplates = 0.0,
    timeCompile = 0.0,
    timeSimulation = 0.0,
    timeTotal = 0.0
end SimulationResult;

Re: gcc not recognized

Hi Adrian,

I have made it work, with a little bit of guessing and luck. here is the compile.bath changed:

Code:


@echo off
REM Clear all environment variables that may interfere during compile and link phases.
set GCC_EXEC_PREFIX=
set CPLUS_INCLUDE_PATH=
set C_INCLUDE_PATH=
set LIBRARY_PATH=
set OLD_PATH=%PATH%
set OPENMODELICAHOME=C:\OpenModelica1.8.0
set MINGW=%OPENMODELICAHOME%\MinGW
REM If OMDEV is set, use MinGW from there instead of OPENMODELICAHOME
REM It is not certain that release OMC is installed
if not %OMDEV%a==a set MINGW=%OMDEV%\tools\MinGW
echo OPENMODELICAHOME = %OPENMODELICAHOME% >> c:\%1.log 2>&1
echo MINGW = %MINGW% >>c:\%1.log 2>&1
set CURRENT_DIR="%CD%" >>c:\%1.log 2>&1
cd /D "%MINGW%\bin" >>c:\%1.log 2>&1
set PATH=%CD%;%CD%\..\libexec\gcc\mingw32\4.4.0\; >>c:\%1.log 2>&1
cd /D "%CURRENT_DIR%" >>c:\%1.log 2>&1
REM echo PATH = %PATH% >>%1.log 2>&1
REM echo CD = %CD% >>%1.log 2>&1
%MinGW%\bin\mingw32-make -f %1.makefile >>c:\%1.log 2>&1
set RESULT=%ERRORLEVEL%
set PATH=%OLD_PATH%
set OLD_PATH=
exit %RESULT%

Sorry that I had to hardcode the values needed for me. But it seems that the problem in this compile file was that the instruction MINGW didn't set the path correctly my default OPENMODELICAHOME variable was "C:\openmodelica1.8.0\ and the original code for MINGW=%OPENMODELICA%\MinGW which didn't translate to a valid path. the results was something like C:\openmodelica1.8.0\ \MinGW.

Hope this will help in the future.

Thanks for showing me where to look to solve this issue.

Vlad.

Re: gcc not recognized

I'm glad you fixed it. I think the problem is that OMEdit translates OPENMODELICAHOME to forward
slashes, i.e. C:/OpenModelica1.8.0/ and that poses problems for Windows commands it seems.
Well, I'll see what more I can do for our next build.

Cheers,
Adrian Pop/

Re: gcc not recognized

i've been having the same issue with 1.8.0 on win xp. i believe the problem is as suggested above (forward slashes instead of back), but also with quotation marks inserted automatically by the operating system into the path. the following output from Compile.bat:

   MINGW = "C:/ProgramFiles/OpenModelica1.8.0/"\MinGW

i've fixed it for me by simply changing the following in the vanilla Compile.bat (created during the installation process)

   set MINGW=%OPENMODELICAHOME%\MinGW

to

   set MINGW=%OPENMODELICAHOME:"=%\MinGW
   set MINGW=%MINGW:/=\%


i don't believe it has anything to do with multiple installations of mingw (although i do have that).

Re: gcc not recognized

Hi, I wanted to somehow include myself into this discussion cause I have a problem with several versions of OpenModelica. I've used OpenModelica last year more, and now when my OS is changed I can't get any of the examples to compile. When running the last published beta version to simulate a model I made and compiled last year, the compiling output says I have a mingw32-make Error 2, and there is a warning message saying I am missing some start values for my electrical circuit (capacitor voltage, inductor current). Since I have never had to make any adjustments to these models, I really don't know what to do. I have tried installing a couple of old versions (18.0, 18.1) and a couple of new ones (19.0, 19.1 Beta2) and I can never get any of the examples or my models to simulate. In the older versions, I just run the simulation and nothing happens, the newer ones give me the already mentioned messages. I hope someone could shed some light on this issue.. Thanks in advance!
Cheers,

Ilma

Re: gcc not recognized

Hi,

I suggest you try one of the latest nightly-builds:
https://build.openmodelica.org/omc/buil … ly-builds/
Also, the messages about missing start values were added because we do more checks for the initialization. They are mostly warnings.
To get rid of them you need to have (start = value, fixed = true) to fix the start values at initialization.
Read the Modelica specification 3.2 revision 2.

Cheers,
Adrian Pop/

There are 0 guests and 0 other users also viewing this topic