Index: mttroot/mtt/bin/mtt ================================================================== --- mttroot/mtt/bin/mtt +++ mttroot/mtt/bin/mtt @@ -13,10 +13,13 @@ ############################################################### ## Version control history ############################################################### ## $Header$ ## $Log$ +## Revision 1.293 2001/02/06 04:39:08 geraint +## Added _standalone.exe representation. +## ## Revision 1.292 2001/02/05 17:27:40 gawthrop ## Make sure _def.r exists before creating _state.txt ## ## Revision 1.291 2000/12/27 14:50:40 peterg ## This is the first CVS version (4.9). @@ -1792,10 +1795,17 @@ if [ -n "$sensitivity" ]; then sys=`echo $1 | cut -c 2-` sys_abg=$sys"_abg" fi + +## Check octave version +if [ `octave --version | awk -F\. '{print $2}'` ]; then + define_octave_dev="-DOCTAVE_DEV" +else + define_octave_dev="" +fi ################################ # This is the main mtt programme ################################ @@ -1806,22 +1816,27 @@ # Cancel implicit rules I don't want %.dvi: %.tex # MTT implicit rules ## .oct files -ifneq ($2,ode2odes) -%.oct: %.cc $1_def.h $1_sympar.h $1_cr.h - echo Creating $1_$2.oct; $MKOCTFILE $< -endif - +$1_%.oct: $1_%.cc $1_def.h $1_sympar.h $1_cr.h + echo Creating $1_\$*.oct; $MKOCTFILE $1_\$*.cc ## .cc files .PRECIOUS: %.cc # Don't let mtt delete them -ifneq ($2,ode2odes) -%.cc: %.m - mtt_m2cc.sh $1 $2 cat -endif +$1_%.cc: $1_%.m + mtt_m2cc.sh $1 \$* cat + +## .o files +.PRECIOUS: $1_%.o +$1_%.o: $1_%.cc $1_def.h $1_sympar.h $1_cr.h + echo Compiling $1_\$*.cc + ${MTT_CXX} ${MTT_CXXFLAGS} ${MTT_CXXINCS} -c $< -DSTANDALONE + +mtt_%.o:: ${MTT_LIB}/cc/mtt_%.cc + echo Compiling mtt_\$*.cc + ${MTT_CXX} ${MTT_CXXFLAGS} ${MTT_CXXINCS} -c $< -DSTANDALONE $define_octave_dev # Generates code to write reduce code $1_ode_write.r: $1_def.m def2write_r $1 $2 @@ -2053,10 +2068,24 @@ mtt_update $1 logic endif # Dummy target FORCE: + +ode2odes_common.m : $1_input.m $1_logic.m $1_numpar.m $1_simpar.m $1_state.m ; @echo > /dev/null +ode2odes_common.cc : $1_input.cc $1_logic.cc $1_numpar.cc $1_simpar.cc $1_state.cc ; @echo > /dev/null +ode2odes_common.o : $1_input.o $1_logic.o $1_numpar.o $1_simpar.o $1_state.o ; @echo > /dev/null +ode2odes_common.oct : $1_input.oct $1_logic.oct $1_numpar.oct $1_simpar.oct $1_state.oct ; @echo > /dev/null +ode2odes_euler.m : $1_ode.m $1_odeo.m ; @echo > /dev/null +ode2odes_euler.cc : $1_ode.cc $1_odeo.cc ; @echo > /dev/null +ode2odes_euler.o : $1_ode.o $1_odeo.o ; @echo > /dev/null +ode2odes_euler.oct : $1_ode.oct $1_odeo.oct ; @echo > /dev/null +ode2odes_implicit.m : $1_cseo.m $1_csex.m $1_smxa.m $1_smxax.m ; @echo > /dev/null +ode2odes_implicit.cc : $1_cseo.cc $1_csex.cc $1_smxa.cc $1_smxax.cc ; @echo > /dev/null +ode2odes_implicit.o : $1_cseo.o $1_csex.o $1_smxa.o $1_smxax.o ; @echo > /dev/null +ode2odes_implicit.oct: $1_cseo.oct $1_csex.oct $1_smxa.oct $1_smxax.oct ; @echo > /dev/null + #SUMMARY numpar numerical parameter declaration (m) $1_numpar.m: $1_numpar.txt $1_sympars.txt mtt_txt2m $1 numpar @@ -2198,11 +2227,11 @@ struc_txt2tex $1 $1_struc.m: $1_struc.txt struc_txt2m $1 $1_def.m: $1_def.r def_r2m $1; matlab_tidy $1_def.m; -$1_def.h: $1_def.m +$1_def.h: $1_def.m $1_sympar.txt def_m2h.sh $1 #SUMMARY rdae raw differential-algebraic equations (r) #SUMMARY dae differential-algebraic equations (r) #SUMMARY dae* differential-algebraic equations (m) @@ -2346,49 +2375,54 @@ $1_ode2odes.m : $1_def.r $1_sympars.txt \ $1_smxa.m $1_smxax.m\ $1_simpar.m $1_numpar.m $1_state.m $1_input.m \ $1_csex.m $1_cseo.m $1_logic.m ifeq ($using_oct,yes) - mtt $mtt_switches -q -u $1 smxa oct - mtt $mtt_switches -q -u $1 smxax oct - mtt $mtt_switches -q -u $1 simpar oct - mtt $mtt_switches -q -u $1 numpar oct - mtt $mtt_switches -q -u $1 state oct - mtt $mtt_switches -q -u $1 input oct - mtt $mtt_switches -q -u $1 csex oct - mtt $mtt_switches -q -u $1 cseo oct - mtt $mtt_switches -q -u $1 logic oct - make_ode2odes $1 cc $integration_method - echo Creating $1_ode2odes.oct - mkoctfile $1_ode2odes.cc touch $1_ode2odes.m # Create a dummy which wont' be used + mtt $mtt_switches -q -u $1 ode2odes oct else make_ode2odes $1 m $integration_method endif endif ifeq ($integration_method,euler) $1_ode2odes.m : $1_def.r $1_sympars.txt\ $1_simpar.m $1_numpar.m $1_state.m $1_input.m \ $1_ode.m $1_odeo.m $1_logic.m ifeq ($using_oct,yes) - mtt $mtt_switches -q -u $1 simpar oct - mtt $mtt_switches -q -u $1 numpar oct - mtt $mtt_switches -q -u $1 state oct - mtt $mtt_switches -q -u $1 input oct - mtt $mtt_switches -q -u $1 ode oct - mtt $mtt_switches -q -u $1 odeo oct - mtt $mtt_switches -q -u $1 logic oct - make_ode2odes $1 cc $integration_method - echo Creating $1_ode2odes.oct - mkoctfile $1_ode2odes.cc touch $1_ode2odes.m # Create a dummy which wont' be used + mtt $mtt_switches -q -u $1 ode2odes oct else make_ode2odes $1 m $integration_method endif endif +$1_ode2odes.exe: $1_def.h $1_sympar.h\ + $1_ode2odes.o ode2odes_common.o ode2odes_${integration_method}.o\ + libmttcxx.a + echo Creating $1_ode2odes.exe + ${MTT_CXX} ${MTT_LDFLAGS} $1_*.o ${MTT_CXXLIBS} -o $1_ode2odes.exe + +libmttcxx.a: mtt_euler.o mtt_implicit.o + echo Creating libmttcxx.a + ar rc libmttcxx.a $^ + ranlib libmttcxx.a + +$1_ode2odes.o: $1_ode2odes.cc ode2odes_common.o ode2odes_${integration_method}.o + echo Creating $1_ode2odes.o + ${MTT_CXX} ${MTT_CXXFLAGS} ${MTT_CXXINCS} -c $1_ode2odes.cc -DSTANDALONE + +$1_ode2odes.oct: $1_ode2odes.cc ode2odes_common.oct ode2odes_${integration_method}.oct + touch $1_ode2odes.m + echo Creating $1_ode2odes.oct + $MKOCTFILE $1_ode2odes.cc + +$1_ode2odes.cc: $1_def.r $1_sympars.txt\ + ode2odes_common.m ode2odes_common.cc\ + ode2odes_${integration_method}.m ode2odes_${integration_method}.cc + touch $1_ode2odes.m + make_ode2odes $1 cc $integration_method #Conversion of m to p to c #SUMMARY ode ordinary differential equations (c) #SUMMARY ode ordinary differential equations (p) #SUMMARY state state declaration (c) Index: mttroot/mtt/bin/mttrc ================================================================== --- mttroot/mtt/bin/mttrc +++ mttroot/mtt/bin/mttrc @@ -13,10 +13,13 @@ ############################################################### ## Version control history ############################################################### ## $Id$ ## $Log$ +## Revision 1.17 2000/12/27 16:46:13 peterg +## Stripped the mtt- from paths +## ## Revision 1.16 2000/12/27 15:16:44 peterg ## If then else format ## ## Revision 1.15 2000/12/27 14:57:43 peterg ## Now takes the base path as an argument @@ -132,6 +135,29 @@ # Ascend stuff export ASCENDLIBRARY=$MTTPATH/ascend/lib # Oct file generation - use version with no optimisation. export MKOCTFILE=$MTT_LIB/octave/mkoctfile + + # ode2odes.exe stuff + # local system + PREFIX="/usr/local" + PLAT="i686-pc-linux-gnu" + GCCVERS="2.95.2" + SRCOCTAVE="/cvs/octave" + # include paths + IOCTAVE="-I${PREFIX}/include/octave" + # library paths + LOCTAVE="-L${PREFIX}/lib/octave -loctave -lcruft -loctinterp" + LKPATHSEA="-L${SRCOCTAVE}/kpathsea -lkpathsea" + LREADLINE=" -L${SRCOCTAVE}/readline -lreadline" + LSYSTEM="-ldl -lm -lncurses" + LF2C="-L${PREFIX}/lib/gcc-lib/${PLAT}/${GCCVERS} -lg2c" + LMTTCXX="-L. -lmttcxx" + # compiler options + export MTT_CXX="g++" + export MTT_CXXFLAGS="-g -O3" + export MTT_LD="ld" + export MTT_CXXLIBS="${LOCTAVE} ${LKPATHSEA} ${LREADLINE} ${LF2C} ${LSYSTEM} ${LMTTCXX}" + export MTT_CXXINCS="-I. ${IOCTAVE}" + fi DELETED mttroot/mtt/lib/rep/standalone_rep.make Index: mttroot/mtt/lib/rep/standalone_rep.make ================================================================== --- mttroot/mtt/lib/rep/standalone_rep.make +++ /dev/null @@ -1,59 +0,0 @@ -# -*-makefile-*- - -.POSIX: - -MTTFLAGS = -q -u -oct $(OPTS) - -# Adapt according to local set-up and mkoctfile -CXX = g++ -CXXFLAGS = $(DEBUG) $(OPTIM) $(DEFINES) $(ARCHFLAGS) -fno-rtti -fno-exceptions -fno-implicit-templates - -DEBUG = -g -OPTIM = -O3 - -PREFIX = /usr/local - -INCLUDES = -I$(PREFIX)/include/octave - -OCTAVE_SRC_PATH = /cvs/octave - -LIBOCTAVE = -L$(PREFIX)/lib/octave -loctave -lcruft -loctinterp -LIBKPATHSEA = -L$(OCTAVE_SRC_PATH)/kpathsea -lkpathsea -LIBREADLINE = -L$(OCTAVE_SRC_PATH)/readline -lreadline -#LIBBLAS = -L/usr/local/src/ATLAS/lib/Linux_PIII -lcblas -lf77blas -llapack -latlas -ltstatlas -#LIBBLAS = -lblas -llapack -LIBF2C = -lg2c -LIBRARIES = -ldl -lm -lncurses - -ARCHFLAGS = $(i386FLAGS) -i386FLAGS = -mieee-fp - -# Define -DOCTAVE_DEV for octave 2.1.x -ifeq (0, $(shell octave --version | awk -F\. '{print $2}')) -DEFINES = -DSTANDALONE -else -DEFINES = -DSTANDALONE -DOCTAVE_DEV -endif - -all: $(SYS)_standalone.$(LANG) - -$(SYS)_standalone.exe: $(SYS)_ode2odes.cc $(SYS)_def.h $(SYS)_sympar.h - cp $(MTT_LIB)/cc/*.cc . - echo Creating $(SYS)_standalone.exe - $(CXX) *.cc -o $@ $(CXXFLAGS) $(INCLUDES) $(LIBOCTAVE) $(LIBKPATHSEA) $(LIBREADLINE) $(LIBBLAS) $(LIBF2C) $(LIBRARIES) - -.PHONY: $(SYS)_standalone.clean - -$(SYS)_ode2odes.cc: - mtt $(MTTFLAGS) $(SYS) ode2odes m - -$(SYS)_def.h: - mtt $(MTTFLAGS) $(SYS) def h - -$(SYS)_sympar.h: - mtt $(MTTFLAGS) $(SYS) sympar h - - -$(SYS)_standalone.clean: - cd .. ; mtt Clean - rm -f ../$(SYS)_standalone.exe