Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenModelica compiled with UCRT can't build model #79

Closed
AnHeuermann opened this issue Aug 11, 2023 · 1 comment
Closed

OpenModelica compiled with UCRT can't build model #79

AnHeuermann opened this issue Aug 11, 2023 · 1 comment
Assignees

Comments

@AnHeuermann
Copy link
Member

Description

I can't compile Modelica models with OMJulia.jl.

How to reproduce

Build OpenModelica with Universal C runtime (UCRT) following https://github.com/AnHeuermann/OpenModelica/blob/msys2-ucrt64/OMCompiler/README.Windows.md#13-install-msys2. (This might become the default to build OpenModelica soon.)

Then start Julia from e.g. PowerShell and run:

using OMJulia

pathToOmc = "path\\to\\OpenModelica\\build_cmake\\install_cmake\\bin\\omc.exe"
omc=OMJulia.OMCSession(pathToOmc)

msg = sendExpression(omc, "getVersion()")
@info msg
sendExpression(omc, "loadModel(Modelica)")
msg = sendExpression(omc, "buildModel(Modelica.Electrical.Analog.Examples.CauerLowPassAnalog)")
@info msg
msg = sendExpression(omc, "getErrorString()")
@info msg
[ Info: Setting environment variable OPENMODELICAHOME="D:\workspace\OM\OpenModelica\build_cmake\install_cmake" for this session.
[ Info: Path to zmq file="C:\Users\AHEUER~1\AppData\Local\Temp\openmodelica.port.julia.mm9RDN43qR"
[ Info: v1.22.0-dev-262-gdbaa7ffa95-cmake
[ Info: ["", ""]
┌ Info: Error: Error building simulator. Build log: Das System kann den angegebenen Pfad nicht finden.
│ Das System kann den angegebenen Pfad nicht finden.
└ RESULT: 3

Translation: The system can't find the specified path. Result 3.

Starting Julia from OMDev bash fixes the issue, because the msys tools are in PATH.

Version

  • OS: Windows 11
  • OMDev: UCRT64 environment instead of the default MINGW64 environment
  • Julia Version 1.9.2
  • OMJulia @67f69adb6dfc711402e08ed5feb87983796d4475
@AnHeuermann
Copy link
Member Author

Issue was a missing environment variable (because I don't have an installed OpenModelica with UCRT64 yet). So one needs to set OMDEV_MSYS in addition to OMDEV.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant