Skip to content
This repository was archived by the owner on May 18, 2019. It is now read-only.

Commit ed7a206

Browse files
sjoelundOpenModelica-Hudson
authored andcommitted
More debugging for cross-compilation of FMUs
Belonging to [master]: - #3027
1 parent 5de59c3 commit ed7a206

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

Compiler/Script/CevalScriptBackend.mo

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3352,7 +3352,7 @@ protected function configureFMU
33523352
input String logfile;
33533353
input Boolean isWindows;
33543354
protected
3355-
String CC, CFLAGS, LDFLAGS, makefileStr, container, host, nozip,
3355+
String CC, CFLAGS, LDFLAGS, makefileStr, container, host, nozip, path1, path2,
33563356
dir=fmutmp+"/sources/", cmd="",
33573357
quote="'",
33583358
dquote = if isWindows then "\"" else "'",
@@ -3427,8 +3427,15 @@ algorithm
34273427
case host::"docker"::"run"::rest
34283428
algorithm
34293429
uid := System.getuid();
3430-
cmd := "docker run "+(if uid<>0 then "--user " + String(uid) else "")+" --rm -w /fmu -v "+quote+System.realpath(fmutmp+"/..")+quote+":/fmu -v "+quote+System.realpath(includeDefaultFmi)+quote+":/fmiInclude "+stringDelimitList(rest," ")+ " sh -c " + dquote +
3431-
"(cd " + dquote + System.basename(fmutmp) + "/sources" + dquote + " || (ls -lh ; false)) && " +
3430+
path1 := System.realpath(fmutmp+"/..");
3431+
path2 := path1 + "/" + System.basename(fmutmp);
3432+
for path in {path1, path2} loop
3433+
if not System.directoryExists(path) then
3434+
Error.addMessage(Error.SIMULATOR_BUILD_ERROR, {path + " does not exist, but we should have just created it..."});
3435+
end if;
3436+
end for;
3437+
cmd := "docker run "+(if uid<>0 then "--user " + String(uid) else "")+" --rm -w /fmu -v "+quote+path1+quote+":/fmu -v "+quote+System.realpath(includeDefaultFmi)+quote+":/fmiInclude "+stringDelimitList(rest," ")+ " sh -c " + dquote +
3438+
"(cd " + dquote + path2 + "/sources" + dquote + " || (ls -lh ; false)) && " +
34323439
"./configure --host="+quote+host+quote+" CFLAGS="+quote+"-Os"+quote+" CPPFLAGS=-I/fmiInclude LDFLAGS= && " +
34333440
nozip + dquote;
34343441
if 0 <> System.systemCall(cmd, outFile=logfile) then

0 commit comments

Comments
 (0)