Skip to content

Commit

Permalink
- Removed the need to set CLASSPATH when building under Linux.
Browse files Browse the repository at this point in the history
- Updated configure script to not check for CLASSPATH (it only checks that Java exists and can load the provided antlr).
- Updated the lexer/parser makefiles to run with parallel jobs.
- Warning: Due to RML creating and using .srz-files from all imported packages, parallel execution of make may in some rare cases fail. Running make again will work because the other process will have cached the srz-files.
  It is possible to generate all srz-files in advance at the cost of efficiency (you may not do this is parallel, and it's not necessary if the number of jobs=1).
- Warning: RML drains a lot of RAM. Running "make -j" launches an unlimited number of jobs. This will eat about 20GB of RAM and possibly crash the system, so don't do this. Max 1 job per GB of RAM is recommended.


git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@4541 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
sjoelund committed Nov 19, 2009
1 parent b6fed04 commit 787ea35
Show file tree
Hide file tree
Showing 8 changed files with 2,195 additions and 2,777 deletions.
30 changes: 18 additions & 12 deletions Compiler/absyn_builder/Makefile.in
Expand Up @@ -53,9 +53,10 @@ exprparseobjs=$(exprparsesrcs:.cpp=.o)

OBJS += $(walkerobjs) $(exprparseobjs) $(PARSER_OBJS) parse.o

ANTLR = java -cp $(ANTLR_HOME) antlr.Tool
ANTLR = java -cp $(top_builddir)/@omc_antlr_jar@ antlr.Tool

all : flat_parser parser absyn_builder.a
all : absyn_builder.a
.PHONY: parser flat_parser exprparseonce walkeronce

vctarget: vcparser $(walkergen) $(exprparsegen)

Expand All @@ -64,23 +65,25 @@ vcparser:
cd $(FLAT_PARSE_HOME)/src; $(MAKE) -f Makefile vctarget

parser:
cd $(PARSE_HOME)/src; $(MAKE) -f Makefile
$(MAKE) -C $(PARSE_HOME)/src

flat_parser:
cd $(FLAT_PARSE_HOME)/src; $(MAKE) -f Makefile
$(MAKE) -C $(FLAT_PARSE_HOME)/src

absyn_builder.a : $(OBJS)
ar -sr $@ $(OBJS)

#walker : $(OBJS)
# $(CXX) -o $@ $(OBJS) $(LINKFLAGS) $(LIBS)
$(PARSER_OBJS) : parser flat_parser

$(walkergen): walker.g modelica_parserTokenTypes.txt
java antlr.Tool $(ANTLRFLAGS) $<
walkeronce: walker.g modelica_parserTokenTypes.txt
$(ANTLR) $(ANTLRFLAGS) $<
$(walkergen): walkeronce

$(exprparsegen): expression_parser.g modelica_parserTokenTypes.txt
java antlr.Tool -glib $(PARSE_HOME)/src/modelica_parser.g $(ANTLRFLAGS) $<
exprparseonce: expression_parser.g modelica_parserTokenTypes.txt
$(ANTLR) -glib $(PARSE_HOME)/src/modelica_parser.g $(ANTLRFLAGS) $<
$(exprparsegen): exprparseonce

$(PARSE_HOME)/src/modelica_parserTokenTypes.txt: parser flat_parser
modelica_parserTokenTypes.txt : $(PARSE_HOME)/src/modelica_parserTokenTypes.txt
cp $< $@

Expand All @@ -90,8 +93,11 @@ clean:

reallyclean: clean

walker.o : walker.cpp $(PARSE_HOME)/src/modelica_lexer.hpp $(PARSE_HOME)/src/modelica_parser.hpp \
parse.o : parse.cpp $(PARSE_HOME)/src/modelica_lexer.hpp $(PARSE_HOME)/src/modelica_parser.hpp \
$(FLAT_PARSE_HOME)/src/flat_modelica_parser.hpp \
$(FLAT_PARSE_HOME)/src/flat_modelica_lexer.hpp
$(FLAT_PARSE_HOME)/src/flat_modelica_lexer.hpp \
modelica_tree_parser.hpp \
modelica_expression_parser.hpp \
$(PARSE_HOME)/src/parse_tree_dumper.hpp


2 changes: 1 addition & 1 deletion Compiler/omc_debug/Makefile.in
Expand Up @@ -95,7 +95,7 @@ $(PROG): $(SRCO) subdirs $(top_builddir)/c_runtime/sendData/*.cpp
g++ -O3 -o $(PROG)$(EXEEXT) $(SRCO) $(AST) $(RTOBJ) $(LDFLAGS) $(PLTPKGFLAGS)

subdirs: $(SRCHSRCDIR)
for dir in $(SUBDIRS); do $(MAKE) -j 1 -C $$dir; done;
for dir in $(SUBDIRS); do $(MAKE) -C $$dir; done;

clean:
for d in $(SUBDIRS); do \
Expand Down
2 changes: 1 addition & 1 deletion Compiler/omc_release/Makefile.in
Expand Up @@ -94,7 +94,7 @@ $(PROG): $(SRCO) subdirs $(top_builddir)/c_runtime/sendData/*.cpp
g++ -O3 -o $(PROG)$(EXEEXT) $(SRCO) $(AST) $(RTOBJ) $(LDFLAGS) $(PLTPKGFLAGS)

subdirs: $(SRCHSRCDIR)
for dir in $(SUBDIRS); do $(MAKE) -j 1 -C $$dir; done;
for dir in $(SUBDIRS); do $(MAKE) -C $$dir; done;

clean:
for d in $(SUBDIRS); do \
Expand Down
18 changes: 9 additions & 9 deletions Makefile.in
Expand Up @@ -19,7 +19,8 @@ INSTALL_INCLUDEDIR = ${includedir}
INSTALL_DATADIR = ${datadir}
INSTALL_DOCDIR = ${INSTALL_DATADIR}/omc/doc

all : mkbuilddirs release qtclients mosh
all : release qtclients mosh
.PHONY : c_runtime omc omcd release debug qtclient mosh all mkbuilddirs test

mkbuilddirs:
mkdir -p $(builddir_bin)
Expand All @@ -32,17 +33,16 @@ debug: omcd

release: omc

omcd:
(cd c_runtime && $(MAKE) -f Makefile)
#(cd Compiler/rml2sig && $(MAKE) -f Makefile)
c_runtime: mkbuilddirs
$(MAKE) -C c_runtime -f Makefile

omcd: c_runtime
(cd Compiler && $(MAKE) -f Makefile debug)
(cp -p doc/*.pdf $(builddir_doc)/)
(cp -p Examples/*.* $(builddir_doc)/testmodels/)


omc:
(cd c_runtime && $(MAKE) -f Makefile)
#(cd Compiler/rml2sig && $(MAKE) -f Makefile)
omc: c_runtime
(cd Compiler && $(MAKE) -f Makefile release)
(cp doc/*.pdf $(builddir_doc)/)
(cp -p Examples/*.* $(builddir_doc)/testmodels/)
Expand All @@ -56,10 +56,10 @@ testmos:
testSummary:
(cd testsuite; time $(MAKE) -f Makefile | grep "==")

mosh:
mosh: omc
(cd mosh/src; $(MAKE) -f Makefile)

qtclients:
qtclients: mkbuilddirs
echo "environment variable QTHOME should be defined"
echo "Coin3D (www.coin3d.org) and SoQt should be installed and in the path!"
echo "using QTHOME=${QTHOME}"
Expand Down

0 comments on commit 787ea35

Please sign in to comment.