Skip to content

Commit

Permalink
- put back the Windows Makefiles (Makefile.omdev.mingw)
Browse files Browse the repository at this point in the history
- fix windows build of the OMCompiler
  • Loading branch information
adrpo committed May 4, 2015
1 parent 4114344 commit 23686e6
Show file tree
Hide file tree
Showing 16 changed files with 456 additions and 7 deletions.
88 changes: 88 additions & 0 deletions Compiler/Makefile.omdev.mingw
@@ -0,0 +1,88 @@
# Adrian Pop, adrpo@ida.liu.se, 2006-02-01
# Makefile for compilation of OMC using OMDev-mingw
# OMDev-mingw: http://www.ida.liu.se/~adrpo/omc/omdev/
#
# $Id: Makefile.omdev.mingw.in 1817 2006-02-01 12:21:26Z adrpo $
#

# The path to the OMDev-mingw package MUST BE SET!
#OMDEV=$OMDEV
# Test if the needed variables are there...

.testvariables:
ifndef OMDEV
@echo You have to set the OMDEV variabile pointing to your OMDev package root! Exiting....
@echo Take the OMDev package from: http://www.ida.liu.se/~adrpo/omc/omdev/
@echo For questions or problems email Adrian Pop, adrpo@ida.liu.se
ABORT
endif

srcdir= .
top_builddir= ..
builddir_bin=$(top_builddir)/build/bin
builddir_scripts=$(top_builddir)/build/share/omc/scripts
builddir_lib=$(top_builddir)/build/lib/omc

# adrpo, libsocket should be -lwsock32 but is not needed!
LIBSOCKET = -lwsock32

SHELL = /bin/sh
CC = cc
override CFLAGS += $(USE_CORBA)

USE_CORBA = -DUSE_CORBA
CORBAHOME = $(OMDEV)

SCRIPT_FILES = Compile.bat openmodelica.lefty default_profiling.xsl replace-startValue.* simcodedump.xsl ngspicetoModelica.py

SUBDIRS = runtime Script

.SUFFIXES:
.SUFFIXES: .o .mo .h
.PHONY: all subdirs report vctarget release clean test reallyclean builtin

all : .testvariables release simcode builtin

include Makefile.common

release: .testvariables install

install_scripts:
cd scripts; cp -puf $(SCRIPT_FILES) ../$(builddir_scripts)

install: install_scripts # install_doc
cp OpenModelicaBootstrappingHeader.h $(top_builddir)/build/include/omc/

clean:
@for d in $(SUBDIRS); do \
(cd $$d ; $(MAKE) -f Makefile.omdev.mingw clean) \
done
-cd $(builddir_bin) && rm -f $(SCRIPT_FILES)

reallyclean:
@for d in $(SUBDIRS); do \
(cd $$d ; $(MAKE) -f Makefile.omdev.mingw reallyclean) \
done

report:
@(cd report ; $(MAKE))

ifeq ($(wildcard ../build/bin/omc.exe),)
simcode:
@echo OpenModelica has not been compiled yet. Using previously generated SimCode files.
else
simcode: OpenModelicaBootstrappingHeader.h
$(MAKE) -C Template/ -f Makefile.omdev.mingw
OpenModelicaBootstrappingHeader.h: FrontEnd/Absyn.mo Script/GlobalScript.mo FrontEnd/Values.mo Util/Error.mo Util/Util.mo Util/FMI.mo GenerateOMCHeader.mos
../build/bin/omc +g=MetaModelica GenerateOMCHeader.mos > $@.log || (cat $@.log && false)
@mv $@.new $@
endif
$(SUSANMO): simcode

builtin:
cp FrontEnd/ModelicaBuiltin.mo FrontEnd/MetaModelicaBuiltin.mo $(builddir_lib)

#.PRECIOUS: Makefile.omdev.mingw
#
#Makefile.omdev.mingw: Makefile.omdev.mingw.in
# $(top_builddir)/config.status Makefile.omdev.mingw
3 changes: 3 additions & 0 deletions Compiler/Script/Makefile.omdev.mingw
@@ -0,0 +1,3 @@
OMC=OPENMODELICAHOME=`pwd`/../../build/ ../../build/bin/omc +d=failtrace

include Makefile.common
3 changes: 3 additions & 0 deletions Compiler/Template/Makefile.omdev.mingw
@@ -0,0 +1,3 @@
OMC=OPENMODELICAHOME=`pwd`/../../build/ ../../build/bin/omc +d=failtrace

include Makefile.common
29 changes: 29 additions & 0 deletions Compiler/boot/Makefile.omdev.mingw
@@ -0,0 +1,29 @@
CC=gcc
CXX=g++
CFLAGS=-g -falign-functions
TOP_DIR=../../
OMHOME=../../build
LDFLAGS=-L./ -lomparse -lomcruntime -L"$(OMHOME)/lib/omc" \
-lOpenModelicaRuntimeC \
-lModelicaExternalC -lm \
-lomantlr3 -lmico2313 -lregex -lwsock32 -llpsolve55 -luuid -lole32 $(GSLIB) -lws2_32 \
-lRpcrt4 -llapack-mingw -ltmglib-mingw -lblas-mingw -lf2c -fopenmp -lomcgc \
-lpthread $(FMILIB) -lshlwapi -liconv -lintl -lmetis \
-Wl,--stack,16777216,--large-address-aware,--enable-stdcall-fixup -lstdc++ -static-libgcc

FMILIB = -L$(TOP_DIR)/3rdParty/FMIL/install/lib -lfmilib
GSLIB = -L$(TOP_DIR)/3rdParty/graphstream/gs-netstream/c++/ -lnetstream
CPPFLAGS=-I"$(OMHOME)/include/omc/c" -Iinclude/ -I../../3rdParty/msgpack-0.5.8/src/ -DADD_METARECORD_DEFINITIONS=
CORBALIBS=
ULIMIT_CMD=true
SHREXT=.dll
OMC=$(OMHOME)/bin/omc.exe
RPATH=
#STATIC=static
BOOTSTRAP_OMC=../../build/bin/omc.exe
defaultMakefileTarget=Makefile.omdev.mingw
LIB_OMC=lib/omc

default: all

include Makefile.common
40 changes: 40 additions & 0 deletions Compiler/runtime/Makefile.omdev.mingw
@@ -0,0 +1,40 @@
# Adrian Pop, adrpo@ida.liu.se, 2006-02-01
# Makefile for Compiler/runtime compilation of OMC using OMDev-mingw
# OMDev-mingw: http://www.ida.liu.se/~adrpo/omc/omdev/
#
# $Id: Makefile.omdev.mingw.in 1817 2006-02-01 12:21:26Z adrpo $
#

# The path to the OMDev-mingw package MUST BE SET!
#OMDEV=$OMDEV
# Test if the needed variables are there...
.testvariables:
ifndef OMDEV
@echo You have to set the OMDEV variabile pointing to your OMDev package root! Exiting....
@echo Take the OMDev package from: http://www.ida.liu.se/~adrpo/omc/omdev/
@echo For questions or problems email Adrian Pop, adrpo@ida.liu.se
ABORT
endif

USE_CORBA = -DUSE_CORBA
USE_METIS = -DUSE_METIS
CORBAHOME = $(OMDEV)
FMIINCLUDE = ../../3rdParty/FMIL/install/include
GRAPHINCLUDE=../../3rdParty/metis-5.1.0/include
GRAPHSTREAMINCLUDE = ../../3rdParty/graphstream/gs-netstream/c++/src/
CJSONINCLUDE = ../../3rdParty/cJSON/

OMPCC = gcc -fopenmp

# We always compile with corba on OMDev-mingw
CORBAINCL = -I$(CORBAHOME)/include/mico-msys-mingw/
OMCCORBASRC = omc_communication.o omc_communication_impl.o Corba_omc.o

SHELL = /bin/sh
CC = gcc
CXX = g++
IDL = $(OMDEV)/bin/mico/idl
override CFLAGS += -I. $(USE_CORBA) $(USE_METIS) -DBUILD_MICO_DLL -Wall -Wno-unused-variable -I../../ -I$(top_builddir) -I$(top_builddir)/SimulationRuntime/c -I$(top_builddir)/SimulationRuntime/c/simulation/results -I$(top_builddir)/SimulationRuntime/c/util -I$(top_builddir)/SimulationRuntime/c/meta -I$(top_builddir)/SimulationRuntime/c/meta/gc -I../ $(CORBAINCL) -I$(FMIINCLUDE) -I../../3rdParty/gc/include -I$(GRAPHSTREAMINCLUDE) -I$(CJSONINCLUDE) -I$(GRAPHINCLUDE)
CXXFLAGS = $(CFLAGS)

include Makefile.common
4 changes: 2 additions & 2 deletions Makefile.common
Expand Up @@ -149,8 +149,8 @@ opencl_rt_clean:
$(MAKE) -C SimulationRuntime/ParModelica/explicit/openclrt -f $(defaultMakefileTarget) clean

breakprocess:
(cd testsuite/openmodelica/bootstrapping && time g++ BreakProcess.cpp -o BreakProcess -static-libgcc)
(cd testsuite/openmodelica/bootstrapping && cp BreakProcess.exe ../../../$(builddir_bin)/)
(cd tools/debugging/ && time g++ BreakProcess.cpp -o BreakProcess -static-libgcc)
(cd tools/debugging/ && cp BreakProcess.exe ../../$(builddir_bin)/)

all-runtimeCPPinstall:
$(MAKE) mkbuilddirs
Expand Down
7 changes: 4 additions & 3 deletions Makefile.omdev.mingw
Expand Up @@ -44,6 +44,8 @@ IDLPYTHON = $(OMDEV)/lib/omniORB-4.1.6-msvc-10/bin/x86_win32/omniidl -bpython -W
IDLPYTHONTARGET = $(builddir_share)/omc/scripts/PythonInterface/OMPythonIDL/omc_communication_idl.py
IDLFILE=$(top_builddir)/Compiler/runtime/omc_communication.idl
LIB_OMC=lib/omc
LIBMODELICAEXTERNALC=build/lib/omc/libModelicaExternalC.a
LIBMODELICASTANDARDTABLES=build/lib/omc/libModelicaStandardTables.a

defaultMakefileTarget = Makefile.omdev.mingw
MAKEFILE_BOOT = LinkMain.makefile.mingw
Expand Down Expand Up @@ -173,7 +175,7 @@ copycppheader:
(cp -pufr $(BOOST_PATH)/boost/unordered build/include/omc/cpp/boost)
(cp -pufr $(BOOST_PATH)/boost/utility build/include/omc/cpp/boost)

omc: mkbuilddirs interactive docs fmil omdev_extra_dlls breakprocess opencl_rt CMinpack metis Cdaskr $(IPOPT_TARGET) graphstream
omc: mkbuilddirs interactive fmil omdev_extra_dlls breakprocess opencl_rt CMinpack metis Cdaskr $(IPOPT_TARGET) graphstream
(time $(MAKE) -f $(defaultMakefileTarget) CFLAGS="$(CFLAGS)" omc-bootstrapped)

boehm-gc-lib: build/lib/omc/libomcgc.a
Expand Down Expand Up @@ -315,9 +317,8 @@ simulationruntimecmsvc: Umfpack_msvc CMinpack_msvc fmil_msvc
rm -rf 3rdParty/gc/build_msvc/

omc-bootstrapped:
$(MAKE) -f $(defaultMakefileTarget) CFLAGS="$(CFLAGS)" bootstrap-dependencies
$(MAKE) -f $(defaultMakefileTarget) CFLAGS="$(CFLAGS)" bootstrap-dependencies sim-dependencies
$(MAKE) -f $(defaultMakefileTarget) -C Compiler/boot CFLAGS="$(CFLAGS)"
$(MAKE) -f $(defaultMakefileTarget) omlibrary CFLAGS="$(CFLAGS)"

modelica3d:
cd 3rdParty/modelica3d && mkdir -p build
Expand Down
4 changes: 2 additions & 2 deletions Parser/Makefile.common
Expand Up @@ -22,8 +22,8 @@ libomantlr3.a: $(ANTLR)/src/*.c $(ANTLR)/include/*.h $(ANTLR)/antlr3config.h
# build the library
$(CC) ${CFLAGS} ${CPPFLAGS} -c $(ANTLR)/src/*.c -I$(ANTLR)/include -I$(ANTLR)
rm -f $@
ar -ru libantlr3.a antlr3*.o
ranlib libantlr3.a
ar -ru $@ antlr3*.o
ranlib $@
rm -f antlr3*.o
libomantlr3$(SHREXT): $(ANTLR)/src/*.c $(ANTLR)/include/*.h $(ANTLR)/antlr3config.h
# build the library
Expand Down
9 changes: 9 additions & 0 deletions Parser/Makefile.omdev.mingw
@@ -0,0 +1,9 @@
CC=gcc
CXX=g++
CFLAGS=-O3 -Wall
CPPFLAGS=-I$(COMPILERHOME) $(RMLINC) -I. -I$(ANTLR) -I$(ANTLR)/include $(BUILDINC) -I../3rdParty/gc/include

OMC=../build/bin/omc.exe
LIB_OMC=lib/omc
ANTLR_LIB=libomantlr3.a
include Makefile.common
1 change: 1 addition & 0 deletions SimulationRuntime/ParModelica/Makefile.omdev.mingw
@@ -0,0 +1 @@
# TODO
27 changes: 27 additions & 0 deletions SimulationRuntime/ParModelica/auto/Makefile.omdev.mingw
@@ -0,0 +1,27 @@
BOOST_HOME = $(OMDEV)/lib/3rdParty/boost-1_49

TBB_INC = $(OMC_TBB_INC)
TBB_LIB = $(OMC_TBB_LIB)
INCDIRS = -I"../../c" -I$(TBB_INC) -I$(BOOST_HOME) -I"../pugixml-1.2/src/"

CC=gcc
CXX=g++
CFLAGS= -O3 -Wall
CPPFLAGS= -O3 -Wall

OS_SRCS = pm_win_timer.cpp

EXEEXT=.exe
DLLEXT=.dll

all: transfer

transfer: libom_pm_autort.a
$(COPY) libom_pm_autort.a $(OPENMODELICA_LIB)
mkdir -p $(PARMODELICAAUTO_INC)
$(COPY) om_pm_interface.hpp $(PARMODELICAAUTO_INC)
$(COPY) om_pm_model.hpp $(PARMODELICAAUTO_INC)

include Makefile.common


@@ -0,0 +1,23 @@
CC=gcc
CXX=g++
CFLAGS= -fPIC -O3 -Wall
CPPFLAGS=$(CFLAGS) -I. -I"../../../c"

EXEEXT=.exe
DLLEXT=.dll
OPENLC_LIB= -lOpenCL

all: transfer

transfer: libOMOCLRuntime.a
mkdir -p $(PARMODELICAEXPOCL_INC)
$(COPY) omc_ocl_interface.h $(PARMODELICAEXPOCL_INC)
$(COPY) omc_ocl_common_header.h $(PARMODELICAEXPOCL_INC)
$(COPY) omc_ocl_memory_ops.h $(PARMODELICAEXPOCL_INC)
$(COPY) libOMOCLRuntime.a $(OPENMODELICA_LIB)
$(COPY) ParModelicaBuiltin.mo $(OPENMODELICA_LIB)
$(COPY) OCLRuntimeUtil.cl $(PARMODELICAEXPOCL_INC)

include Makefile.common


34 changes: 34 additions & 0 deletions SimulationRuntime/c/Makefile.omdev.mingw
@@ -0,0 +1,34 @@
# Adrian Pop, adrpo@ida.liu.se, 2006-02-01
# Makefile for compilation of OMC using OMDev-mingw
# OMDev-mingw: http://www.ida.liu.se/~adrpo/omc/omdev/

# The path to the OMDev-mingw package MUST BE SET!
#OMDEV=$OMDEV
# Test if the needed variables are there...

top_builddir = ../..
builddir_bin=$(top_builddir)/build/bin
builddir_lib=$(top_builddir)/build/lib/omc
builddir_inc=$(top_builddir)/build/include/omc

AR = ar -ru
CC = gcc
FC = g77
#include the sundials, ipopt from OMDev and the top_builddir for revision.h
CONFIG_CFLAGS = -O2 -falign-functions -msse2 -mfpmath=sse \
-I$(OMDEV)/lib/3rdParty/Ipopt/include/ \
-I$(OMDEV)/lib/3rdParty/Sundials/include \
-I$(OMDEV)/include/lis -I$(top_builddir) \
-Wall -Wno-unused-variable

# Not needed since we already set fpmath
FPMATHFORTRAN =

LIBMAKEFILE = Makefile.omdev.mingw
CONFIG_H=$(top_builddir)/Compiler/runtime/config.h
LIBSIMULATION=libSimulationRuntimeC.a
LIBRUNTIME=libOpenModelicaRuntimeC.a
LIBFMIRUNTIME=libOpenModelicaFMIRuntimeC.a
OBJ_EXT = .o

include Makefile.common
11 changes: 11 additions & 0 deletions SimulationRuntime/c/util/java_interface/Makefile.omdev.mingw
@@ -0,0 +1,11 @@
include Makefile.common

modelica_java.jar: $(java_sources)
@echo "* Compiling modelica_java.jar"
@rm -rf bin-jar; mkdir bin-jar
@"$(JAVAC)" -source 5 -cp "$(antlr)" -d bin-jar $(java_sources)
@"$(JAR)" cf $@ $(java_sources:src/%=-C src %) $(resources:src/%=-C src %) -C bin-jar . || (rm $@ && false)
test: $(java_sources)
rm -rf bin-test; mkdir bin-test
@"$(JAVAC)" -source 5 -cp "$(antlr);$(junit)" -d bin-test $(java_sources) $(java_tests)
"$(JAVA)" -cp "bin-test;src;$(antlr);$(junit)" org.junit.runner.JUnitCore $(junit_tests)

0 comments on commit 23686e6

Please sign in to comment.