Skip to content

Commit

Permalink
- I had to reinclude some headers to get the ANALYZATION_MODE running…
Browse files Browse the repository at this point in the history
… (sorry Niklas, maybe we can find a better solution soon)

- Precompiled headers are now disabled if using ANALYZATION_MODE -> otherwise it will not compile with our tracing-tool

git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@20525 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
Marcus Walther committed May 9, 2014
1 parent 4e413d3 commit 631342f
Show file tree
Hide file tree
Showing 11 changed files with 80 additions and 10 deletions.
18 changes: 18 additions & 0 deletions Compiler/Template/CodegenCppHpcom.tpl
Expand Up @@ -59,6 +59,24 @@ match simCode
case SIMCODE(__) then
<<
<%generateHeaderInlcudeString(simCode)%>
#ifdef ANALYZATION_MODE
#include <boost/shared_ptr.hpp>
#include <boost/weak_ptr.hpp>
#include <boost/numeric/ublas/vector.hpp>
#include <boost/numeric/ublas/matrix.hpp>
#include <string>
#include <vector>
#include <map>
using std::string;
using std::vector;
using std::map;
#include <SimCoreFactory/Policies/FactoryConfig.h>
#include <SimController/ISimController.h>
#include <System/IMixedSystem.h>

#include <boost/numeric/ublas/matrix_sparse.hpp>
typedef uBlas::compressed_matrix<double, uBlas::column_major, 0, uBlas::unbounded_array<int>, uBlas::unbounded_array<double> > SparseMatrix;
#endif
<%generateHpcomSpecificIncludes(simCode)%>
<%generateClassDeclarationCode(simCode)%>

Expand Down
5 changes: 4 additions & 1 deletion SimulationRuntime/cpp/CMakeLists.txt
@@ -1,7 +1,10 @@
cmake_minimum_required (VERSION 2.6)

project(CppSolverInterface)
include(${CMAKE_SOURCE_DIR}/PrecompiledHeader.cmake)
IF(NOT ANALYZATION_MODE)
#Precompiled header produces problems if the compiler is not "g++" but "scorep g++"
include(${CMAKE_SOURCE_DIR}/PrecompiledHeader.cmake)
ENDIF(NOT ANALYZATION_MODE)
#set(CMAKE_VERBOSE_MAKEFILE ON)


Expand Down
4 changes: 3 additions & 1 deletion SimulationRuntime/cpp/Core/Modelica/CMakeLists.txt
Expand Up @@ -110,7 +110,9 @@ foreach(lib ${LAPACK_LIBRARIES})
endforeach(lib ${LAPACK_LIBRARIES})
#end Fix

add_precompiled_header(${ModelicaName} Include/Core/Modelica.h )
IF(NOT ANALYZATION_MODE)
add_precompiled_header(${ModelicaName} Include/Core/Modelica.h )
ENDIF(NOT ANALYZATION_MODE)

configure_file (
"ModelicaConfig.inc.in"
Expand Down
10 changes: 7 additions & 3 deletions SimulationRuntime/cpp/Core/Modelica/ModelicaSystem.h
@@ -1,8 +1,12 @@
#pragma once




#ifdef ANALYZATION_MODE
#include "FactoryExport.h"
#include "System/SystemDefaultImplementation.h"
#include "System/EventHandling.h"
#include "HistoryImpl.h"
#include "DataExchange/Policies/TextfileWriter.h"
#endif

/*****************************************************************************
*
Expand Down
9 changes: 9 additions & 0 deletions SimulationRuntime/cpp/Include/Core/HistoryImpl.h
@@ -1,5 +1,14 @@
#pragma once

#ifdef ANALYZATION_MODE
#include <SimulationSettings/IGlobalSettings.h>
#include <DataExchange/IHistory.h>
#include <map>
#include <boost/range/adaptor/map.hpp>
#include <boost/range/algorithm/copy.hpp>
using std::map;
#endif

template< template <unsigned long,unsigned long,unsigned long> class ResultsPolicy,unsigned long dim_1,unsigned long dim_2,unsigned long dim_3>
class HistoryImpl: public IHistory,
public ResultsPolicy<dim_1,dim_2,dim_3>
Expand Down
@@ -1,6 +1,16 @@
#pragma once


#ifdef ANALYZATION_MODE
#include <SimController/ISimData.h>
#include <System/IMixedSystem.h>
#include <System/IAlgLoopSolverFactory.h>
#include <SimulationSettings/IGlobalSettings.h>
#include <boost/weak_ptr.hpp>
#include <boost/shared_ptr.hpp>

#include <string.h>
using std::string;
#endif

struct SimSettings
{
Expand Down
5 changes: 5 additions & 0 deletions SimulationRuntime/cpp/Include/Core/SimController/ISimData.h
@@ -1,6 +1,11 @@
#pragma once
#include <DataExchange/ISimVar.h>

#ifdef ANALYZATION_MODE
#include <string.h>
#include <boost/numeric/ublas/fwd.hpp>
#endif

namespace uBlas = boost::numeric::ublas;

class ISimData
Expand Down
Expand Up @@ -12,6 +12,10 @@ Encapsulation of global simulation settings.
/*****************************************************************************
Copyright (c) 2008, OSMC
*****************************************************************************/
#ifdef ANALYZATION_MODE
#include <string.h>
using std::string;
#endif

enum OutputFormat {CSV, MAT, EMPTY};
class IGlobalSettings
Expand Down
4 changes: 3 additions & 1 deletion SimulationRuntime/cpp/Include/Core/System/IStateSelection.h
@@ -1,6 +1,8 @@
#pragma once


#ifdef ANALYZATION_MODE
#include <boost/multi_array.hpp>
#endif

class IStateSelection
{
Expand Down
@@ -1,6 +1,15 @@
#pragma once


#ifdef ANALYZATION_MODE
#include <Math/Functions.h>
#include <System/EventHandling.h>
#include <boost/any.hpp>
#include <boost/unordered_map.hpp>
#include <boost/circular_buffer.hpp>
#include <iostream>
#include <System/IContinuous.h>
#include <SimulationSettings/IGlobalSettings.h>
#endif

/*****************************************************************************/
/**
Expand Down
8 changes: 6 additions & 2 deletions SimulationRuntime/cpp/Makefile
Expand Up @@ -9,9 +9,13 @@ builddir_lib=$(top_builddir)/build/lib/omc
builddir_inc=$(top_builddir)/build/include/omc

runtimeCpp: clean
#cd ./Build && echo "change to Build" && cmake -D ANALYZATION_MODE=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX:PATH="$(builddir_build)" ../
ifeq ("$(ANALYZATION_MODE)","true")
cd ./Build && echo "change to Build" && cmake -DANALYZATION_MODE=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX:PATH="$(builddir_build)" ../
$(MAKE) -C Build;
else
cd ./Build && echo "change to Build" && cmake -D CMAKE_BUILD_TYPE=RelWithDebInfo -D CMAKE_INSTALL_PREFIX:PATH="$(builddir_build)" ../
$(MAKE) -C Build
$(MAKE) -C Build;
endif

install: runtimeCpp
(cd Build; $(MAKE) install)
Expand Down

0 comments on commit 631342f

Please sign in to comment.