Skip to content

Build omc with cmake when cmake flags are given - #290

Merged
sjoelund merged 1 commit into
masterfrom
wasm-jit-2
Aug 4, 2026
Merged

Build omc with cmake when cmake flags are given#290
sjoelund merged 1 commit into
masterfrom
wasm-jit-2

Conversation

@sjoelund

@sjoelund sjoelund commented Aug 4, 2026

Copy link
Copy Markdown
Member

The wasm-jit simulation target only exists in the Rust port of the compiler, which is built by cmake, whereas the library testing builds omc with GNU autotools. Give runRegressiontest a cmakeFlags parameter: when it is non-empty the tested omc is configured and installed with cmake instead, with the flags shared by every target (release, clang, -march=native, no ccache/GUI/OMSimulator) added by the function. The install prefix stays OMCompiler/build, so the omc cache in ~/saved_omc and OPENMODELICAHOME are unaffected.

The wasm-jit stage passes -DOM_OMC_ENABLE_RUST=ON -DRUST_OMC_CI=ON -DRUST_OMC_THREADS=4 and is the only stage that builds with cmake.

Rust builds also use the shared sccache bucket that the OpenModelica job populates from the same commits. Hitting its keys requires the same rust settings (CARGO_PROFILE_RELEASE_OPT_LEVEL=2, -Zthreads=4) and SCCACHE_BASEDIRS pointing at the checkout directory, which is a subdirectory of the workspace here but the workspace itself there. A node without sccache builds uncached, and an unusable S3 backend warns rather than failing the tests.

The wasm-jit simulation target only exists in the Rust port of the
compiler, which is built by cmake, whereas the library testing builds
omc with GNU autotools. Give `runRegressiontest` a `cmakeFlags`
parameter: when it is non-empty the tested omc is configured and
installed with cmake instead, with the flags shared by every target
(release, clang, `-march=native`, no ccache/GUI/OMSimulator) added by
the function. The install prefix stays `OMCompiler/build`, so the omc
cache in `~/saved_omc` and `OPENMODELICAHOME` are unaffected.

The wasm-jit stage passes `-DOM_OMC_ENABLE_RUST=ON -DRUST_OMC_CI=ON
-DRUST_OMC_THREADS=4` and is the only stage that builds with cmake.

Rust builds also use the shared sccache bucket that the OpenModelica
job populates from the same commits. Hitting its keys requires the
same rust settings (`CARGO_PROFILE_RELEASE_OPT_LEVEL=2`, `-Zthreads=4`)
and `SCCACHE_BASEDIRS` pointing at the checkout directory, which is a
subdirectory of the workspace here but the workspace itself there. A
node without sccache builds uncached, and an unusable S3 backend warns
rather than failing the tests.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@sjoelund
sjoelund enabled auto-merge (squash) August 4, 2026 16:25
@sjoelund
sjoelund merged commit 9bc8170 into master Aug 4, 2026
7 checks passed
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

Successfully merging this pull request may close these issues.

1 participant