Skip to content

Commit

Permalink
Fix include path for docker FMI builds
Browse files Browse the repository at this point in the history
Belonging to [master]:
  - OpenModelica/OMCompiler#3024
  • Loading branch information
sjoelund authored and OpenModelica-Hudson committed Apr 2, 2019
1 parent ccf8c89 commit 0464950
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions Compiler/Script/CevalScriptBackend.mo
Expand Up @@ -3370,7 +3370,7 @@ algorithm
System.removeFile(logfile);
end if;
nozip := Autoconf.make+" -j"+intString(Config.noProc()) + " nozip";
includeDefaultFmi := "-I" + Settings.getInstallationDirectoryPath() + "/include/omc/c/fmi";
includeDefaultFmi := Settings.getInstallationDirectoryPath() + "/include/omc/c/fmi";
finishedBuild := match Util.stringSplitAtChar(platform, " ")
case {"dynamic"}
algorithm
Expand All @@ -3384,7 +3384,7 @@ algorithm
makefileStr := System.stringReplace(makefileStr, "@NEED_RUNTIME@", "");
makefileStr := System.stringReplace(makefileStr, "@NEED_DGESV@", "");
makefileStr := System.stringReplace(makefileStr, "@FMIPLATFORM@", System.modelicaPlatform());
makefileStr := System.stringReplace(makefileStr, "@CPPFLAGS@", includeDefaultFmi);
makefileStr := System.stringReplace(makefileStr, "@CPPFLAGS@", "-I" + includeDefaultFmi);
makefileStr := System.stringReplace(makefileStr, "@LIBTYPE_DYNAMIC@", "1");
makefileStr := System.stringReplace(makefileStr, "@BSTATIC@", Autoconf.bstatic);
makefileStr := System.stringReplace(makefileStr, "@BDYNAMIC@", Autoconf.bdynamic);
Expand All @@ -3405,7 +3405,7 @@ algorithm
makefileStr := System.stringReplace(makefileStr, "@NEED_RUNTIME@", "");
makefileStr := System.stringReplace(makefileStr, "@NEED_DGESV@", "");
makefileStr := System.stringReplace(makefileStr, "@FMIPLATFORM@", System.modelicaPlatform());
makefileStr := System.stringReplace(makefileStr, "@CPPFLAGS@", "-DOMC_MINIMAL_RUNTIME=1 -DCMINPACK_NO_DLL=1 " + includeDefaultFmi);
makefileStr := System.stringReplace(makefileStr, "@CPPFLAGS@", "-DOMC_MINIMAL_RUNTIME=1 -DCMINPACK_NO_DLL=1 -I" + includeDefaultFmi);
makefileStr := System.stringReplace(makefileStr, "@LIBTYPE_DYNAMIC@", "1");
makefileStr := System.stringReplace(makefileStr, "@BSTATIC@", Autoconf.bstatic);
makefileStr := System.stringReplace(makefileStr, "@BDYNAMIC@", Autoconf.bdynamic);
Expand All @@ -3416,7 +3416,7 @@ algorithm
then false;
case {_}
algorithm
cmd := "cd \"" + fmutmp + "/sources\" && ./configure --host="+quote+platform+quote+" CFLAGS="+quote+"-Os"+quote+" CPPFLAGS="+quote+includeDefaultFmi+quote+" LDFLAGS= && " +
cmd := "cd \"" + fmutmp + "/sources\" && ./configure --host="+quote+platform+quote+" CFLAGS="+quote+"-Os"+quote+" CPPFLAGS="+quote+"-I"+includeDefaultFmi+quote+" LDFLAGS= && " +
nozip;
if 0 <> System.systemCall(cmd, outFile=logfile) then
Error.addMessage(Error.SIMULATOR_BUILD_ERROR, {System.readFile(logfile)});
Expand All @@ -3427,12 +3427,12 @@ algorithm
case host::"docker"::"run"::rest
algorithm
uid := System.getuid();
cmd := "docker run "+(if uid<>0 then "--user " + String(uid) else "")+" --rm -w /fmu -v "+quote+System.realpath(fmutmp+"/..")+quote+":/fmu " +stringDelimitList(rest," ")+ " sh -c " + dquote +
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 +
"cd " + dquote + System.basename(fmutmp) + "/sources" + dquote + " && " +
"./configure --host="+quote+host+quote+" CFLAGS="+quote+"-Os"+quote+" CPPFLAGS="+quote+includeDefaultFmi+quote+" LDFLAGS= && " +
"./configure --host="+quote+host+quote+" CFLAGS="+quote+"-Os"+quote+" CPPFLAGS=-I/fmiInclude LDFLAGS= && " +
nozip + dquote;
if 0 <> System.systemCall(cmd, outFile=logfile) then
Error.addMessage(Error.SIMULATOR_BUILD_ERROR, {System.readFile(logfile)});
Error.addMessage(Error.SIMULATOR_BUILD_ERROR, {cmd + ":\n" + System.readFile(logfile)});
System.removeFile(dir + logfile);
fail();
end if;
Expand Down

0 comments on commit 0464950

Please sign in to comment.