11 |
echo "where possible OPTIONS are:" |
echo "where possible OPTIONS are:" |
12 |
echo " (-help|-h) print usage" |
echo " (-help|-h) print usage" |
13 |
echo " (-mpi) use MPI input files" |
echo " (-mpi) use MPI input files" |
14 |
|
echo " (-ieee|-noieee) if possible, use IEEE compiler flags" |
15 |
echo " (-optfile=|-of=)STRING list of optfiles to use" |
echo " (-optfile=|-of=)STRING list of optfiles to use" |
16 |
echo " (-a|-addr)STRING list of email recipients" |
echo " (-a|-addr)STRING list of email recipients" |
17 |
echo " (DEF=\"edhill@mitgcm.org\")" |
echo " (DEF=\"edhill@mitgcm.org\")" |
19 |
echo " (DEF=\"\" which builds all)" |
echo " (DEF=\"\" which builds all)" |
20 |
echo " (-b|-bash)STRING location of \"bash\" executable" |
echo " (-b|-bash)STRING location of \"bash\" executable" |
21 |
echo " (DEF=\"\" for \"/bin/bash\")" |
echo " (DEF=\"\" for \"/bin/bash\")" |
22 |
echo " (-c|-command)STRING command to run" |
echo " (-command)STRING command to run" |
23 |
echo " (DEF=\"make output.txt\")" |
echo " (DEF=\"make output.txt\")" |
24 |
echo " (-m|-make)STRING command to use for \"make\"" |
echo " (-m|-make)STRING command to use for \"make\"" |
25 |
echo " (DEF=\"make\")" |
echo " (DEF=\"make\")" |
26 |
|
echo " (-clean) *ONLY* run \"make CLEAN\"" |
27 |
echo " (-quick|-q) same as \"-nogenmake -noclean -nodepend\"" |
echo " (-quick|-q) same as \"-nogenmake -noclean -nodepend\"" |
28 |
echo " (-nogenmake|-ng) skip the genmake stage" |
echo " (-nogenmake|-ng) skip the genmake stage" |
29 |
echo " (-noclean|-nc) skip the \"make clean\" stage" |
echo " (-noclean|-nc) skip the \"make clean\" stage" |
186 |
GENMAKE2="$BASH ../../../tools/genmake2" |
GENMAKE2="$BASH ../../../tools/genmake2" |
187 |
( |
( |
188 |
cd $1; |
cd $1; |
|
printf 'genmake ... ' 1>&2 |
|
189 |
command="$GENMAKE2 -ds -m $MAKE --mods=../code" |
command="$GENMAKE2 -ds -m $MAKE --mods=../code" |
190 |
if test "x$OPTFILE" != xNONE ; then |
if test "x$OPTFILE" != xNONE ; then |
191 |
command="$command --optfile=$OPTFILE" |
command="$command --optfile=$OPTFILE" |
192 |
# echo " command=\"$command\"" |
# echo " command=\"$command\"" |
193 |
fi |
fi |
194 |
|
if test "x$IEEE" != x ; then |
195 |
|
command="$command -ieee" |
196 |
|
fi |
197 |
|
# echo "command: \"$command\"" |
198 |
|
printf 'genmake ... ' 1>&2 |
199 |
$command > make.log 2>&1 |
$command > make.log 2>&1 |
200 |
RETVAL=$? |
RETVAL=$? |
201 |
for i in gm_state gm_optfile gm_local Makefile ; do |
for i in genmake_state genmake_optfile genmake_local Makefile ; do |
202 |
if test -r $i ; then |
if test -r $i ; then |
203 |
cp $i $CDIR |
cp $i $CDIR |
204 |
fi |
fi |
393 |
-debug Produce even more output which will mean nothing to most |
-debug Produce even more output which will mean nothing to most |
394 |
-force Do "make CLEAN" before compiling. This forces a complete rebuild. |
-force Do "make CLEAN" before compiling. This forces a complete rebuild. |
395 |
-clean Do "make CLEAN" after compiling and testing. |
-clean Do "make CLEAN" after compiling and testing. |
|
-noieee By default, $0 uses the -ieee option for genmake. This turns it off. |
|
396 |
-cleanup Aggresively removes all model output, executables and object files |
-cleanup Aggresively removes all model output, executables and object files |
397 |
and then exits. Use with care. |
and then exits. Use with care. |
398 |
|
|
425 |
expts='' |
expts='' |
426 |
# ieee=1 |
# ieee=1 |
427 |
|
|
428 |
|
IEEE= |
429 |
|
if test "x$MITGCM_IEEE" != x ; then |
430 |
|
IEEE=$MITGCM_IEEE |
431 |
|
fi |
432 |
|
|
433 |
|
|
434 |
CLEANUP=f |
CLEANUP=f |
435 |
QUICK=f |
QUICK=f |
436 |
NOGENMAKE=f |
NOGENMAKE=f |
508 |
-nodepend | --nodepend | -nd | --nd) |
-nodepend | --nodepend | -nd | --nd) |
509 |
NODEPEND=t ;; |
NODEPEND=t ;; |
510 |
|
|
511 |
-mpi) MPI=t ;; |
-mpi) MPI=true ;; |
512 |
|
|
513 |
|
-ieee) IEEE=true ;; |
514 |
|
-noieee) IEEE= ;; |
515 |
|
|
516 |
-verbose) verbose=2 ;; |
-verbose) verbose=2 ;; |
517 |
-debug) debug=1 ;; |
-debug) debug=1 ;; |
|
-clean) clean=1 ;; |
|
518 |
-quiet) verbose=0 ;; |
-quiet) verbose=0 ;; |
519 |
|
|
520 |
-*) |
-*) |
609 |
# Verify that the testdir exists and contains previous |
# Verify that the testdir exists and contains previous |
610 |
# results in the correct location--or skip this directory! |
# results in the correct location--or skip this directory! |
611 |
if test ! -r $dir"/results/output.txt" ; then |
if test ! -r $dir"/results/output.txt" ; then |
|
echo |
|
612 |
echo "can't read \"$dir/results/output.txt\" -- skipping $dir" |
echo "can't read \"$dir/results/output.txt\" -- skipping $dir" |
|
echo |
|
613 |
continue |
continue |
614 |
fi |
fi |
615 |
|
|
639 |
# Is this an MPI run? |
# Is this an MPI run? |
640 |
if test "x$MPI" = xt ; then |
if test "x$MPI" = xt ; then |
641 |
FILES=$MPI_FILES |
FILES=$MPI_FILES |
642 |
|
endings="_mpi" |
643 |
else |
else |
644 |
FILES=$NOMPI_FILES |
FILES=$NOMPI_FILES |
645 |
|
endings="_nompi" |
646 |
fi |
fi |
647 |
|
|
648 |
# Check to see that we have the files |
# Check to see that we have the files |
661 |
# If we have the $FILES and they differ, copy the $FILES to $BUILD_DIR |
# If we have the $FILES and they differ, copy the $FILES to $BUILD_DIR |
662 |
if test "x$have_files" = xt ; then |
if test "x$have_files" = xt ; then |
663 |
for i in $FILES ; do |
for i in $FILES ; do |
664 |
cmp $CODE_DIR/$i $BUILD_DIR/$i > /dev/null 2>&1 |
sstr="s|$endings||" |
665 |
|
name=`echo $i | sed -e $sstr ` |
666 |
|
cmp $CODE_DIR/$i $BUILD_DIR/$name > /dev/null 2>&1 |
667 |
RETVAL=$? |
RETVAL=$? |
668 |
if test "x$RETVAL" != x0 ; then |
if test "x$RETVAL" != x0 ; then |
669 |
cp $CODE_DIR/$i $BUILD_DIR/$i |
cp $CODE_DIR/$i $BUILD_DIR/$name |
670 |
fi |
fi |
671 |
done |
done |
672 |
fi |
fi |
720 |
rm -f $DRESULTS"/"$NDIR".tar*" |
rm -f $DRESULTS"/"$NDIR".tar*" |
721 |
fi |
fi |
722 |
fi |
fi |
723 |
|
|
724 |
|
echo "-------------------------------------------------------------------------------" |
725 |
|
|
726 |
NDIR=$(( $NDIR + 1 )) |
NDIR=$(( $NDIR + 1 )) |
727 |
|
|