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

Commit 1dbe81e

Browse files
sjoelundOpenModelica-Hudson
authored andcommitted
Add targets for the MSVC FMI C-runtime via wine
Note: This requires a visual studio setup including env.variables WSDK and W10SDK set, as well as OMDEV installed (for cmake.exe). Belonging to [master]: - #2225
1 parent 70e2f00 commit 1dbe81e

File tree

13 files changed

+254
-55
lines changed

13 files changed

+254
-55
lines changed

Compiler/FrontEnd/Inst.mo

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5498,8 +5498,8 @@ algorithm
54985498
/* adrpo: reuse it if is already there! */
54995499
try
55005500
ht := getGlobalRoot(Global.instHashIndex);
5501-
ht := BaseHashTable.clear(ht);
5502-
setGlobalRoot(Global.instHashIndex, ht);
5501+
ht := BaseHashTable.clear(ht);
5502+
setGlobalRoot(Global.instHashIndex, ht);
55035503
else
55045504
setGlobalRoot(Global.instHashIndex, emptyInstHashTable());
55055505
end try;

Compiler/Script/CevalScriptBackend.mo

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3473,29 +3473,29 @@ algorithm
34733473
// create the path till packagetool
34743474
str2 := stringAppendList({omhome,pd,"lib",pd,"omc",pd,"SEMLA",pd,"packagetool",str1});
34753475
if System.regularFileExists(str2) then
3476-
// create the list of arguments for packagetool
3477-
str3 := "-librarypath \"" + System.dirname(fileName) + "\" -version \"1.0\" -language \"3.2\" -encrypt \"true\"";
3478-
call := stringAppendList({str2," ",str3});
3479-
logFile := "packagetool.log";
3480-
// remove the logFile if it already exists.
3481-
if System.regularFileExists(logFile) then
3482-
System.removeFile(logFile);
3483-
end if;
3484-
// run the packagetool command
3485-
if 0 == System.systemCall(call, logFile) then
3486-
success := true;
3487-
else
3488-
success := false;
3489-
end if;
3490-
// read the logFile
3491-
if System.regularFileExists(logFile) then
3492-
commandOutput := System.readFile(logFile);
3493-
end if;
3494-
else
3495-
Error.addMessage(Error.ENCRYPTION_NOT_SUPPORTED, {str2});
3476+
// create the list of arguments for packagetool
3477+
str3 := "-librarypath \"" + System.dirname(fileName) + "\" -version \"1.0\" -language \"3.2\" -encrypt \"true\"";
3478+
call := stringAppendList({str2," ",str3});
3479+
logFile := "packagetool.log";
3480+
// remove the logFile if it already exists.
3481+
if System.regularFileExists(logFile) then
3482+
System.removeFile(logFile);
3483+
end if;
3484+
// run the packagetool command
3485+
if 0 == System.systemCall(call, logFile) then
3486+
success := true;
3487+
else
3488+
success := false;
3489+
end if;
3490+
// read the logFile
3491+
if System.regularFileExists(logFile) then
3492+
commandOutput := System.readFile(logFile);
3493+
end if;
3494+
else
3495+
Error.addMessage(Error.ENCRYPTION_NOT_SUPPORTED, {str2});
34963496
commandOutput := "";
34973497
success := false;
3498-
end if;
3498+
end if;
34993499
else
35003500
Error.addMessage(Error.FILE_NOT_FOUND_ERROR, {fileName});
35013501
commandOutput := "";

Compiler/SimCode/SimCodeMain.mo

Lines changed: 33 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -751,7 +751,7 @@ algorithm
751751
matchcontinue (inEnv, className, inFileNamePrefix, addDummy, inSimSettingsOpt, args)
752752
local
753753
String filenameprefix, file_dir, resstr, description;
754-
DAE.DAElist dae;
754+
DAE.DAElist dae, dae1;
755755
FCore.Graph graph;
756756
BackendDAE.BackendDAE dlow, dlow_1;
757757
BackendDAE.Shared shared;
@@ -774,30 +774,56 @@ algorithm
774774
ExecStat.execStatReset();
775775
(cache, graph, odae) := CevalScriptBackend.runFrontEnd(cache, graph, className, false);
776776
ExecStat.execStat("FrontEnd");
777-
SOME(dae) := odae;
777+
SOME(dae1) := odae;
778778

779779
if Flags.isSet(Flags.SERIALIZED_SIZE) then
780-
serializeNotify(dae, "FrontEnd DAE");
780+
serializeNotify(getGlobalRoot(Global.instHashIndex), "Global.instHash");
781+
try
782+
serializeNotify(getGlobalRoot(Global.builtinEnvIndex), "Global.builtinIndex");
783+
else
784+
end try;
785+
try
786+
serializeNotify(getGlobalRoot(Global.rewriteRulesIndex), "Global.rewriteRulesIndex");
787+
else
788+
end try;
789+
try
790+
serializeNotify(getGlobalRoot(Global.inlineHashTable), "Global.inlineHashTable");
791+
else
792+
end try;
793+
try
794+
serializeNotify(getGlobalRoot(Global.operatorOverloadingCache), "Global.operatorOverloadingCache");
795+
else
796+
end try;
797+
try
798+
serializeNotify(getGlobalRoot(Global.interactiveCache), "Global.interactiveCache");
799+
else
800+
end try;
801+
serializeNotify(dae1, "FrontEnd DAE");
781802
serializeNotify(graph, "FCore.Graph");
782803
serializeNotify((graph,inEnv), "FCore.Graph + Old graph");
783804
serializeNotify(cache, "FCore.Cache");
784805
serializeNotify((cache,inCache), "FCore.Cache + Old cache");
785806
serializeNotify(SymbolTable.get(), "Symbol Table (Absyn and SCode)");
786-
serializeNotify((SymbolTable.get(),dae,graph,inEnv,cache,inCache), "Symbol Table, DAE, Graph, OldGraph, Cache, OldCache");
807+
serializeNotify((SymbolTable.get(),dae1,graph,inEnv,cache,inCache), "Symbol Table, DAE, Graph, OldGraph, Cache, OldCache");
787808
ExecStat.execStat("Serialize FrontEnd");
788809
end if;
789810

790811
timeFrontend := System.realtimeTock(ClockIndexes.RT_CLOCK_FRONTEND);
791812

792813
System.realtimeTick(ClockIndexes.RT_CLOCK_BACKEND);
793814
state := State.backend;
794-
dae := DAEUtil.transformationsBeforeBackend(cache, graph, dae);
815+
dae := DAEUtil.transformationsBeforeBackend(cache, graph, dae1);
795816
ExecStat.execStat("Transformations before backend");
796817

797818
if Flags.isSet(Flags.SERIALIZED_SIZE) then
798819
serializeNotify(dae, "FrontEnd DAE after transformations");
820+
serializeNotify((dae,dae1), "FrontEnd DAE before+after transformations");
799821
ExecStat.execStat("Serialize DAE (2)");
800822
end if;
823+
GC.free(dae1);
824+
GC.free(odae);
825+
odae := NONE();
826+
dae1 := DAE.emptyDae;
801827

802828
generateFunctions := Flags.set(Flags.GEN, false);
803829
// We should not need to lookup constants and classes in the backend,
@@ -810,6 +836,7 @@ algorithm
810836
dlow := BackendDAECreate.lower(dae, cache, graph, BackendDAE.EXTRA_INFO(description,filenameprefix));
811837

812838
GC.free(dae);
839+
dae := DAE.emptyDae;
813840

814841
if Flags.isSet(Flags.SERIALIZED_SIZE) then
815842
serializeNotify(dlow, "BackendDAECreate.lower");
@@ -842,8 +869,7 @@ algorithm
842869
serializeNotify(dlow, "BackendDAE (simulation)");
843870
serializeNotify(initDAE, "BackendDAE (initialization)");
844871
serializeNotify(initDAE_lambda0, "BackendDAE (lambda0)");
845-
serializeNotify((dlow,initDAE,initDAE_lambda0), "BackendDAE (simulation+initialization+lambda0)");
846-
serializeNotify(removedInitialEquationLst, "removedInitialEquationLst");
872+
serializeNotify((dlow,initDAE,initDAE_lambda0,inlineData,removedInitialEquationLst), "BackendDAE (simulation+initialization+lambda0+inlineData+removedInitialEquationLst)");
847873
ExecStat.execStat("Serialize solved system");
848874
end if;
849875

Compiler/runtime/CMakeLists.txt

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1+
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
12

3+
# Global Variables
4+
IF(NOT OMCTRUNCHOME)
5+
SET(OMCTRUNCHOME ${CMAKE_CURRENT_SOURCE_DIR}/../../)
6+
ENDIF (NOT OMCTRUNCHOME)
27

38
IF(NOT IDL)
49
FIND_PROGRAM(IDL idl DOC "Location of the idl executable"
@@ -7,19 +12,18 @@ IF(NOT IDL)
712
MESSAGE(STATUS "-- idl is " ${IDL})
813
ENDIF(NOT IDL)
914

10-
if(WIN32)
11-
INCLUDE_DIRECTORIES($ENV{OMDEV}/tools/rml/include/plain)
12-
else(WIN32)
13-
INCLUDE_DIRECTORIES(${RMLHOME}/include/plain)
14-
endif(WIN32)
15-
INCLUDE_DIRECTORIES(${CODEGENDIR})
16-
INCLUDE_DIRECTORIES(${CODEGENDIR}/absyn_builder)
15+
if(MSVC)
16+
add_definitions(-DOMC_NO_THREADS -D_CRT_SECURE_NO_WARNINGS)
17+
endif(MSVC)
1718
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR})
1819
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/lpsolve)
19-
INCLUDE_DIRECTORIES(${OMCTRUNCHOME}/c_runtime)
20-
20+
INCLUDE_DIRECTORIES(${OMCTRUNCHOME}/SimulationRuntime/c)
21+
INCLUDE_DIRECTORIES(${OMCTRUNCHOME}/SimulationRuntime/c/meta)
22+
INCLUDE_DIRECTORIES(${OMCTRUNCHOME}/SimulationRuntime/c/util)
23+
INCLUDE_DIRECTORIES(${OMCTRUNCHOME}/3rdParty/gc/include)
2124

2225
# custom command for idl
26+
IF(IDL)
2327
SET(IDL_OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/omc_communication.cc ${CMAKE_CURRENT_BINARY_DIR}/omc_communication.h)
2428
ADD_CUSTOM_COMMAND(OUTPUT ${IDL_OUTPUT}
2529
COMMAND ${IDL} ${CMAKE_CURRENT_SOURCE_DIR}/omc_communication.idl
@@ -28,10 +32,11 @@ ADD_CUSTOM_COMMAND(OUTPUT ${IDL_OUTPUT}
2832

2933
# target fuer OM_OUTPUT
3034
ADD_CUSTOM_TARGET(omc_communication ALL DEPENDS ${IDL_OUTPUT})
35+
ENDIF(IDL)
3136

3237
# Quellen und Header
3338
SET(CORBASRC ${IDL_OUTPUT} omc_communication_impl.cpp corbaimpl.cpp)
34-
SET(SRC socketimpl.c printimpl.c systemimpl.c settingsimpl.c SimulationResults.c)
39+
SET(SRC socketimpl.c printimpl.c systemimpl.c settingsimpl.c SimulationResults.c)
3540
SET(CPPSRC unitparser.cpp unitparserext.cpp ptolemyio.cpp Dynload.cpp BackendDAEEXT.cpp ErrorMessage.cpp errorext.cpp
3641
systemimplmisc.cpp ${CORBASRC} serializer.cpp)
3742
SET(OBJ ${SRC} ${CPPSRC})
@@ -46,5 +51,6 @@ link_directories(${OMCTRUNCHOME}/Compiler/runtime/lpsolve/lib/win32)
4651
# Library runtime
4752
ADD_LIBRARY(runtime ${OBJ})
4853
TARGET_LINK_LIBRARIES(runtime sendData c_runtime ${platform_libs} optimized lpsolve55 debug lpsolve55d)
54+
IF(MOCH_codegen_ALL)
4955
add_dependencies(runtime ${MOCH_codegen_ALL})
50-
56+
ENDIF(MOCH_codegen_ALL)

Compiler/runtime/printimpl.c

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,6 @@ typedef struct print_members_s {
5757
long* savedNfilled;
5858
} print_members;
5959

60-
#include <pthread.h>
61-
62-
pthread_once_t printimpl_once_create_key = PTHREAD_ONCE_INIT;
63-
pthread_key_t printimplKey;
64-
6560
static void free_printimpl(void *data)
6661
{
6762
int i;
@@ -83,19 +78,31 @@ static void free_printimpl(void *data)
8378
free(members);
8479
}
8580

81+
#if !defined(OMC_NO_THREADS)
82+
#include <pthread.h>
83+
84+
pthread_once_t printimpl_once_create_key = PTHREAD_ONCE_INIT;
85+
pthread_key_t printimplKey;
86+
8687
static void make_key()
8788
{
8889
pthread_key_create(&printimplKey,free_printimpl);
8990
}
91+
#endif
9092

9193
static print_members* getMembers(threadData_t *threadData)
9294
{
93-
print_members *res;
95+
#if defined(OMC_NO_THREADS)
96+
static
97+
#endif
98+
print_members *res = NULL;
9499
if (threadData && threadData->localRoots[LOCAL_ROOT_PRINT_MO]) {
95100
return threadData->localRoots[LOCAL_ROOT_PRINT_MO];
96101
}
102+
#if !defined(OMC_NO_THREADS)
97103
pthread_once(&printimpl_once_create_key,make_key);
98104
res = (print_members*) pthread_getspecific(printimplKey);
105+
#endif
99106
if (res != NULL) return res;
100107
res = (print_members*) calloc(1,sizeof(print_members));
101108
pthread_setspecific(printimplKey,res);

Compiler/runtime/socketimpl.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
#include <winsock2.h>
3636
#include <ws2tcpip.h>
3737

38-
#include <unistd.h>
3938
#include <errno.h>
4039
#include <io.h>
4140

@@ -81,7 +80,6 @@ fsync (int fd)
8180

8281
#include <string.h>
8382
#include <stdlib.h>
84-
#include <unistd.h>
8583
#include <errno.h>
8684
#include "errorext.h"
8785

Makefile.common

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
inclu.PHONY : all omc release clean .testvariables mkbuilddirs
1+
inclu.PHONY : all omc release clean .testvariables mkbuilddirs checkMSVCwine
22

33
unexport PREFIX
44

Makefile.in

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,3 +132,85 @@ emcc-simulationruntime:
132132
$(MAKE) -C SimulationRuntime/c emcc
133133

134134
copycppheader:
135+
136+
OMDEV_CMAKE="$(OMDEV)/bin/cmake/bin/cmake.exe"
137+
138+
checkMSVCwine:
139+
@echo 'Test for WINE, OMDEV, VS140COMNTOOLS env.vars'
140+
test ! -z "$(WINE)"
141+
test ! -z "$(OMDEV)"
142+
test ! -z "$(VS140COMNTOOLS)"
143+
"$(WINE)" cl.exe
144+
"$(WINE)" cmd /c "if not exist $(OMDEV_CMAKE) (exit 1)"
145+
146+
wine_fmil_msvc: .wine_fmil_msvc
147+
.wine_fmil_msvc: checkMSVCwine
148+
rm -f $(OMBUILDDIR)/lib/omc/msvc/fmil*
149+
mkdir -p $(OMBUILDDIR)/lib/omc/msvc/
150+
# Goto build msvc directory
151+
test -d 3rdParty/FMIL
152+
153+
(test -f $@ && test -d 3rdParty/FMIL/build_msvc && test -d 3rdParty/FMIL/install_msvc) || (rm -rf 3rdParty/FMIL/build_msvc && rm -rf 3rdParty/FMIL/install_msvc && mkdir -p 3rdParty/FMIL/build_msvc && cd 3rdParty/FMIL/build_msvc && "$(WINE)" "$(OMDEV_CMAKE)" -DCMAKE_VERBOSE_MAKEFILE:Bool=ON -DFMILIB_BUILD_TESTS=OFF -DFMILIB_BUILD_STATIC_LIB=OFF -DCMAKE_BUILD_TYPE=RelWithDebInfo -DFMILIB_INSTALL_PREFIX=../install_msvc ../ -G "NMake Makefiles" && $(WINE) nmake /f Makefile install)
154+
155+
(cp -puf 3rdParty/FMIL/install_msvc/lib/fmilib_shared.dll $(OMBUILDDIR)/lib/omc/msvc/fmilib.dll)
156+
(cp -puf 3rdParty/FMIL/install_msvc/lib/fmilib_shared.lib $(OMBUILDDIR)/lib/omc/msvc/fmilib.lib)
157+
# copy the dll with the actual name: fmilib_shared.dll as the fmilib.lib contains that name and the exe will look for it
158+
(cp -puf 3rdParty/FMIL/install_msvc/lib/fmilib_shared.dll $(OMBUILDDIR)/lib/omc/msvc/fmilib_shared.dll)
159+
(cp -puf 3rdParty/FMIL/install_msvc/lib/fmilib_shared.lib $(OMBUILDDIR)/lib/omc/msvc/fmilib_shared.lib)
160+
@touch $@
161+
162+
wine_sundials_msvc: .wine_sundials_msvc
163+
.wine_sundials_msvc: checkMSVCwine
164+
rm -f $(OMBUILDDIR)/lib/omc/msvc/sundials*
165+
mkdir -p $(OMBUILDDIR)/lib/omc/msvc/
166+
# Goto build msvc directory
167+
test -d 3rdParty/sundials
168+
169+
(test -f $@ && test -d 3rdParty/sundials/build_msvc) || (rm -rf 3rdParty/sundials/build_msvc && mkdir -p 3rdParty/sundials/build_msvc && cd 3rdParty/sundials/build_msvc && "$(WINE)" "$(OMDEV_CMAKE)" -DCMAKE_VERBOSE_MAKEFILE:Bool=ON -DBUILD_STATIC_LIBS=OFF -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=. ../ -G "NMake Makefiles" && $(WINE) nmake /f Makefile install)
170+
mkdir -p $(OMBUILDDIR)/include/omc/msvc/sundials
171+
(cp -pufr 3rdParty/sundials/build_msvc/include/* $(OMBUILDDIR)/include/omc/msvc/sundials)
172+
(cp -puf 3rdParty/sundials/build_msvc/lib/* $(OMBUILDDIR)/lib/omc/msvc/)
173+
@touch $@
174+
175+
wine_runc_msvc_release: .wine_runc_msvc_release
176+
.wine_runc_msvc_release: mkbuilddirs checkMSVCwine wine_sundials_msvc wine_fmil_msvc wine_runc_msvc_gc
177+
mkdir -p $(OMBUILDDIR)/include/omc/msvc/
178+
mkdir -p $(OMBUILDDIR)/lib/omc/msvc/release
179+
echo 'Build the MSVC RELEASE'
180+
181+
(test -f $@ && test -d SimulationRuntime/c/build_msvc/) || (rm -rf SimulationRuntime/c/build_msvc && mkdir -p SimulationRuntime/c/build_msvc && cd SimulationRuntime/c/build_msvc && "$(WINE)" "$(OMDEV_CMAKE)" -DCMAKE_VERBOSE_MAKEFILE:Bool=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX:String=$(OMBUILDDIR) ../ -G "NMake Makefiles" && "$(WINE)" nmake /f Makefile)
182+
@echo 'Copy the .lib files (needed for compilation) and .pdb files (needed for debugging) to $(OMBUILDDIR)/lib/omc'
183+
(cd SimulationRuntime/c/build_msvc && find . -type f -path "*.lib" -exec cp {} $(OMBUILDDIR)/lib/omc/msvc/release/. \;)
184+
(cd SimulationRuntime/c/build_msvc && find . -type f -path "*.pdb" -exec cp {} $(OMBUILDDIR)/lib/omc/msvc/release/. \;)
185+
@touch $@
186+
187+
wine_runc_msvc_debug: .wine_runc_msvc_debug
188+
.wine_runc_msvc_debug: mkbuilddirs checkMSVCwine wine_sundials_msvc wine_fmil_msvc wine_runc_msvc_gc
189+
mkdir -p $(OMBUILDDIR)/include/omc/msvc/
190+
mkdir -p $(OMBUILDDIR)/lib/omc/msvc/debug
191+
echo 'Build the MSVC DEBUG'
192+
193+
(test -f $@ && test -d SimulationRuntime/c/build_msvc_debug/) || (rm -rf SimulationRuntime/c/build_msvc_debug && mkdir -p SimulationRuntime/c/build_msvc_debug && cd SimulationRuntime/c/build_msvc && "$(WINE)" "$(OMDEV_CMAKE)" -DCMAKE_VERBOSE_MAKEFILE:Bool=ON -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX:String=$(OMBUILDDIR) ../ -G "NMake Makefiles" && "$(WINE)" nmake /f Makefile)
194+
@echo 'Copy the .lib files (needed for compilation) and .pdb files (needed for debugging) to $(OMBUILDDIR)/lib/omc'
195+
(cd SimulationRuntime/c/build_msvc_debug && find . -type f -path "*.lib" -exec cp {} $(OMBUILDDIR)/lib/omc/msvc/debug/. \;)
196+
(cd SimulationRuntime/c/build_msvc_debug && find . -type f -path "*.pdb" -exec cp {} $(OMBUILDDIR)/lib/omc/msvc/debug/. \;)
197+
@touch $@
198+
199+
wine_runc_msvc_gc: .wine_runc_msvc_gc
200+
.wine_runc_msvc_gc: mkbuilddirs checkMSVCwine
201+
# build gc as well, as it is needed for the msvc c runtime
202+
@echo 'Build gc (RelWithDebInfo)'
203+
204+
(test -f $@ && test -d 3rdParty/gc/build_msvc/) || (rm -rf 3rdParty/gc/build_msvc/ && mkdir -p 3rdParty/gc/build_msvc && cd 3rdParty/gc/build_msvc && "$(WINE)" "$(OMDEV_CMAKE)" -DCMAKE_BUILD_TYPE=RelWithDebInfo ../ -G "NMake Makefiles" && "$(WINE)" nmake /f Makefile)
205+
@echo 'Copy the .lib files (needed for compilation) and .pdb files (needed for debugging) to $(OMBUILDDIR)/lib/omc/msvc/'
206+
cp -u 3rdParty/gc/build_msvc/gc-lib.* $(OMBUILDDIR)/lib/omc/msvc/
207+
@touch $@
208+
209+
wine_run_omc_msvc: .wine_run_omc_msvc
210+
.wine_run_omc_msvc: checkMSVCwine
211+
@echo 'Build MSVC Compiler/runtime (RelWithDebInfo)'
212+
213+
(test -f $@ && test -d Compiler/runtime/build_msvc/) || (rm -rf Compiler/runtime/build_msvc/ && mkdir -p Compiler/runtime/build_msvc && cd Compiler/runtime/build_msvc && "$(WINE)" "$(OMDEV_CMAKE)" -DCMAKE_BUILD_TYPE=RelWithDebInfo ../ -G "NMake Makefiles" && "$(WINE)" nmake /f Makefile)
214+
@echo 'Copy the .lib files (needed for compilation) and .pdb files (needed for debugging) to $(OMBUILDDIR)/lib/omc/msvc/'
215+
# cp -u Compiler/runtime/build_msvc/gc-lib.* $(OMBUILDDIR)/lib/omc/msvc/
216+
@touch $@

SimulationRuntime/c/CMakeLists.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,10 @@ IF(SUNDIALS_INCLUDE_DIR)
6060

6161
SET(SUNDIALS_LIBRARIES ${SUNDIALS_LIBRARY_CVODE} ${SUNDIALS_LIBRARY_IDA} ${SUNDIALS_LIBRARY_NVEC} ${SUNDIALS_KINSOL})
6262

63-
ENDIF(SUNDIALS_LIBRARY_CVODE AND
64-
SUNDIALS_LIBRARY_IDA AND
65-
SUNDIALS_LIBRARY_NVEC AND
66-
SUNDIALS_KINSOL)
63+
ENDIF(SUNDIALS_LIBRARY_CVODE AND
64+
SUNDIALS_LIBRARY_IDA AND
65+
SUNDIALS_LIBRARY_NVEC AND
66+
SUNDIALS_KINSOL)
6767

6868
ENDIF(SUNDIALS_INCLUDE_DIR)
6969

SimulationRuntime/c/gc/omc_gc.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ extern "C" {
5151

5252
#if defined(_MSC_VER)
5353
#include "omc_inline.h"
54-
#include "omc_msvc.h"
54+
#include "util/omc_msvc.h"
5555
#endif
5656

5757
typedef struct {
@@ -180,8 +180,10 @@ static inline void* mmc_check_out_of_memory(void *ptr)
180180

181181
#include <gc.h>
182182
/* gc.h doesn't include this by default; and the actual header redirects dlopen, which does not have an implementation */
183+
#if !defined(OMC_NO_THREADS)
183184
int GC_pthread_create(pthread_t *,const pthread_attr_t *,void *(*)(void *), void *);
184185
int GC_pthread_join(pthread_t, void **);
186+
#endif
185187

186188
void omc_GC_set_max_heap_size(size_t);
187189
size_t omc_GC_get_max_heap_size();

0 commit comments

Comments
 (0)