122 |
( cd $1; |
( cd $1; |
123 |
if [ $quick -eq 0 -o ! -r Makefile ]; then |
if [ $quick -eq 0 -o ! -r Makefile ]; then |
124 |
printf 'genmake ... ' 1>&2 |
printf 'genmake ... ' 1>&2 |
125 |
../../../tools/genmake -ieee -mods=../code > make.log 2>&1 |
if [ $ieee -eq 0 ]; then |
126 |
|
../../../tools/genmake -mods=../code > make.log 2>&1 |
127 |
|
else |
128 |
|
../../../tools/genmake -ieee -mods=../code > make.log 2>&1 |
129 |
|
fi |
130 |
if [ $? -ne 0 ]; then |
if [ $? -ne 0 ]; then |
131 |
tail make.log |
tail make.log |
132 |
echo genmakemodel: genmake failed 1>&2 |
echo genmakemodel: genmake failed 1>&2 |
143 |
# makedependmodel directory |
# makedependmodel directory |
144 |
( cd $1; |
( cd $1; |
145 |
if [ $clean -gt 0 ]; then |
if [ $clean -gt 0 ]; then |
146 |
|
rm -f output.txt |
147 |
printf 'make clean ... ' 2>&1 |
printf 'make clean ... ' 2>&1 |
148 |
make CLEAN >> make.log 2>&1 |
make CLEAN >> make.log 2>&1 |
149 |
if [ $? -ne 0 ]; then |
if [ $? -ne 0 ]; then |
202 |
|
|
203 |
( cd $1 |
( cd $1 |
204 |
if [ -x $2 ]; then |
if [ -x $2 ]; then |
205 |
if [ ! -r output.txt -o $quick -eq 0 ]; then |
if [ $quick -eq 0 ]; then |
206 |
echo runmodel: running... 1>&2 |
rm -f output.txt |
|
( ./$2 > output.txt 2>&1 ) && return 0 |
|
|
return 1 |
|
|
else |
|
|
echo runmodel: output.txt is newer than executable 1>&2 |
|
|
return 0 |
|
207 |
fi |
fi |
208 |
else |
echo -n "runmodel: " 1>&2 |
209 |
echo runmodel: executable \"$1/$2\" is missing 1>&2 |
make output.txt && return 0 |
210 |
return 1 |
# if [ ! -r output.txt -o $quick -eq 0 ]; then |
211 |
|
# echo runmodel: running... 1>&2 |
212 |
|
# ( ./$2 > output.txt 2>&1 ) && return 0 |
213 |
|
# rm -f output.txt |
214 |
|
# ( make output.txt ) && return 0 |
215 |
|
# return 1 |
216 |
|
# else |
217 |
|
# echo runmodel: output.txt is newer than executable 1>&2 |
218 |
|
# ( make output.txt ) && return 0 |
219 |
|
# return 0 |
220 |
|
# fi |
221 |
|
# else |
222 |
|
# echo runmodel: executable \"$1/$2\" is missing 1>&2 |
223 |
|
# return 1 |
224 |
fi |
fi |
225 |
) |
) |
226 |
} |
} |
295 |
-debug Produce even more output which will mean nothing to most |
-debug Produce even more output which will mean nothing to most |
296 |
-clean Do "make CLEAN" before compiling. This forces a complete rebuild. |
-clean Do "make CLEAN" before compiling. This forces a complete rebuild. |
297 |
-longtest Compare numeric output for mean and s.d. of variables. |
-longtest Compare numeric output for mean and s.d. of variables. |
298 |
|
-noieee By default, $0 uses the -ieee option for genmake. This turns it off. |
299 |
|
|
300 |
Normal usage: |
Normal usage: |
301 |
$0 * Configure, compile, run and analyze in all experiment directories |
$0 * Configure, compile, run and analyze in all experiment directories |
323 |
verbose=1 |
verbose=1 |
324 |
quick=0 |
quick=0 |
325 |
clean=0 |
clean=0 |
326 |
|
ieee=1 |
327 |
longtest=0 |
longtest=0 |
328 |
expts='' |
expts='' |
329 |
|
|
335 |
-verbose) verbose=2;; |
-verbose) verbose=2;; |
336 |
-debug) debug=1;; |
-debug) debug=1;; |
337 |
-clean) clean=1;; |
-clean) clean=1;; |
338 |
|
-noieee) ieee=0;; |
339 |
-longtest) longtest=1;; |
-longtest) longtest=1;; |
340 |
-quiet) verbose=0;; |
-quiet) verbose=0;; |
341 |
-help) show_help; exit 0;; |
-help) show_help; exit 0;; |
342 |
|
-*) echo Unrecognized option:$arg; exit 9;; |
343 |
*) test -d $arg && expts=`echo $expts $arg`;; |
*) test -d $arg && expts=`echo $expts $arg`;; |
344 |
esac |
esac |
345 |
done |
done |
346 |
|
|
347 |
|
if [ $clean -gt 0 -a $quick -gt 0 ]; then |
348 |
|
echo You specified -quick and -clean together which conflict. |
349 |
|
echo Please specify either -quick or -clean or neither but not both. |
350 |
|
exit 1 |
351 |
|
fi |
352 |
|
|
353 |
#if [ ${#expts} -eq 0 ]; then |
#if [ ${#expts} -eq 0 ]; then |
354 |
# echo Scanning all directories |
# echo Scanning all directories |
355 |
# for arg in * |
# for arg in * |