Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 16 additions & 14 deletions .CI/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,7 @@ pipeline {
if (pullRequestTarget() == 'C') {
runRegressiontest("pr/${pullRequest()}", "pr/${pullRequest()}", '', '', false, pullRequestSimflags(), testFlags, false, false, 0, config)
} else {
runRegressiontest("pr/${pullRequest()}", "pr/${pullRequest()}", 'setCommandLineOptions("--simCodeTarget=wasm-jit")', '', false, pullRequestSimflags(), "--nobuildmodel ${testFlags}", false, false, 0, config,
wasmCmakeFlags())
runRegressiontest("pr/${pullRequest()}", "pr/${pullRequest()}", 'setCommandLineOptions("--simCodeTarget=wasm-jit")', '', false, pullRequestSimflags(), "--nobuildmodel ${testFlags}", false, false, 0, config)
}
}
}
Expand Down Expand Up @@ -344,8 +343,7 @@ pipeline {
// --nobuildmodel: the model is translated, compiled and simulated by one simulate(),
// so omc reports the JIT compile as the build time rather than leaving it in the
// simulation the way a resimulate does.
runRegressiontest('master', 'wasm-jit', 'setCommandLineOptions("--simCodeTarget=wasm-jit")', '', false, '', '--nobuildmodel', false, false, 0, 'configs/conf.json',
wasmCmakeFlags())
runRegressiontest('master', 'wasm-jit', 'setCommandLineOptions("--simCodeTarget=wasm-jit")', '', false, '', '--nobuildmodel', false, false, 0, 'configs/conf.json')
}
}
stage('wasm-fmu') {
Expand All @@ -363,8 +361,7 @@ pipeline {
steps {
// --branch=wasm-jit and no runner of its own fills that table: the two runners write
// wasm-jit-me and wasm-jit-cs, beside the wasm-jit the stage above fills.
runRegressiontest('master', 'wasm-jit', 'setCommandLineOptions("--simCodeTarget=wasm-jit")', '', false, '', '--wasmfmu=me,cs', false, false, 0, 'configs/conf.json',
wasmCmakeFlags())
runRegressiontest('master', 'wasm-jit', 'setCommandLineOptions("--simCodeTarget=wasm-jit")', '', false, '', '--wasmfmu=me,cs', false, false, 0, 'configs/conf.json')
}
}
stage('wasm-web') {
Expand All @@ -384,7 +381,7 @@ pipeline {
// driver and solvers, which the environment below selects.
withEnv(wasmWebEnv()) {
runRegressiontest('master', 'wasm-web', 'setCommandLineOptions("--simCodeTarget=wasm-jit")', '', false, '', '--nobuildmodel', false, false, 0, 'configs/conf.json',
wasmCmakeFlags() + ' -DRUST_OMC_WASM_INWASM_DRIVER=ON')
'-DRUST_OMC_WASM_INWASM_DRIVER=ON')
}
}
}
Expand Down Expand Up @@ -481,8 +478,7 @@ pipeline {
expression { params.heavy_tests_wasm }
}
steps {
runRegressiontest('master', 'heavy_tests_wasm', 'setCommandLineOptions("--simCodeTarget=wasm-jit")', '', false, '', '--nobuildmodel', false, false, 1, 'configs/heavy_tests.json',
wasmCmakeFlags())
runRegressiontest('master', 'heavy_tests_wasm', 'setCommandLineOptions("--simCodeTarget=wasm-jit")', '', false, '', '--nobuildmodel', false, false, 1, 'configs/heavy_tests.json')
}
}

Expand Down Expand Up @@ -911,6 +907,11 @@ def sccachePreamble() {
'''
}

/* Whether the omc tested for `branch` is the Rust one: master and the pull requests into it. */
def testsRustOMC(branch) {
return branch == 'master' || branch.startsWith('pr/')
}

/**
* Whether omc is built with cmake for `branch`, rather than with Autoconf and Makefiles.
*
Expand Down Expand Up @@ -941,7 +942,7 @@ def buildsWithCMake(branch) {
* physical cpus on the machine'.
* @param libs_config_file: The config file to be used for testing.
* This file specifies which libraries to test and what options to use for them.
* @param cmakeFlags: Target-specific cmake flags, e.g. `-DOM_OMC_ENABLE_RUST=ON`, added to the
* @param cmakeFlags: Target-specific cmake flags, e.g. `-DRUST_OMC_WASM_INWASM_DRIVER=ON`, added to the
* shared release flags. Only for the branches built with cmake, see
* buildsWithCMake().
* @param dockerfile: Directory with a Dockerfile, relative to the testing repository. Defaults to
Expand All @@ -958,10 +959,8 @@ def fmiSimulators(fmi3 = false) {
(fmi3 ? ['fmpy-fmi3-cs-cvode'] : [])
}

/* The cmake flags of an omc that can translate to wasm-jit. The wasm-jit and
* wasm-fmu jobs share the build cached in ~/saved_omc/wasm-jit, so they have to
* ask for the same one. */
def wasmCmakeFlags() {
/* The cmake flags of the Rust omc, which testsRustOMC() adds to a job's own. */
def rustCmakeFlags() {
return '-DOM_OMC_ENABLE_RUST=ON -DRUST_OMC_CI=ON -DRUST_OMC_THREADS=4 -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache'
}

Expand Down Expand Up @@ -1126,6 +1125,9 @@ def runRegressiontest(branch, name, extraFlags, omsHash, omcompiler, extrasimfla
OMCPATH = "${omcompiler ? '../' : './'}OMCompiler"

def useCMake = buildsWithCMake(branch)
if (testsRustOMC(branch)) {
cmakeFlags = "${rustCmakeFlags()} ${cmakeFlags}".trim()
}
// The build runs in OMCompiler, one level below the cmake source tree.
if (useCMake && omcompiler) {
error 'cmake builds need the OMCompiler directory of the OpenModelica repository (omcompiler=false)'
Expand Down
Loading