--- MITgcm/tools/genmake2 2015/11/20 01:22:36 1.274 +++ MITgcm/tools/genmake2 2016/01/12 20:43:00 1.277 @@ -1,6 +1,6 @@ #! /usr/bin/env bash # -# $Header: /home/ubuntu/mnt/e9_copy/MITgcm/tools/genmake2,v 1.274 2015/11/20 01:22:36 jmc Exp $ +# $Header: /home/ubuntu/mnt/e9_copy/MITgcm/tools/genmake2,v 1.277 2016/01/12 20:43:00 jmc Exp $ # $Name: $ # # Makefile generator for MITgcm UV codes @@ -1964,24 +1964,56 @@ fi rm -f genmake_tcomp* -printf " Do we have the etime() command using $FC... " -cat > genmake_tcomp.$FS < genmake_tcomp_1.$FS < genmake_tcomp.log 2>&1 +$FC $FFLAGS -o genmake_tcomp_1 genmake_tcomp_1.$FS > genmake_tcomp.log 2>&1 RETVAL=$? if test "x$RETVAL" = x0 ; then - HAVE_ETIME=t - DEFINES="$DEFINES -DHAVE_ETIME" - echo "yes" + HAVE_ETIME='Fct' + DEFINES="$DEFINES -DHAVE_ETIME_FCT" + echo " yes (${HAVE_ETIME})" else + cat > genmake_tcomp_2.$FS <> genmake_tcomp.log 2>&1 + RETVAL=$? + if test "x$RETVAL" = x0 ; then + echo -n 'c,' + ./genmake_tcomp_2 > genmake_tcomp_2.out 2>&1 + RETVAL=$? + fi + if test "x$RETVAL" = x0 ; then + echo -n 'r:' + RETVAL=`cat genmake_tcomp_2.out | $AWK '{print $1}'` + fi + if test "x$RETVAL" = x0 ; then + HAVE_ETIME='SbR' + DEFINES="$DEFINES -DHAVE_ETIME_SBR" + echo " yes (${HAVE_ETIME})" + else HAVE_ETIME= - echo "no" + echo " no" + fi fi +#mkdir chk_etime ; cp -p -f genmake_tcomp* chk_etime rm -f genmake_tcomp* printf " Can we call simple C routines (here, \"cloc()\") using $FC... "