Skip to content

Commit

Permalink
bugfix CodegenCpp: OmCpp was added twice for mixed systems, Compile c…
Browse files Browse the repository at this point in the history
…minpack

git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@18574 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
Christian SChubert committed Jan 7, 2014
1 parent a32d4f9 commit 617a563
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Compiler/Template/CodegenCpp.tpl
Expand Up @@ -5028,7 +5028,7 @@ template algloopcppfilenames2(SimEqSystem eq, Context context, Text &varDecls, S
case e as SES_MIXED(cont = eq_sys)
then
<<
OMCpp<%algloopcppfilenames2(eq_sys,context,varDecls,simCode)%>
<%algloopcppfilenames2(eq_sys,context,varDecls,simCode)%>
>>
else
""
Expand Down
18 changes: 15 additions & 3 deletions Makefile.common
Expand Up @@ -22,7 +22,7 @@ INSTALL_MANDIR = ${DESTDIR}${datadir}/man/
INSTALL_JAVADIR = ${DESTDIR}${datadir}/omc/java
INSTALL_LOCALEDIR = ${DESTDIR}${datadir}/locale

.PHONY : interactive omc release qtclients mosh all mkbuilddirs fmi test install-dirs susan susan_all susgen sustst install-python install-openturns runtimeCPPinstall boehm-gc
.PHONY : interactive omc release qtclients mosh all mkbuilddirs fmi test install-dirs susan susan_all susgen sustst install-python install-openturns runtimeCPPinstall CMinpack boehm-gc

mkbuilddirs:
if [ "$(APP)" = ".app" ]; then mkdir -p $(builddir_app); fi
Expand Down Expand Up @@ -138,10 +138,10 @@ breakprocess:
(cd testsuite/openmodelica/bootstrapping && time g++ BreakProcess.cpp -o BreakProcess -static-libgcc)
(cd testsuite/openmodelica/bootstrapping && cp BreakProcess.exe ../../../$(builddir_bin)/)

runtimeCPP:
runtimeCPP: CMinpack
$(MAKE) -C SimulationRuntime/cpp/ -f $(defaultMakefileTarget)

runtimeCPPinstall:
runtimeCPPinstall: CMinpack
$(MAKE) -C SimulationRuntime/cpp/ -f $(defaultMakefileTarget) install
test ! `uname` = Darwin || install_name_tool -id @rpath/cpp/libOMCppCVode.dylib build/lib/omc/cpp/libOMCppCVode.dylib
test ! `uname` = Darwin || install_name_tool -id @rpath/cpp/libOMCppDataExchange.dylib build/lib/omc/cpp/libOMCppDataExchange.dylib
Expand Down Expand Up @@ -179,6 +179,18 @@ fmil:
#TODO: Only copy required headers, add them in omc/fmi subfolder, and do not copy c/txt-files
#cp -rp 3rdParty/FMIL/install/include/* $(builddir_inc)

CMinpack:
test -d 3rdParty/CMinpack
mkdir -p 3rdParty/CMinpack/build
(cd 3rdParty/CMinpack/build && test -f Makefile || CC="$(CC)" CXX="$(CXX)" CFLAGS="$(CFLAGS)" CPPFLAGS="$(CPPFLAGS)" $(CMAKE) -D CMAKE_AR:String="$(AR)" -DCMAKE_COLOR_MAKEFILE:Bool=OFF -DCMAKE_INSTALL_PREFIX:String=../install .. -G $(CMAKE_TARGET))
test -f 3rdParty/CMinpack/build/install/lib/$(LIBCMINPACKLIB) || $(MAKE) -C 3rdParty/CMinpack/build
test -d 3rdParty/CMinpack/install || $(MAKE) -C 3rdParty/CMinpack/build install
#test "(" ! `uname` = Darwin ")" -o "(" ! -f 3rdParty/CMinpack/build/libfmilib_shared$(SHREXT) ")" || install_name_tool -id @rpath/libfmilib_shared$(SHREXT) 3rdParty/CMinpack/build/libfmilib_shared$(SHREXT)
#cp -pPR 3rdParty/CMinpack/build/install/$(LIBCMINPACKLIB) $(builddir_lib)/omc/
#test ! -f build/lib/omc/libfmilib_shared$(SHREXT) || ln -sf libfmilib_shared$(SHREXT) build/lib/omc/libfmilib$(SHREXT)
#TODO: Only copy required headers, add them in omc/fmi subfolder, and do not copy c/txt-files
#cp -rp 3rdParty/CMinpack/install/include/* $(builddir_inc)

testfast: test

test:
Expand Down
3 changes: 3 additions & 0 deletions Makefile.in
Expand Up @@ -30,6 +30,9 @@ LINK=@LINK@
MSL_EXTRA_ARGS=@MSL_EXTRA_ARGS@
GC_THREADS=--enable-threads=posix
LIBFMILIB=@LIBFMILIB@
# This should probably have an @ around it
# @Martin: Can you fix this, please?
LIBCMINPACKLIB=libcminpack.a
LD_LAPACK=@LD_LAPACK@
LAPACK_TARGET=@LAPACK_TARGET@
OPENBLAS_EXTRA_ARGS=@OPENBLAS_EXTRA_ARGS@
Expand Down
16 changes: 12 additions & 4 deletions SimulationRuntime/cpp/CMakeLists.txt
Expand Up @@ -10,10 +10,18 @@ SET(BLAS_DIRY "$ENV{OMDEV}/lib/3rdParty/Lapack/Lib/" CACHE LOCATION "where was y

########################################
# TEST
#SET(MINPACK_LIBRARIES "$ENV{OMDEV}/lib/3rdParty/Minpack/lib/minpack_mt_vc100.lib")
#include_directories ("$ENV{OMDEV}/lib/3rdParty/Minpack/include/")

FIND_PATH(CMINPACK_INCLUDE_DIR cminpack.h
HINTS "${CMAKE_SOURCE_DIR}/../../3rdParty/CMinpack/install"
PATH_SUFFIXES include include/cminpack include/cminpack-1)

FIND_LIBRARY(CMINPACK_LIBRARY
NAMES cminpack
HINTS "${CMAKE_SOURCE_DIR}/../../3rdParty/CMinpack/install"
PATH_SUFFIXES lib lib64)

#include_directories(CMINPACK_INCLUDE_DIR)
# END TEST

########################################

# Disable Optimization for RelWithDebInfo on Windows
Expand Down Expand Up @@ -139,7 +147,7 @@ include_directories (${Boost_INCLUDE_DIR})
include_directories ("${PROJECT_SOURCE_DIR}")
include_directories ("${PROJECT_BINARY_DIR}")

message(STATUS "Boost dirs "${Boost_LIBRARY_DIRS} " , " ${Boost_INCLUDE_DIR})
message(STATUS "Boost dirs '${Boost_LIBRARY_DIRS}', '${Boost_INCLUDE_DIR}'")

#build of simulation.core
include_directories ("Include")
Expand Down

0 comments on commit 617a563

Please sign in to comment.