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

Commit

Permalink
added windows makefile flags to build cpp runtime with Klu and trilinos
Browse files Browse the repository at this point in the history
   make runtimeCPPinstall  USE_KLU="true"   USE_TRILINOS="true"
   for trilions the 3rdparty packages has to be build before with
     make -f Makefile.omdev.mingw nox on windows
  • Loading branch information
niklwors authored and OpenModelica-Hudson committed Mar 20, 2017
1 parent 6deba45 commit 59a2173
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 10 deletions.
29 changes: 29 additions & 0 deletions Makefile.omdev.mingw
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,35 @@ sundials_msvc: getMSVCversion 3rdParty/sundials/CMakeLists.txt
(cp -puf 3rdParty/sundials/build_msvc/lib/* $(OMBUILDDIR)/lib/omc/msvc/)
(cp -puf 3rdParty/sundials/build_msvc/lib/*.dll $(OMBUILDDIR)/bin)

# build trilinos nox
nox_msvc: getMSVCversion 3rdParty/trilinos-nox/CMakeLists.txt
rm -f $(OMBUILDDIR)/lib/omc/msvc/nox*
rm -f $(OMBUILDDIR)/bin/nox*
#rm -rf 3rdParty/trilinos-nox/build_msvc
mkdir -p $(OMBUILDDIR)/lib/omc/msvc/
# Goto build msvc directory
test -d 3rdParty/trilinos-nox
mkdir -p 3rdParty/trilinos-nox/build_msvc

# Create batch file, that builds with CMake and Visual Studio
test -f """${VSCOMNTOOLS}/../../VC/vcvarsall.bat"""
echo 'Building trilinos-nox with MSVC'
echo @echo on > 3rdParty/trilinos-nox/build_msvc/build.bat
echo call '"${VSCOMNTOOLS}\\..\\..\\VC\\vcvarsall.bat"' >> 3rdParty/trilinos-nox/build_msvc/build.bat
echo echo Calling CMake >> 3rdParty/trilinos-nox/build_msvc/build.bat
echo '%OMDEV%\\bin\\cmake\\bin\\cmake -DCMAKE_VERBOSE_MAKEFILE:Bool=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=. ../ -G "NMake Makefiles" -DOMDEV_DIR="$(OMDEVMSYS) ' >> 3rdParty/trilinos-nox/build_msvc/build.bat
echo echo Building trilinos-nox >> 3rdParty/trilinos-nox/build_msvc/build.bat
echo @echo on >> 3rdParty/trilinos-nox/build_msvc/build.bat
echo set MAKE= >> 3rdParty/trilinos-nox/build_msvc/build.bat
echo set MAKEFLAGS= >> 3rdParty/trilinos-nox/build_msvc/build.bat
echo nmake /f Makefile install >> 3rdParty/trilinos-nox/build_msvc/build.bat

# Change into directory and run batch file
cd ./3rdParty/trilinos-nox/build_msvc; echo "change to 3rdParty/trilinos-nox/build_msvc";\
cmd /c build.bat



runtimeCPPmsvcinstall: mkbuilddirs CMinpack_msvc Umfpack_msvc sundials_msvc copycppmsvcheader
$(MAKE) -C SimulationRuntime/cpp/ -f Makefile.omdev.mingw runtimeCPPmsvc OMBUILDDIR=$(OMBUILDDIR)
cp -p $(BOOST_PATH_MSVC)/lib/*vc*.dll $(OMBUILDDIR)/bin/
Expand Down
7 changes: 4 additions & 3 deletions SimulationRuntime/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
# if the equation systems of a FMU should be solved with sundials solvers -DFMU_SUNDIALS=ON [default: OFF]
# if the logger should be completely disabled or used -DUSE_LOGGER=OFF [default: ON]
# specify target platform for compilation -DPLATFORM=<dynamic, static or platform triple> [default: "dynamic"]
#
# use Klu sparse liner solver -DUSE_KLU [default: OFF]
# use NOX non linear solver from trilinos library -DUSE_TRILINOS [default: OFF]
# Example: "cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo" to create statically linked libraries
#
# The used defines are stored in the SYSTEM_CFLAGS variable, which is passed to the ModelicaConfig.inc and written in the PrecompiledHeader.cmake
Expand Down Expand Up @@ -144,8 +145,8 @@ SET(FMUName ${LIBPREFIX}FMU${LIBSUFFIX})
SET(DgesvName ${LIBPREFIX}Dgesv) # only static version

SET(USE_MICO OFF)
SET(USE_KLU OFF)
SET(USE_TRILINOS OFF)
SET(USE_KLU CACHE BOOL OFF)
SET(USE_TRILINOS CACHE BOOL OFF)
SET(REDUCE_DAE OFF)
IF(NOT FMU_TARGET OR FMU_SUNDIALS)
SET(USE_SUNDIALS ON)
Expand Down
26 changes: 20 additions & 6 deletions SimulationRuntime/cpp/Makefile.omdev.mingw
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@ ifeq ($(BUILDTYPE),)
BUILDTYPE=Debug
endif

ifeq ($(BUILDTYPE),)
BUILDTYPE=Debug
endif


ifeq (MINGW32,$(findstring MINGW32,$(shell uname)))
IS_MINGW32 = -DIS_MINGW32=ON
Expand Down Expand Up @@ -84,11 +82,27 @@ endif

USE_LOGGER="false"
ifeq ("$(USE_LOGGER)","true")
USE_LOGGER_COMMAND=-DUSE_LOGGER=ON
USE_LOGGER_COMMAND=-DUSE_LOGGER:BOOL=ON
else
USE_LOGGER_COMMAND=-DUSE_LOGGER:BOOL=OFF
endif

USE_TRILINOS="false"
ifeq ("$(USE_TRILINOS)","true")
USE_TRILINOS_COMMAND=-DUSE_TRILINOS:BOOL=ON
else
USE_LOGGER_COMMAND=-DUSE_LOGGER=OFF
USE_TRILINOS_COMMAND=-DUSE_TRILINOS:BOOL=OFF
endif

USE_KLU="false"
ifeq ("$(USE_KLU)","true")
USE_KLU_COMMAND=-DUSE_KLU:BOOL=ON
else
USE_KLU_COMMAND=-DUSE_KLU:BOOL=OFF
endif



getMSVCversion:
echo "Check for given VSVERSION (2010|2012|2013|2015) version: [VSVERSION=$(VSVERSION)]"
ifeq ("$(VSVERSION)","")
Expand Down Expand Up @@ -129,7 +143,7 @@ endif
endif
endif

CMAKE_FLAGS=-DCMAKE_BUILD_TYPE=$(BUILDTYPE) $(BOOST_STATIC_LINKING_COMMAND) $(BOOST_REALPATHS_COMMAND) $(RUNTIME_PROFILING_COMMAND) $(USE_SCOREP_COMMAND) $(SCOREP_HOME_COMMAND) $(FMU_SUNDIALS_COMMAND) $(PARALLEL_OUTPUT_COMMAND) $(USE_LOGGER_COMMAND)
CMAKE_FLAGS=-DCMAKE_BUILD_TYPE=$(BUILDTYPE) $(BOOST_STATIC_LINKING_COMMAND) $(BOOST_REALPATHS_COMMAND) $(RUNTIME_PROFILING_COMMAND) $(USE_SCOREP_COMMAND) $(SCOREP_HOME_COMMAND) $(FMU_SUNDIALS_COMMAND) $(PARALLEL_OUTPUT_COMMAND) $(USE_LOGGER_COMMAND) $(USE_TRILINOS_COMMAND) $(USE_KLU_COMMAND)

runtimeCpp:
$(foreach PLATFORM, $(PLATFORMS), \
Expand Down
5 changes: 4 additions & 1 deletion SimulationRuntime/cpp/README
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ to configure. The following arguments are available at the moment:
USE_LOGGER
BUILDTYPE
CPP_03
USE_TRILINOS
USE_KLU

e.g.: configure --with-cppruntime --with-cppruntime-args=BUILDTYPE=Debug,RUNTIME_PROFILING,CPP_03

Expand All @@ -61,7 +63,8 @@ because not all libraries are available on both systems.
PARALLEL_OUTPUT="true"
USE_LOGGER="false"
BUILDTYPE=[Release,Debug]

USE_TRILINOS=["true","false"]
USE_KLU=["true","false"]
e.g.: make -f Makefile.omdev.mingw runtimeCPPmsvcinstall BOOST_STATIC_LINKING="true" USE_LOGGER="false"

For further details, see the description below.
Expand Down

0 comments on commit 59a2173

Please sign in to comment.