Skip to content

Commit

Permalink
- Added the fmi interface files inside fmu.
Browse files Browse the repository at this point in the history
- modelDescription.xml not required in sources directory.

git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@24714 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
adeas31 committed Feb 23, 2015
1 parent 34c5af0 commit db2e171
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions Compiler/Template/CodegenFMU.tpl
Expand Up @@ -1605,7 +1605,7 @@ match simVar
end SwitchAliasVarsSet;


template getPlatformString2(String modelNamePrefix, String platform, String fileNamePrefix, String dirExtra, String libsPos1, String libsPos2, String omhome)
template getPlatformString2(String modelNamePrefix, String platform, String fileNamePrefix, String dirExtra, String libsPos1, String libsPos2, String omhome, String FMUVersion)
"returns compilation commands for the platform. "
::=
let fmudirname = '<%fileNamePrefix%>.fmutmp'
Expand All @@ -1623,7 +1623,11 @@ match platform
<%\t%>dlltool -d <%fileNamePrefix%>.def --dllname <%fileNamePrefix%>$(DLLEXT) --output-lib <%fileNamePrefix%>.lib --kill-at
<%\t%>cp <%fileNamePrefix%>$(DLLEXT) <%fmudirname%>/binaries/<%platform%>/
<%\t%>cp <%fileNamePrefix%>.lib <%fmudirname%>/binaries/<%platform%>/
<%\t%>cp $(GENERATEDFILES) modelDescription.xml <%fmudirname%>/sources/
<%\t%>cp $(GENERATEDFILES) <%fmudirname%>/sources/
<%if isFMIVersion20(FMUVersion) then
'<%\t%>cp <%omhome%>/include/omc/c/fmi2/fmu2_model_interface.h <%omhome%>/include/omc/c/fmi2/fmu2_model_interface.c <%fmudirname%>/sources/'
else
'<%\t%>cp <%omhome%>/include/omc/c/fmi1/fmu1_model_interface.h <%omhome%>/include/omc/c/fmi1/fmu1_model_interface.c <%fmudirname%>/sources/'%>
<%\t%>cp modelDescription.xml <%fmudirname%>/modelDescription.xml
<%\t%>cp <%omhome%>/bin/libexpat.dll <%fmudirname%>/binaries/<%platform%>/
<%\t%>cp <%omhome%>/bin/pthreadGC2.dll <%fmudirname%>/binaries/<%platform%>/
Expand All @@ -1645,7 +1649,11 @@ match platform

<%\t%>cp <%fileNamePrefix%>$(DLLEXT) <%fmudirname%>/binaries/$(PLATFORM)/
<%\t%>cp <%fileNamePrefix%>_FMU.libs <%fmudirname%>/binaries/$(PLATFORM)/
<%\t%>cp $(GENERATEDFILES) modelDescription.xml <%fmudirname%>/sources/
<%\t%>cp $(GENERATEDFILES) <%fmudirname%>/sources/
<%if isFMIVersion20(FMUVersion) then
'<%\t%>cp <%omhome%>/include/omc/c/fmi2/fmu2_model_interface.h <%omhome%>/include/omc/c/fmi2/fmu2_model_interface.c <%fmudirname%>/sources/'
else
'<%\t%>cp <%omhome%>/include/omc/c/fmi1/fmu1_model_interface.h <%omhome%>/include/omc/c/fmi1/fmu1_model_interface.c <%fmudirname%>/sources/'%>
<%\t%>cp modelDescription.xml <%fmudirname%>/modelDescription.xml
<%\t%>cd <%fmudirname%>; rm -f ../<%fileNamePrefix%>.fmu && zip -r ../<%fileNamePrefix%>.fmu *
<%\t%>rm -rf <%fmudirname%>
Expand All @@ -1670,7 +1678,7 @@ case SIMCODE(modelInfo=MODELINFO(__), makefileParams=MAKEFILE_PARAMS(__), simula
'<%match s.method
case "inline-euler" then "-D_OMC_INLINE_EULER"
case "inline-rungekutta" then "-D_OMC_INLINE_RK"%>'
let compilecmds = getPlatformString2(modelNamePrefix(simCode), makefileParams.platform, fileNamePrefix, dirExtra, libsPos1, libsPos2, makefileParams.omhome)
let compilecmds = getPlatformString2(modelNamePrefix(simCode), makefileParams.platform, fileNamePrefix, dirExtra, libsPos1, libsPos2, makefileParams.omhome, FMUVersion)
<<
# Makefile generated by OpenModelica

Expand Down Expand Up @@ -1754,7 +1762,7 @@ case SIMCODE(modelInfo=MODELINFO(__), makefileParams=MAKEFILE_PARAMS(__), simula
'<%match s.method
case "inline-euler" then "-D_OMC_INLINE_EULER"
case "inline-rungekutta" then "-D_OMC_INLINE_RK"%>'
let compilecmds = getPlatformString2(modelNamePrefix(simCode), makefileParams.platform, fileNamePrefix, dirExtra, libsPos1, libsPos2, makefileParams.omhome)
let compilecmds = getPlatformString2(modelNamePrefix(simCode), makefileParams.platform, fileNamePrefix, dirExtra, libsPos1, libsPos2, makefileParams.omhome, FMUVersion)
let platformstr = match makefileParams.platform case "i386-pc-linux" then 'linux32' case "x86_64-linux" case "x86_64-pc-linux" then 'linux64' else '<%makefileParams.platform%>'
<<
# Makefile generated by OpenModelica
Expand Down

0 comments on commit db2e171

Please sign in to comment.