Skip to content

Commit 7a0df51

Browse files
authored
python cannot find local fmpy as we are setting the HOME (#181)
* python cannot find local fmpy as we are setting the HOME * propagate stepSize to OMSimulator
1 parent 87d7358 commit 7a0df51

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

.CI/Jenkinsfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -650,6 +650,7 @@ def runRegressiontest(branch, name, extraFlags, omsHash, dbPrefix, sshConfig, om
650650
"""
651651
FMI_TESTING_FLAG="--fmi=true --fmisimulator=${env.HOME}/saved_omc/OMSimulator/install/bin/OMSimulator --default=ulimitExe=50"
652652
}
653+
653654
if (name.contains('fmpy')) {
654655
sh """
655656
# update fmpy
@@ -800,7 +801,11 @@ def runRegressiontest(branch, name, extraFlags, omsHash, dbPrefix, sshConfig, om
800801
export PNLIBREFS="${PNLIBREFS}"
801802
export THERMOFLUIDSTREAMREFS="${THERMOFLUIDSTREAMREFS}"
802803
export THERMOFLUIDSTREAMREFSOM="${THERMOFLUIDSTREAMREFSOM}"
804+
export PREVIOUSHOME="${env.HOME}"
803805
export HOME="${libraryPath}"
806+
# we need to do some crap magic here to make sure python3 finds fmpy as we change the HOME here
807+
ln -s -t \${HOME} \${PREVIOUSHOME}/.local .local
808+
804809
cd OpenModelicaLibraryTesting
805810
# Force /usr/bin/omc as being used for generating the mos-files. Ensures consistent behavior among all tested OMC versions
806811
stdbuf -oL -eL time ./test.py --ompython_omhome=/usr ${FMI_TESTING_FLAG} --extraflags='${extraFlags}' --extrasimflags='${extrasimflags}' --branch="${name}" --output="libraries.openmodelica.org:/var/www/libraries.openmodelica.org/branches/${name}/" --libraries='${libraryPath}/.openmodelica/libraries/' --jobs=${jobs} ${libs_config_file} ${params.OLDLIBS ? "configs/conf-old.json configs/conf-nonstandard.json" : ""} || (killall omc ; false) || exit 1

testmodel.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,7 @@ def sendExpressionOldOrNew(cmd):
514514
fmisimulator = "%s simulate " % fmisimulator
515515
cmd = "%s --start-time %g --stop-time %g --timeout %g --relative-tolerance %g --interface-type ModelExchange --solver CVode --output-interval %g %s.fmu" % (("--output-file %s" % resFile),startTime,stopTime,conf["ulimitExe"],tolerance,stepSize,conf["fileName"].replace(".","_"))
516516
else: # OMSimulator
517-
cmd = "%s --tempDir=%s --startTime=%g --stopTime=%g --timeout=%g --tolerance=%g %s.fmu" % (("-r=%s" % resFile) if outputFormat != "empty" else "",fmitmpdir,startTime,stopTime,conf["ulimitExe"],tolerance,conf["fileName"].replace(".","_"))
517+
cmd = "%s --tempDir=%s --startTime=%g --stopTime=%g --stepSize=%g --timeout=%g --tolerance=%g %s.fmu" % (("-r=%s" % resFile) if outputFormat != "empty" else "",fmitmpdir,startTime,stopTime,stepSize,conf["ulimitExe"],tolerance,conf["fileName"].replace(".","_"))
518518
with open(simFile,"w") as fp:
519519
fp.write("%s %s\n" % (fmisimulator, cmd))
520520
res = checkOutputTimeout("(rm -f %s.pipe ; mkfifo %s.pipe ; head -c 1048576 < %s.pipe >> %s & %s %s > %s.pipe 2>&1)" % (conf["fileName"],conf["fileName"],conf["fileName"],simFile,fmisimulator,cmd,conf["fileName"]), 1.05*conf["ulimitExe"], conf)

0 commit comments

Comments
 (0)