Skip to content

Commit

Permalink
- Clean-up location of FMI runtime library
Browse files Browse the repository at this point in the history
- It's now a library linked separate from other (not part of Compiler/runtime, which includes System.mo; not what we need for FMI stand-alone simulations)
- Still, FMI for model exchange segfaults in testsuite, but it seems to be a valid error since a NULL pointer is sent around. Couldn't use valgrind to find it because the FMU template doesn't accept changing CFLAGS using env.vars (illegal instructions if using -O2)...
- Probably messed up some Makefiles. I moved things around a lot


git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@15306 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
sjoelund committed Feb 25, 2013
1 parent 41173e1 commit 07b9c81
Show file tree
Hide file tree
Showing 8 changed files with 67 additions and 56 deletions.
100 changes: 50 additions & 50 deletions Compiler/Template/CodegenFMU.tpl

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Compiler/omc_release/Makefile.in
Expand Up @@ -15,7 +15,7 @@ CXX = @CXX@
CFLAGS = @CFLAGS@
RMLHOME = @rmlhome@
RMLINC = -I$(RMLHOME)/include/plain
FMILIB = -L../../3rdParty/FMIL/install/lib -lfmilib
FMILIB = -lfmilib -lOpenModelicaFMIRuntimeC

EXEEXT = @EXEEXT@

Expand Down
4 changes: 2 additions & 2 deletions Compiler/runtime/Makefile.common
Expand Up @@ -23,7 +23,7 @@ RML_COMPAT=$(top_builddir)/SimulationRuntime/c/meta/rml_compatibility.h

SRC = Print_rml.c System_rml.c Settings_rml.c \
SimulationResults_rml.c IOStreamExt_rml.c Database_rml.c Socket_rml.c Lapack_rml.c ModelicaExternalC_rml.c matching.c matching_cheap.c \
FMI_rml.c FMI1Common.c FMI1ModelExchange.c FMI1CoSimulation.c
FMI_rml.c

CPPSRC = unitparser.cpp UnitParserExt_rml.cpp ptolemyio_rml.cpp \
BackendDAEEXT_rml.cpp ErrorMessage.cpp Error_rml.cpp \
Expand All @@ -32,7 +32,7 @@ CPPSRC = unitparser.cpp UnitParserExt_rml.cpp ptolemyio_rml.cpp \
OBJ = $(SRC:.c=.o) $(CPPSRC:.cpp=.o) $(CORBAOBJ)

OMC_OBJ = Error_omc.o Print_omc.o System_omc.o Settings_omc.o \
IOStreamExt_omc.o ErrorMessage.o FMI_omc.o FMI1Common.o FMI1ModelExchange.o FMI1CoSimulation.o systemimplmisc.o \
IOStreamExt_omc.o ErrorMessage.o FMI_omc.o systemimplmisc.o \
UnitParserExt_omc.o unitparser.o BackendDAEEXT_omc.o Socket_omc.o matching.o matching_cheap.o \
Database_omc.o Dynload_omc.o SimulationResults_omc.o ptolemyio_omc.o Lapack_omc.o $(OMCCORBASRC)

Expand Down
16 changes: 13 additions & 3 deletions SimulationRuntime/c/Makefile.common
Expand Up @@ -6,7 +6,7 @@

include Makefile.objs

CPPFLAGS = -I. -I$(UTILPATH) -I. -I$(METAPATH) -I$(METAPATH)gc $(LIBF2CINC) -I$(top_builddir)/3rdParty/gc-7.2/include
CPPFLAGS = -I. -I$(UTILPATH) -I. -I$(METAPATH) -I$(METAPATH)gc $(LIBF2CINC) -I$(top_builddir)/3rdParty/gc-7.2/include -I$(top_builddir)/3rdParty/FMIL/install/include/
CFLAGS = $(CPPFLAGS) $(CONFIG_CFLAGS) $(EXTRA_CFLAGS)
CXXFLAGS = $(CFLAGS)
FFLAGS = -O -fexceptions
Expand Down Expand Up @@ -78,6 +78,7 @@ libSimulationRuntimeC.a: $(ALL_OBJS)
@# You have to remove the old archive first or it may contain old objects
@rm -f $@
$(AR) $@ $(ALL_OBJS)

ranlib $@

libSimulationRuntimeC.so: $(ALL_OBJS)
Expand All @@ -94,6 +95,15 @@ libOpenModelicaRuntimeC.so: $(BASE_OBJS)
@rm -f $@
$(CC) -shared -o $@ $(BASE_OBJS)

libOpenModelicaFMIRuntimeC.a: $(FMIOBJSPATH)
@rm -f $@
$(AR) $@ $(FMILIB) $(FMIOBJSPATH)
ranlib $@

libOpenModelicaFMIRuntimeC.so: $(FMIOBJSPATH)
@rm -f $@
$(CC) -shared -o $@ $(FMIOBJSPATH)

$(METAOBJSPATH):%.o: %.c $(METAHFILESPATH) $(COMMON_HEADERS)
$(CC) -c $(CFLAGS) -o $@ $< -I$(METAPATH) -I$(UTILPATH)

Expand Down Expand Up @@ -131,9 +141,9 @@ simulation/libf2c/libf2c.a:
$(MAKE) -C simulation/libf2c -f ${LIBMAKEFILE}
endif

install: ModelicaExternalC/libModelicaExternalC.a $(LIBSIMULATION) $(LIBRUNTIME) simulation/libf2c/libf2c.a $(ALL_OBJS)
install: ModelicaExternalC/libModelicaExternalC.a $(LIBSIMULATION) $(LIBRUNTIME) $(LIBFMIRUNTIME) simulation/libf2c/libf2c.a $(ALL_OBJS)
# copy libraries
cp -p $(LIBSIMULATION) $(LIBRUNTIME) \
cp -p $(LIBSIMULATION) $(LIBRUNTIME) $(LIBFMIRUNTIME) \
./ModelicaExternalC/libModelicaExternalC.a \
../interactive/libinteractive.a $(builddir_lib)
test -z "$(LIBF2C)" || cp simulation/libf2c/libf2c.* $(builddir_lib)/
Expand Down
1 change: 1 addition & 0 deletions SimulationRuntime/c/Makefile.in
Expand Up @@ -30,6 +30,7 @@ LIBF2CHEADER=./simulation/libf2c/f2c.h
endif
LIBSIMULATION=libSimulationRuntimeC.so
LIBRUNTIME=libOpenModelicaRuntimeC.so
LIBFMIRUNTIME=libOpenModelicaFMIRuntimeC.a

EXTERNALCMAKEFILE=Makefile

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 07b9c81

Please sign in to comment.