@@ -3042,7 +3042,7 @@ algorithm
30423042 if Flags . isSet(Flags . GC_PROF ) then
30433043 print(GC . profStatsStr(GC . getProfStats(), head= "GC stats after front-end:" ) + " \n " );
30443044 end if ;
3045- ExecStat . execStat("FrontEnd - DAE generated" );
3045+ ExecStat . execStat("FrontEnd - DAE generated" );
30463046 odae := SOME (dae);
30473047 else
30483048 // Return odae=NONE(); needed to update cache and symbol table if we fail
@@ -3354,7 +3354,8 @@ protected
33543354 String CC , CFLAGS , LDFLAGS , makefileStr, container, host, nozip,
33553355 dir= fmutmp+ "/sources/" , cmd= "" ,
33563356 quote= "'" ,
3357- dquote = if isWindows then " \" " else "'" ;
3357+ dquote = if isWindows then " \" " else "'" ,
3358+ includeDefaultFmi;
33583359 list< String > rest;
33593360 Boolean finishedBuild;
33603361 Integer uid;
@@ -3368,6 +3369,7 @@ algorithm
33683369 System . removeFile(logfile);
33693370 end if ;
33703371 nozip := System . getMakeCommand()+ " -j" + intString(Config . noProc()) + " nozip" ;
3372+ includeDefaultFmi := "-I" + Settings . getInstallationDirectoryPath() + "/include/omc/c/fmi" ;
33713373 finishedBuild := match Util . stringSplitAtChar(platform, " " )
33723374 case {"dynamic" }
33733375 algorithm
@@ -3381,7 +3383,7 @@ algorithm
33813383 makefileStr := System . stringReplace(makefileStr, "@NEED_RUNTIME@" , "" );
33823384 makefileStr := System . stringReplace(makefileStr, "@NEED_DGESV@" , "" );
33833385 makefileStr := System . stringReplace(makefileStr, "@FMIPLATFORM@" , System . modelicaPlatform());
3384- makefileStr := System . stringReplace(makefileStr, "@CPPFLAGS@" , "" );
3386+ makefileStr := System . stringReplace(makefileStr, "@CPPFLAGS@" , includeDefaultFmi );
33853387 makefileStr := System . stringReplace(makefileStr, "@LIBTYPE_DYNAMIC@" , "1" );
33863388 makefileStr := System . stringReplace(makefileStr, " \r\n " , " \n " );
33873389 System . writeFile(dir + "Makefile" , makefileStr);
@@ -3400,7 +3402,7 @@ algorithm
34003402 makefileStr := System . stringReplace(makefileStr, "@NEED_RUNTIME@" , "" );
34013403 makefileStr := System . stringReplace(makefileStr, "@NEED_DGESV@" , "" );
34023404 makefileStr := System . stringReplace(makefileStr, "@FMIPLATFORM@" , System . modelicaPlatform());
3403- makefileStr := System . stringReplace(makefileStr, "@CPPFLAGS@" , "-DOMC_MINIMAL_RUNTIME=1 -DCMINPACK_NO_DLL=1" );
3405+ makefileStr := System . stringReplace(makefileStr, "@CPPFLAGS@" , "-DOMC_MINIMAL_RUNTIME=1 -DCMINPACK_NO_DLL=1 " + includeDefaultFmi );
34043406 makefileStr := System . stringReplace(makefileStr, "@LIBTYPE_DYNAMIC@" , "1" );
34053407 makefileStr := System . stringReplace(makefileStr, " \r\n " , " \n " );
34063408 System . writeFile(dir + "Makefile" , makefileStr);
@@ -3409,7 +3411,7 @@ algorithm
34093411 then false ;
34103412 case {_}
34113413 algorithm
3412- cmd := "cd \" " + fmutmp + "/sources \" && ./configure --host=" + quote+ platform+ quote+ " CFLAGS=" + quote+ "-Os" + quote+ " LDFLAGS= && " +
3414+ cmd := "cd \" " + fmutmp + "/sources \" && ./configure --host=" + quote+ platform+ quote+ " CFLAGS=" + quote+ "-Os" + quote+ " CPPFLAGS=" + quote + includeDefaultFmi + quote + " LDFLAGS= && " +
34133415 nozip;
34143416 if 0 <> System . systemCall(cmd, outFile= logfile) then
34153417 Error . addMessage(Error . SIMULATOR_BUILD_ERROR , {System . readFile(logfile)});
@@ -3422,7 +3424,7 @@ algorithm
34223424 uid := System . getuid();
34233425 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 +
34243426 "cd " + dquote + System . basename(fmutmp) + "/sources" + dquote + " && " +
3425- "./configure --host=" + quote+ host+ quote+ " CFLAGS=" + quote+ "-Os" + quote+ " LDFLAGS= && " +
3427+ "./configure --host=" + quote+ host+ quote+ " CFLAGS=" + quote+ "-Os" + quote+ " CPPFLAGS=" + quote + includeDefaultFmi + quote + " LDFLAGS= && " +
34263428 nozip + dquote;
34273429 if 0 <> System . systemCall(cmd, outFile= logfile) then
34283430 Error . addMessage(Error . SIMULATOR_BUILD_ERROR , {System . readFile(logfile)});
@@ -3529,8 +3531,8 @@ algorithm
35293531 ExecStat . execStat("buildModelFMU: Generate C++ for platform " + platform);
35303532 end for ;
35313533 if 0 <> System . systemCall("make -f " + filenameprefix + "_FMU.makefile clean" , outFile= logfile) then
3532- // do nothing
3533- end if ;
3534+ // do nothing
3535+ end if ;
35343536 return ;
35353537 end if ;
35363538
@@ -3579,21 +3581,21 @@ algorithm
35793581 ext := if System . os() == "Windows_NT" then ".exe" else "" ;
35803582 if encrypt then
35813583 // create the path till packagetool
3582- packageTool := stringAppendList({omhome,pd,"lib" ,pd,"omc" ,pd,"SEMLA" ,pd,"packagetool" ,ext});
3583- if System . regularFileExists(packageTool) then
3584- // create the list of arguments for packagetool
3585- packageToolArgs := "-librarypath \" " + System . dirname(fileName) + " \" -version \" 1.0 \" -language \" 3.2 \" -encrypt \" " + boolString(encrypt) + " \" " ;
3586- command := stringAppendList({packageTool," " ,packageToolArgs});
3587- else
3588- Error . addMessage(Error . ENCRYPTION_NOT_SUPPORTED , {packageTool});
3584+ packageTool := stringAppendList({omhome,pd,"lib" ,pd,"omc" ,pd,"SEMLA" ,pd,"packagetool" ,ext});
3585+ if System . regularFileExists(packageTool) then
3586+ // create the list of arguments for packagetool
3587+ packageToolArgs := "-librarypath \" " + System . dirname(fileName) + " \" -version \" 1.0 \" -language \" 3.2 \" -encrypt \" " + boolString(encrypt) + " \" " ;
3588+ command := stringAppendList({packageTool," " ,packageToolArgs});
3589+ else
3590+ Error . addMessage(Error . ENCRYPTION_NOT_SUPPORTED , {packageTool});
35893591 success := false ;
35903592 runCommand := false ;
3591- end if ;
3592- else
3593- molName := Absyn . pathString(className) + ".mol" ;
3594- dirPath := System . dirname(fileName);
3595- // commands
3596- rmCommand := "rm -f \" " + molName + " \" " ;
3593+ end if ;
3594+ else
3595+ molName := Absyn . pathString(className) + ".mol" ;
3596+ dirPath := System . dirname(fileName);
3597+ // commands
3598+ rmCommand := "rm -f \" " + molName + " \" " ;
35973599 cdCommand := "cd \" " + dirPath + " \" " ;
35983600 mvCommand := "mv \" " + molName + " \" \" " + System . pwd() + " \" " ;
35993601
@@ -8181,8 +8183,8 @@ algorithm
81818183 if nm == 2 then
81828184 resultFile := f; return ;
81838185 end if ;
8184- else
8185- // do nothing
8186+ else
8187+ // do nothing
81868188 end try ;
81878189end selectResultFile;
81888190
0 commit comments