Skip to content
This repository has been archived by the owner on May 18, 2019. It is now read-only.

Commit

Permalink
on mingw C runtime link statically with sundials
Browse files Browse the repository at this point in the history
- on mingw define LINK_SUNDIALS_STATIC before including sundials headers
- fix rule for dataReconcilation.cpp (was overwritten before)

Belonging to [master]:
  - #2894
  - OpenModelica/OMCompiler-3rdParty#33
  • Loading branch information
adrpo committed Jan 24, 2019
1 parent 17f0451 commit 0960fc0
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 2 deletions.
4 changes: 2 additions & 2 deletions SimulationRuntime/c/Makefile.common
Expand Up @@ -223,9 +223,9 @@ $(RESULTSOBJSPATH):$(BUILDPATH)/%$(OBJ_EXT): %.cpp $(RESULTSFILESPATH) $(COMMON_
$(MKBUILDDIR)
$(CXX) -c $(CXXFLAGS) -o $@ $<

$(SIMOBJSPATH):$(BUILDPATH)/%$(OBJ_EXT): %.cpp linearization/linearize.cpp $(SIMHFILESPATH) $(COMMON_HEADERS)
$(SIMOBJSPATH):$(BUILDPATH)/%$(OBJ_EXT): %.cpp linearization/linearize.cpp dataReconciliation/dataReconciliation.cpp $(SIMHFILESPATH) $(COMMON_HEADERS)
$(MKBUILDDIR)
$(CXX) -c -Ilinearization/ $(CXXFLAGS) -o $@ $<
$(CXX) -c -Ilinearization/ -IdataReconciliation/ $(CXXFLAGS) -o $@ $<

$(SIMOBJSPATHC):$(BUILDPATH)/%$(OBJ_EXT): %.c $(SIMHFILESPATH) $(COMMON_HEADERS)
@echo Deps: $(SIMHFILESPATH) $(COMMON_HEADERS)
Expand Down
5 changes: 5 additions & 0 deletions SimulationRuntime/c/simulation/solver/ida_solver.c
Expand Up @@ -56,6 +56,11 @@

#ifdef WITH_SUNDIALS

/* adrpo: on mingw link with static sundials */
#if defined(__MINGW32__)
#define LINK_SUNDIALS_STATIC
#endif

/* readability */
#define SCALE_MODE 0
#define RESCALE_MODE 1
Expand Down
5 changes: 5 additions & 0 deletions SimulationRuntime/c/simulation/solver/ida_solver.h
Expand Up @@ -41,6 +41,11 @@

#ifdef WITH_SUNDIALS

/* adrpo: on mingw link with static sundials */
#if defined(__MINGW32__)
#define LINK_SUNDIALS_STATIC
#endif

#include <sundials/sundials_nvector.h>
#include <nvector/nvector_serial.h>
#include <idas/idas.h>
Expand Down
5 changes: 5 additions & 0 deletions SimulationRuntime/c/simulation/solver/kinsolSolver.c
Expand Up @@ -41,6 +41,11 @@

#ifdef WITH_SUNDIALS

/* adrpo: on mingw link with static sundials */
#if defined(__MINGW32__)
#define LINK_SUNDIALS_STATIC
#endif

#include <math.h>
#include <stdlib.h>
#include <string.h> /* memcpy */
Expand Down
5 changes: 5 additions & 0 deletions SimulationRuntime/c/simulation/solver/radau.c
Expand Up @@ -44,6 +44,11 @@
#include "simulation/options.h"
#ifdef WITH_SUNDIALS

/* adrpo: on mingw link with static sundials */
#if defined(__MINGW32__)
#define LINK_SUNDIALS_STATIC
#endif

#include <kinsol/kinsol.h>
#include <kinsol/kinsol_dense.h>
#include <kinsol/kinsol_spgmr.h>
Expand Down
5 changes: 5 additions & 0 deletions SimulationRuntime/c/simulation/solver/radau.h
Expand Up @@ -41,6 +41,11 @@

#ifdef WITH_SUNDIALS

/* adrpo: on mingw link with static sundials */
#if defined(__MINGW32__)
#define LINK_SUNDIALS_STATIC
#endif

#define DEFAULT_IMPRK_ORDER 5

#include <math.h>
Expand Down

0 comments on commit 0960fc0

Please sign in to comment.