Skip to content

Commit 36b9fbe

Browse files
author
Marcus Walther
committed
- fixed C++ MinGW FMU export on Windows (the libgcc-dll is now copied to build/bin, lapack and blas are embedded into the FMU)
1 parent fe43efb commit 36b9fbe

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

Compiler/Template/CodegenFMUCpp.tpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -697,7 +697,7 @@ case SIMCODE(modelInfo=MODELINFO(__), makefileParams=MAKEFILE_PARAMS(__), simula
697697
let modelName = if isFMIVersion10(FMUVersion) then fileNamePrefix else dotPath(modelInfo.name)
698698
let platformstr = match makefileParams.platform case "i386-pc-linux" then 'linux32' case "x86_64-linux" then 'linux64' else '<%makefileParams.platform%>'
699699
let omhome = makefileParams.omhome
700-
let platformbins = match platformstr case "win32" then '"<%omhome%>/bin/libgcc_s_dw2-1.dll"' else ''
700+
let platformbins = match platformstr case "win32" then '"<%omhome%>/bin/libgcc_s_dw2-1.dll" "<%omhome%>/bin/lapack_win32.DLL" "<%omhome%>/bin/blas_win32.DLL"' else ''
701701
let mkdir = match makefileParams.platform case "win32" then '"mkdir.exe"' else 'mkdir'
702702
<<
703703
# Makefile generated by OpenModelica
@@ -734,7 +734,7 @@ case SIMCODE(modelInfo=MODELINFO(__), makefileParams=MAKEFILE_PARAMS(__), simula
734734

735735
CPPFLAGS=$(CFLAGS)
736736

737-
OMCPP_LIBS=-lOMCppSystem_FMU_static -lOMCppMath_static -lOMCppExtensionUtilities_static -lOMCppModelicaUtilities_static -lOMCppFMU_static $(OMCPP_SOLVER_LIBS)
737+
OMCPP_LIBS=-lOMCppSystem_FMU_static -lOMCppMath_static -lOMCppModelicaUtilities_static -lOMCppFMU_static $(OMCPP_SOLVER_LIBS) -lOMCppExtensionUtilities_static
738738

739739
MODELICA_EXTERNAL_LIBS=-lModelicaExternalC -lModelicaStandardTables -L$(LAPACK_LIBS) $(LAPACK_LIBRARIES)
740740
LIBS=$(OMCPP_LIBS) $(MODELICA_EXTERNAL_LIBS) $(BASE_LIB)

Makefile.omdev.mingw

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ omdev_extra_dlls: install-openturns
161161
echo Copying needed .dlls to the $(OMBUILDDIR)/bin directory
162162
(cp -puf $(OMDEV)/tools/mingw/bin/libintl-8.dll $(builddir_bin)/)
163163
(cp -puf $(OMDEV)/tools/mingw/bin/libiconv-2.dll $(builddir_bin)/)
164+
(cp -puf $(OMDEV)/tools/mingw/bin/libgcc_s_dw2-1.dll $(builddir_bin)/)
164165
(cp -puf $(OMDEV)/lib/omniORB-4.1.6-msvc-10/bin/x86_win32/omniORB416_vc10_rt.dll $(builddir_bin)/)
165166
(cp -puf $(OMDEV)/lib/omniORB-4.1.6-msvc-10/bin/x86_win32/omnithread34_vc10_rt.dll $(builddir_bin)/)
166167
(cp -puf $(OMDEV)/lib/pthread/pthreadGC2.dll $(builddir_bin)/)

SimulationRuntime/cpp/Include/Solver/Newton/Newton.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,11 @@
55

66
#pragma once
77

8-
#include "FactoryExport.h"
9-
108
#include <Core/System/IAlgLoop.h> // Interface to AlgLoo
119
#include <Core/Solver/IAlgLoopSolver.h> // Export function from dll
1210
#include <Core/Solver/INonLinSolverSettings.h>
1311
#include <Solver/Newton/NewtonSettings.h>
1412

15-
#include <Core/Utils/extension/logger.hpp>
16-
1713

1814
/*****************************************************************************/
1915
/**

SimulationRuntime/cpp/Solver/Newton/Newton.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
*/
55
#include <Core/ModelicaDefine.h>
66
#include <Core/Modelica.h>
7+
8+
#include <Solver/Newton/FactoryExport.h>
9+
#include <Core/Utils/extension/logger.hpp>
10+
711
#include <Solver/Newton/Newton.h>
812

913
#include <Core/Math/ILapack.h> // needed for solution of linear system with Lapack

0 commit comments

Comments
 (0)