Repository navigation
Find OpenModelica if several versions are installed - #5
Merged
Merged
Conversation
adrpo
added a commit
to adrpo/OpenModelica
that referenced
this pull request
Nov 18, 2026
MDT falls back to the newest OPENMODELICAHOME_<version> if OPENMODELICAHOME is not set (OpenModelica#5809, OpenModelica/MDT#5). Assisted-by: Claude Fable 5.2
The Windows installer is changed to allow several OpenModelica versions side by side (OpenModelica/OpenModelica#5809, OpenModelica/OpenModelicaSetup#96). OPENMODELICAHOME then points to the default one and each version sets OPENMODELICAHOME_<version>, with the characters of the version that are not letters or digits replaced by underscores (OPENMODELICAHOME_1_27_0). With "use OPENMODELICAHOME specified binary" MDT looked at OPENMODELICAHOME and then at the PATH. The new OMCHome class looks for the installation in this order: 1. OPENMODELICAHOME 2. the newest OPENMODELICAHOME_<version> 3. omc on the PATH An OPENMODELICAHOME without an omc binary (left behind by an uninstalled version) is skipped if versioned installations exist. The omc that MDT starts now always gets the OPENMODELICAHOME of its own installation, also when the variable is set to another installation and a custom binary is used. BreakProcess.exe is looked up in the same installation as omc. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
adrpo
force-pushed
the
omhome-version
branch
from
November 18, 2026 07:26
c0fbfd6 to
de693d3
Compare
adrpo
marked this pull request as ready for review
November 18, 2026 21:40
adrpo
added a commit
to adrpo/OpenModelica
that referenced
this pull request
Nov 19, 2026
MDT falls back to the newest OPENMODELICAHOME_<version> if OPENMODELICAHOME is not set (OpenModelica#5809, OpenModelica/MDT#5). Assisted-by: Claude Fable 5.2
adrpo
added a commit
to OpenModelica/OpenModelica
that referenced
this pull request
Nov 19, 2026
* Document several OpenModelica versions on Windows The Windows installer is changed to install different OpenModelica versions side by side (#5809). OPENMODELICAHOME then points to the version selected as the default one, and each installed version sets OPENMODELICAHOME_<version>. The User's Guide gets a section about this in the introduction: what the installer does with the versions that are already installed, the default installation, the environment variables and the installer options. The OMPython, OMJulia and OMMatlab chapters describe how to select a version, and the MDT chapter says which version it uses. The command completion of the Rust OMShell looked for commands.xml only in OPENMODELICAHOME, which is the default version and not always the version that runs. It now looks in the installation of the executable first. Assisted-by: Claude Fable 5.2 * Say which version MDT uses without a default MDT falls back to the newest OPENMODELICAHOME_<version> if OPENMODELICAHOME is not set (#5809, OpenModelica/MDT#5). Assisted-by: Claude Fable 5.2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Client part of OpenModelica/OpenModelica#5809 (several OpenModelica versions installed side by side on Windows).
With OpenModelica/OpenModelicaSetup#96 the Windows installer keeps
OPENMODELICAHOMEfor the version selected as the default one and setsOPENMODELICAHOME_<version>for each installed version, with every character of the version that is not a letter or a digit replaced by an underscore, e.g.OPENMODELICAHOME_1_27_0.What changes
With the preference "use OPENMODELICAHOME specified binary" MDT looked at
OPENMODELICAHOMEand then at thePATH. The new classorg.modelica.mdt.omc.OMCHomelooks for the installation in this order:OPENMODELICAHOMEOPENMODELICAHOME_<version>omcon thePATHOPENMODELICAHOME_<version>variablesOPENMODELICAHOMEis used as it is, as before. With them, anOPENMODELICAHOMEwithout an omc binary (left behind by an uninstalled version) is skipped.OPENMODELICAHOMEof its own installation. Before, that was only done when the variable was not set, so a custom binary of one version was started with theOPENMODELICAHOMEof another one.BreakProcess.exe(debugger, Windows) is looked up with the same lookup instead ofOPENMODELICAHOMEonly.ch2.html) mention the versioned variables.There is no new preference to select a version: a specific version is selected with "use custom binary", as before.
Testing
TestOMCHome(new,org.modelica.mdt.test): 8 tests of the lookup with a fake environment and directories with an emptybin/omc.exe. Compiled and run standalone with JUnit 4.13.2: all pass.OMCProxy.javaandMISession.javawere only checked withjavacwithout the Eclipse jars (no errors other than the missing Eclipse classes). The plugins were not built and MDT was not run with this change, on any platform, which is why this is a draft.🤖 Generated with Claude Code