Skip to content

Commit 6afafad

Browse files
committed
fix for getStartValue in cpp template
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@20901 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
1 parent 057633b commit 6afafad

File tree

5 files changed

+22
-7
lines changed

5 files changed

+22
-7
lines changed

Compiler/Template/CodegenCpp.tpl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1309,7 +1309,7 @@ EXEEXT=<%makefileParams.exeext%>
13091309
DLLEXT=<%makefileParams.dllext%>
13101310
CFLAGS_BASED_ON_INIT_FILE=<%extraCflags%>
13111311
CFLAGS=$(CFLAGS_BASED_ON_INIT_FILE) -Winvalid-pch $(SYSTEM_CFLAGS) -I"<%makefileParams.omhome%>/include/omc/cpp/Core" -I"<%makefileParams.omhome%>/include/omc/cpp/" -I. <%makefileParams.includes%> -I"$(BOOST_INCLUDE)" <%makefileParams.includes ; separator=" "%> <%match sopt case SOME(s as SIMULATION_SETTINGS(__)) then s.cflags %>
1312-
LDSYTEMFLAGS=-L"<%makefileParams.omhome%>/lib/omc/cpp" -lOMCppBase -lOMCppOMCFactory -lOMCppSystem -lOMCppModelicaUtilities -lOMCppMath -L"$(BOOST_LIBS)" $(BOOST_SYSTEM_LIB) $(BOOST_FILESYSTEM_LIB) $(BOOST_PROGRAM_OPTIONS_LIB) $(LINUX_LIB_DL)
1312+
LDSYTEMFLAGS=-L"<%makefileParams.omhome%>/lib/omc/cpp" $(BASE_LIB) -lOMCppOMCFactory -lOMCppSystem -lOMCppModelicaUtilities -lOMCppMath -L"$(BOOST_LIBS)" $(BOOST_SYSTEM_LIB) $(BOOST_FILESYSTEM_LIB) $(BOOST_PROGRAM_OPTIONS_LIB) $(LINUX_LIB_DL)
13131313
LDMAINFLAGS=-L"<%makefileParams.omhome%>/lib/omc/cpp" -L"<%makefileParams.omhome%>/bin" -lOMCppOMCFactory -L"$(BOOST_LIBS)" $(BOOST_SYSTEM_LIB) $(BOOST_FILESYSTEM_LIB) $(BOOST_PROGRAM_OPTIONS_LIB) $(LINUX_LIB_DL)
13141314
CPPFLAGS = $(CFLAGS) -DOMC_BUILD -DBOOST_SYSTEM_NO_DEPRICATED
13151315
SYSTEMFILE=OMCpp<%fileNamePrefix%><% if acceptMetaModelicaGrammar() then ".conv"%>.cpp
@@ -7893,6 +7893,10 @@ template crefStartValueType2(DAE.Type ty)
78937893
case T_INTEGER(__) then 'Int'
78947894
case T_REAL(__) then 'Real'
78957895
case T_BOOL(__) then 'Bool'
7896+
case T_ENUMERATION(__) then 'Int'
7897+
case T_ARRAY(ty=T_INTEGER(__)) then 'Int'
7898+
case T_ARRAY(ty=T_REAL(__)) then 'Real'
7899+
case T_ARRAY(ty=T_BOOL(__)) then 'Bool'
78967900
else "error start value type"
78977901
end match
78987902

SimulationRuntime/cpp/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,7 @@ add_subdirectory (Core/Math)
199199
add_subdirectory (Core/Utils/Modelica)
200200
add_subdirectory (Core/DataExchange)
201201
add_subdirectory (SimCoreFactory/OMCFactory)
202+
202203
#add system default implemention project
203204
add_subdirectory (Core/System)
204205
#add solver default implemention project

SimulationRuntime/cpp/Core/Modelica/ModelicaConfig.inc.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ LAPACK_LIBS = @LAPACK_LIBRARIES_@
1515
MODELICA_SYSTEM_LIB_EXT = @MODELICA_SYSTEM_LIB_EXT@
1616
FMI_ARCH_DIR = @FMI_ARCH_DIR@
1717
LINUX_LIB_DL = @LINUX_LIB_DL@
18+
BASE_LIB = @BASE_LIB@
1819
PCH_FILE = @PCH_FILE@
1920
H_FILE = @H_FILE@
2021
BUILD_TYPE = @BUILD_TYPE@

SimulationRuntime/cpp/Core/System/CMakeLists.txt

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
11
cmake_minimum_required (VERSION 2.6)
22

33
project(${SystemName})
4-
add_library(${BasiLibName} STATIC tpl.cpp )
5-
set_target_properties(${BasiLibName} PROPERTIES COMPILE_FLAGS -fPIC)
4+
set(BASE_LIB "" CACHE INTERNAL "" )
5+
6+
#IF (NOT ((${CMAKE_SYSTEM_NAME} MATCHES "Darwin") OR MSVC))
7+
#add_library(${BasiLibName} STATIC tpl.cpp )
8+
#set_target_properties(${BasiLibName} PROPERTIES COMPILE_FLAGS -fPIC)
9+
#set(BASE_LIB -l${BasiLibName} CACHE INTERNAL "" )
10+
#ENDIF (NOT ((${CMAKE_SYSTEM_NAME} MATCHES "Darwin") OR MSVC))
11+
12+
613
# add the system default implementation library
714
IF(ANALYZATION_MODE)
815
add_library(${SystemName} STATIC AlgLoopDefaultImplementation.cpp AlgLoopSolverFactory.cpp EventHandling.cpp SystemDefaultImplementation.cpp FactoryExport.cpp )
@@ -23,8 +30,9 @@ endif(UNIX)
2330

2431
install (TARGETS ${SystemName} DESTINATION lib/omc/${LIBINSTALLEXT})
2532
install (TARGETS ${SystemName}_static DESTINATION lib/omc/${LIBINSTALLEXT})
26-
install (TARGETS ${BasiLibName} DESTINATION lib/omc/${LIBINSTALLEXT})
27-
33+
#IF (NOT ((${CMAKE_SYSTEM_NAME} MATCHES "Darwin") OR MSVC))
34+
#install (TARGETS ${BasiLibName} DESTINATION lib/omc/${LIBINSTALLEXT})
35+
#ENDIF (NOT ((${CMAKE_SYSTEM_NAME} MATCHES "Darwin") OR MSVC))
2836
install (FILES
2937
${CMAKE_SOURCE_DIR}/Include/Core/System/SystemDefaultImplementation.h
3038
${CMAKE_SOURCE_DIR}/Include/Core/System/AlgLoopDefaultImplementation.h

SimulationRuntime/cpp/Include/Core/ModelicaDefine.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ typedef double logRetType;
2727
typedef double coshRetType;
2828

2929

30-
30+
/*
3131
#if !defined(_MSC_VER) && !defined( __APPLE__)
3232
//extern template class boost::shared_ptr<IAlgLoopSolver>;
3333
//extern template class boost::shared_ptr<IAlgLoop>;
@@ -55,4 +55,5 @@ extern template class boost::function<void (unordered_map<string,unsigned int>&
5555
//extern template class ublas::vector<double, adaptor_t>;
5656
//extern template class ublas::matrix<double, adaptor_t> shared_matrix_t;
5757
58-
#endif
58+
#endif
59+
*/

0 commit comments

Comments
 (0)