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

Commit 158c497

Browse files
adrpoOpenModelica-Hudson
authored andcommitted
on mingw C runtime link statically with sundials
- 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
1 parent 43044cb commit 158c497

File tree

6 files changed

+27
-6
lines changed

6 files changed

+27
-6
lines changed

SimulationRuntime/c/Makefile.common

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -225,13 +225,9 @@ $(RESULTSOBJSPATH):$(BUILDPATH)/%$(OBJ_EXT): %.cpp $(RESULTSFILESPATH) $(COMMON_
225225
$(MKBUILDDIR)
226226
$(CXX) -c $(CXXFLAGS) -o $@ $<
227227

228-
$(SIMOBJSPATH):$(BUILDPATH)/%$(OBJ_EXT): %.cpp linearization/linearize.cpp $(SIMHFILESPATH) $(COMMON_HEADERS)
228+
$(SIMOBJSPATH):$(BUILDPATH)/%$(OBJ_EXT): %.cpp linearization/linearize.cpp dataReconciliation/dataReconciliation.cpp $(SIMHFILESPATH) $(COMMON_HEADERS)
229229
$(MKBUILDDIR)
230-
$(CXX) -c -Ilinearization/ $(CXXFLAGS) -o $@ $<
231-
232-
$(SIMOBJSPATH):$(BUILDPATH)/%$(OBJ_EXT): %.cpp dataReconciliation/dataReconciliation.cpp $(SIMHFILESPATH) $(COMMON_HEADERS)
233-
$(MKBUILDDIR)
234-
$(CXX) -c -IdataReconciliation/ $(CXXFLAGS) -o $@ $<
230+
$(CXX) -c -Ilinearization/ -IdataReconciliation/ $(CXXFLAGS) -o $@ $<
235231

236232
$(SIMOBJSPATHC):$(BUILDPATH)/%$(OBJ_EXT): %.c $(SIMHFILESPATH) $(COMMON_HEADERS)
237233
@echo Deps: $(SIMHFILESPATH) $(COMMON_HEADERS)

SimulationRuntime/c/simulation/solver/ida_solver.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,11 @@
5656

5757
#ifdef WITH_SUNDIALS
5858

59+
/* adrpo: on mingw link with static sundials */
60+
#if defined(__MINGW32__)
61+
#define LINK_SUNDIALS_STATIC
62+
#endif
63+
5964
/* readability */
6065
#define SCALE_MODE 0
6166
#define RESCALE_MODE 1

SimulationRuntime/c/simulation/solver/ida_solver.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,11 @@
4141

4242
#ifdef WITH_SUNDIALS
4343

44+
/* adrpo: on mingw link with static sundials */
45+
#if defined(__MINGW32__)
46+
#define LINK_SUNDIALS_STATIC
47+
#endif
48+
4449
#include <sundials/sundials_nvector.h>
4550
#include <nvector/nvector_serial.h>
4651
#include <idas/idas.h>

SimulationRuntime/c/simulation/solver/kinsolSolver.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,11 @@
4141

4242
#ifdef WITH_SUNDIALS
4343

44+
/* adrpo: on mingw link with static sundials */
45+
#if defined(__MINGW32__)
46+
#define LINK_SUNDIALS_STATIC
47+
#endif
48+
4449
#include <math.h>
4550
#include <stdlib.h>
4651
#include <string.h> /* memcpy */

SimulationRuntime/c/simulation/solver/radau.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@
4444
#include "simulation/options.h"
4545
#ifdef WITH_SUNDIALS
4646

47+
/* adrpo: on mingw link with static sundials */
48+
#if defined(__MINGW32__)
49+
#define LINK_SUNDIALS_STATIC
50+
#endif
51+
4752
#include <kinsol/kinsol.h>
4853
#include <kinsol/kinsol_dense.h>
4954
#include <kinsol/kinsol_spgmr.h>

SimulationRuntime/c/simulation/solver/radau.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,11 @@
4141

4242
#ifdef WITH_SUNDIALS
4343

44+
/* adrpo: on mingw link with static sundials */
45+
#if defined(__MINGW32__)
46+
#define LINK_SUNDIALS_STATIC
47+
#endif
48+
4449
#define DEFAULT_IMPRK_ORDER 5
4550

4651
#include <math.h>

0 commit comments

Comments
 (0)