96 |
will search for a working compiler by trying a list of |
will search for a working compiler by trying a list of |
97 |
"usual suspects" such as gcc, c89, cc, etc. |
"usual suspects" such as gcc, c89, cc, etc. |
98 |
|
|
|
-[no]ieee | --[no]ieee |
|
|
Do or don't use IEEE numerics. Note that this option |
|
|
*only* works if it is supported by the OPTFILE that |
|
|
is being used. |
|
|
|
|
99 |
-use_real4 | -use_r4 | -ur4 | --use_real4 | --use_r4 | --ur4 |
-use_real4 | -use_r4 | -ur4 | --use_real4 | --use_r4 | --ur4 |
100 |
Use "real*4" type for _RS variable (#undef REAL4_IS_SLOW) |
Use "real*4" type for _RS variable (#undef REAL4_IS_SLOW) |
101 |
*only* works if CPP_EEOPTIONS.h allows this. |
*only* works if CPP_EEOPTIONS.h allows this. |
121 |
-hpmt | --hpmt |
-hpmt | --hpmt |
122 |
Performance analysis with the HPM Toolkit |
Performance analysis with the HPM Toolkit |
123 |
|
|
124 |
-gsl | --gsl |
-ieee | --ieee |
125 |
Use GSL to control floating point rounding and precision |
use IEEE numerics. Note that this option *only* works |
126 |
|
if it is supported by the OPTFILE that is being used. |
127 |
-devel | --devel |
-devel | --devel |
128 |
Add additional warning and debugging flags for development |
Add additional warning and debugging flags for development |
129 |
|
(if supported by the OPTFILE); also switch to IEEE numerics. |
130 |
|
-gsl | --gsl |
131 |
|
Use GSL to control floating point rounding and precision |
132 |
|
|
133 |
-mpi | --mpi |
-mpi | --mpi |
134 |
Include MPI header files and link to MPI libraries |
Include MPI header files and link to MPI libraries |
345 |
# 3) locally build and use the cyrus implementation |
# 3) locally build and use the cyrus implementation |
346 |
# 4) fall back to the buggy local xmakedpend script |
# 4) fall back to the buggy local xmakedpend script |
347 |
# |
# |
348 |
|
echo >> $LOGFILE |
349 |
|
echo "running: look_for_makedepend()" >> $LOGFILE |
350 |
|
if test "x${MAKEDEPEND}" != x ; then |
351 |
|
echo "${MAKEDEPEND}" | grep -i cyrus > /dev/null 2>&1 |
352 |
|
RETVAL=$? |
353 |
|
if test x"$RETVAL" = x0 ; then |
354 |
|
build_cyrus_makedepend |
355 |
|
RETVAL=$? |
356 |
|
if test "x$RETVAL" != x0 ; then |
357 |
|
echo "WARNING: unable to build cyrus-makedepend. Try 'makedepend'" |
358 |
|
MAKEDEPEND= |
359 |
|
fi |
360 |
|
else |
361 |
|
echo "${MAKEDEPEND}" | grep 'tools.xmakedepend' > /dev/null 2>&1 |
362 |
|
RETVAL=$? |
363 |
|
if test "x$RETVAL" = x0 ; then |
364 |
|
MAKEDEPEND='$(TOOLSDIR)/xmakedepend' |
365 |
|
fi |
366 |
|
echo " --> MAKEDEPEND=${MAKEDEPEND}" >> $LOGFILE |
367 |
|
fi |
368 |
|
fi |
369 |
if test "x${MAKEDEPEND}" = x ; then |
if test "x${MAKEDEPEND}" = x ; then |
370 |
which makedepend > /dev/null 2>&1 |
which makedepend > /dev/null 2>&1 |
371 |
RV0=$? |
RV0=$? |
390 |
test -f $MAKEFILE".tst" && mv -f $MAKEFILE".tst" $MAKEFILE |
test -f $MAKEFILE".tst" && mv -f $MAKEFILE".tst" $MAKEFILE |
391 |
if test "x${RV0}${RV1}" = x00 ; then |
if test "x${RV0}${RV1}" = x00 ; then |
392 |
MAKEDEPEND=makedepend |
MAKEDEPEND=makedepend |
393 |
|
echo " --> set MAKEDEPEND=${MAKEDEPEND}" >> $LOGFILE |
394 |
else |
else |
395 |
echo " a system-default makedepend was not found." |
echo " system-default makedepend not found. Try to build cyrus-makedepend" |
396 |
# Try to build the cyrus implementation |
# Try to build the cyrus implementation |
397 |
build_cyrus_makedepend |
build_cyrus_makedepend |
398 |
RETVAL=$? |
RETVAL=$? |
399 |
if test "x$RETVAL" != x0 ; then |
if test "x$RETVAL" != x0 ; then |
400 |
|
echo "WARNING: unable to build cyrus-makedepend. Use local xmakedepend" |
401 |
MAKEDEPEND='$(TOOLSDIR)/xmakedepend' |
MAKEDEPEND='$(TOOLSDIR)/xmakedepend' |
402 |
|
echo " --> set MAKEDEPEND=${MAKEDEPEND}" >> $LOGFILE |
403 |
fi |
fi |
|
rm -f ./genmake_cy_md |
|
|
fi |
|
|
else |
|
|
# echo "MAKEDEPEND=${MAKEDEPEND}" |
|
|
echo "${MAKEDEPEND}" | grep -i cyrus > /dev/null 2>&1 |
|
|
RETVAL=$? |
|
|
if test x"$RETVAL" = x0 ; then |
|
|
build_cyrus_makedepend |
|
404 |
fi |
fi |
405 |
fi |
fi |
406 |
} |
} |
407 |
|
|
408 |
build_cyrus_makedepend() { |
build_cyrus_makedepend() { |
409 |
|
echo >> $LOGFILE |
410 |
|
echo "running: build_cyrus_makedepend()" >> $LOGFILE |
411 |
rm -f ./genmake_cy_md |
rm -f ./genmake_cy_md |
412 |
( |
( |
413 |
cd $ROOTDIR/tools/cyrus-imapd-makedepend \ |
cd $ROOTDIR/tools/cyrus-imapd-makedepend \ |
424 |
rm -f ./genmake_cy_md |
rm -f ./genmake_cy_md |
425 |
if test "x$RETVAL" = x0 ; then |
if test "x$RETVAL" = x0 ; then |
426 |
MAKEDEPEND='$(TOOLSDIR)/cyrus-imapd-makedepend/makedepend' |
MAKEDEPEND='$(TOOLSDIR)/cyrus-imapd-makedepend/makedepend' |
427 |
|
echo " --> set MAKEDEPEND=${MAKEDEPEND}" >> $LOGFILE |
428 |
return 0 |
return 0 |
429 |
else |
else |
430 |
echo "WARNING: unable to build cyrus-imapd-makedepend" |
echo "WARNING: fail to build cyrus-imapd-makedepend" >> $LOGFILE |
431 |
return 1 |
return 1 |
432 |
fi |
fi |
433 |
} |
} |
1071 |
FEXTRAFLAGS= |
FEXTRAFLAGS= |
1072 |
USE_EXTENDED_SRC= |
USE_EXTENDED_SRC= |
1073 |
EXTENDED_SRC_FLAG= |
EXTENDED_SRC_FLAG= |
1074 |
|
GET_FC_VERSION= |
1075 |
CFLAGS= |
CFLAGS= |
1076 |
KFLAGS1= |
KFLAGS1= |
1077 |
KFLAGS2= |
KFLAGS2= |
1128 |
EXECUTABLE= |
EXECUTABLE= |
1129 |
EXEHOOK= |
EXEHOOK= |
1130 |
EXEDIR= |
EXEDIR= |
|
PACKAGES_CONF= |
|
1131 |
IEEE= |
IEEE= |
1132 |
if test "x$MITGCM_IEEE" != x ; then |
if test "x$MITGCM_IEEE" != x ; then |
1133 |
IEEE=$MITGCM_IEEE |
IEEE=$MITGCM_IEEE |
1149 |
TAMC_EXTRA= |
TAMC_EXTRA= |
1150 |
|
|
1151 |
# The following state can be set directly by command-line switches |
# The following state can be set directly by command-line switches |
1152 |
gm_s1="OPTFILE PKG_DEPEND PKG_GROUPS MAKEFILE MAKEDEPEND PLATFORM ROOTDIR MODS DISABLE ENABLE" |
gm_s1="OPTFILE PKG_DEPEND PKG_GROUPS DISABLE ENABLE MAKEFILE MAKEDEPEND PLATFORM" |
1153 |
gm_s2="FC CC IEEE USE_R4 TS PAPIS PCLS PAPI PCL HPMT GSL DEVEL MPI OMP DUMPSTATE STANDARDDIRS" |
gm_s2="FC CC MPI OMP USE_R4 TS PAPIS PCLS PAPI PCL HPMT IEEE DEVEL GSL FEXTRAFLAGS" |
1154 |
|
gm_s3="ROOTDIR STANDARDDIRS MODS DUMPSTATE" |
1155 |
|
|
1156 |
# The following state is not directly set by command-line switches |
# The following state is not directly set by command-line switches |
1157 |
gm_s3="LN S64 LINK MAKE PACKAGES INCLUDES FFLAGS FOPTIM FEXTRAFLAGS" |
gm_s4="LN S64 LINK MAKE PACKAGES INCLUDES FFLAGS FOPTIM" |
1158 |
gm_s4="CFLAGS LIBS KPP KFLAGS1 KFLAGS2 KPPFILES NOOPTFILES NOOPTFLAGS" |
gm_s5="CFLAGS LIBS KPP KFLAGS1 KFLAGS2 KPPFILES NOOPTFILES NOOPTFLAGS" |
1159 |
gm_s5="TOOLSDIR SOURCEDIRS INCLUDEDIRS PWD THISHOST THISUSER THISDATE THISVER MACHINE" |
gm_s6="TOOLSDIR SOURCEDIRS INCLUDEDIRS EXEDIR EXECUTABLE EXEHOOK" |
1160 |
gm_s6="EXECUTABLE EXEHOOK EXEDIR PACKAGES_CONF" |
gm_s7="PWD THISHOST THISUSER THISDATE THISVER MACHINE" |
1161 |
gm_s7="FC_NAMEMANGLE HAVE_NETCDF HAVE_SYSTEM HAVE_FDATE HAVE_ETIME" |
gm_s8="FC_NAMEMANGLE HAVE_NETCDF HAVE_SYSTEM HAVE_FDATE HAVE_ETIME" |
1162 |
|
|
1163 |
# The following are all related to adjoint/tangent-linear stuff |
# The following are all related to adjoint/tangent-linear stuff |
1164 |
gm_s10="AUTODIFF_PKG_USED AD_OPTFILE TAMC TAF AD_TAMC_FLAGS AD_TAF_FLAGS" |
gm_s10="AUTODIFF_PKG_USED AD_OPTFILE TAMC TAF AD_TAMC_FLAGS AD_TAF_FLAGS" |
1165 |
gm_s11="FTL_TAMC_FLAGS FTL_TAF_FLAGS SVD_TAMC_FLAGS SVD_TAF_FLAGS" |
gm_s11="FTL_TAMC_FLAGS FTL_TAF_FLAGS SVD_TAMC_FLAGS SVD_TAF_FLAGS" |
1166 |
gm_s12="TAF_EXTRA TAMC_EXTRA" |
gm_s12="TAF_EXTRA TAMC_EXTRA" |
1167 |
|
|
1168 |
gm_state="COMMANDL $gm_s1 $gm_s2 $gm_s3 $gm_s4 $gm_s5 $gm_s6 $gm_s7" |
gm_state="COMMANDL $gm_s1 $gm_s2 $gm_s3 $gm_s4 $gm_s5 $gm_s6 $gm_s7 $gm_s8" |
1169 |
gm_state="$gm_state $gm_s10 $gm_s11 $gm_s12" |
gm_state="$gm_state $gm_s10 $gm_s11 $gm_s12" |
1170 |
|
|
1171 |
cat <<EOF |
cat <<EOF |
1315 |
-fs90=* | --fs90=*) |
-fs90=* | --fs90=*) |
1316 |
FS90=$ac_optarg ;; |
FS90=$ac_optarg ;; |
1317 |
|
|
1318 |
|
-use_real4 | -use_r4 | -ur4 | --use_real4 | --use_r4 | --ur4 ) |
1319 |
|
USE_R4=true ;; |
1320 |
|
|
1321 |
-ieee | --ieee) |
-ieee | --ieee) |
1322 |
IEEE=true ;; |
IEEE=true ;; |
1323 |
-noieee | --noieee) |
-noieee | --noieee) |
1324 |
IEEE= ;; |
echo "Warning: ignore option '$ac_option' (default is already without '-ieee')" ;; |
1325 |
|
-devel | --devel) |
1326 |
-use_real4 | -use_r4 | -ur4 | --use_real4 | --use_r4 | --ur4 ) |
IEEE=true ; DEVEL=true ;; |
1327 |
USE_R4=true ;; |
-gsl | --gsl) |
1328 |
|
GSL=true ;; |
1329 |
|
|
1330 |
-ts | --ts) |
-ts | --ts) |
1331 |
TS=true ;; |
TS=true ;; |
1342 |
-hpmt | --hpmt) |
-hpmt | --hpmt) |
1343 |
HPMT=true ;; |
HPMT=true ;; |
1344 |
|
|
|
-gsl | --gsl) |
|
|
GSL=true ;; |
|
|
|
|
|
-devel | --devel) |
|
|
DEVEL=true ;; |
|
|
|
|
1345 |
-mpi | --mpi) |
-mpi | --mpi) |
1346 |
MPI=true ;; |
MPI=true ;; |
1347 |
-mpi=* | --mpi=*) |
-mpi=* | --mpi=*) |
1357 |
-ds | --ds) |
-ds | --ds) |
1358 |
DUMPSTATE=t ;; |
DUMPSTATE=t ;; |
1359 |
|
|
1360 |
|
-extra_flag | --extra_flag) |
1361 |
|
ac_prev=FEXTRAFLAGS ;; |
1362 |
|
-extra_flag=* | --extra_flag=*) |
1363 |
|
FEXTRAFLAGS=$ac_optarg ;; |
1364 |
|
|
1365 |
-taf_extra | --taf_extra) |
-taf_extra | --taf_extra) |
1366 |
ac_prev=TAF_EXTRA ;; |
ac_prev=TAF_EXTRA ;; |
1367 |
-taf_extra=* | --taf_extra=*) |
-taf_extra=* | --taf_extra=*) |
1397 |
echo "WARNING: genmake2 has detected a copy of the old-style \"./.genmakerc\"" |
echo "WARNING: genmake2 has detected a copy of the old-style \"./.genmakerc\"" |
1398 |
echo " file. This file format is no longer supported. For directions on" |
echo " file. This file format is no longer supported. For directions on" |
1399 |
echo " how to setup and use the new \"genmake2\" script, please see:" |
echo " how to setup and use the new \"genmake2\" script, please see:" |
1400 |
echo " http://mitgcm.org/devel_HOWTO/" |
echo " http://mitgcm.org/public/devel_HOWTO/" |
1401 |
echo " and send an email to MITgcm-support@mitgcm.org if you need help." |
echo " and send an email to MITgcm-support@mitgcm.org if you need help." |
1402 |
echo "WARNING: ignore \"./.genmakerc\" and continue." |
echo "WARNING: ignore \"./.genmakerc\" and continue." |
1403 |
echo |
echo |
1412 |
for d in . .. ../.. ../../.. ../../../.. ../../../../.. ; do |
for d in . .. ../.. ../../.. ../../../.. ../../../../.. ; do |
1413 |
if [ -d "$d/model" -a -d "$d/eesupp" -a -d "$d/pkg" ]; then |
if [ -d "$d/model" -a -d "$d/eesupp" -a -d "$d/pkg" ]; then |
1414 |
ROOTDIR=$d |
ROOTDIR=$d |
1415 |
printf "Warning: ROOTDIR was not specified but there appears to be" |
printf "Warning: ROOTDIR was not specified ;" |
1416 |
echo " a copy of MITgcm at \"$ROOTDIR\" so we'll try it." |
echo " try using a local copy of MITgcm found at \"$ROOTDIR\"" |
1417 |
break |
break |
1418 |
fi |
fi |
1419 |
done |
done |
1445 |
MAKEFILE="Makefile" |
MAKEFILE="Makefile" |
1446 |
fi |
fi |
1447 |
|
|
1448 |
echo " getting OPTFILE information: " |
echo " getting OPTFILE information:" |
1449 |
if test "x${OPTFILE}" = x ; then |
if test "x${OPTFILE}" = x ; then |
1450 |
if test "x$MITGCM_OF" = x ; then |
if test "x$MITGCM_OF" = x ; then |
1451 |
echo "Warning: no OPTFILE specified so we'll look for possible settings" |
echo "Warning: no OPTFILE specified so we'll look for possible settings" |
1474 |
fi |
fi |
1475 |
fi |
fi |
1476 |
|
|
1477 |
echo " getting AD_OPTFILE information: " |
echo " getting AD_OPTFILE information:" |
1478 |
if test "x${AD_OPTFILE}" = x ; then |
if test "x${AD_OPTFILE}" = x ; then |
1479 |
if test "x$MITGCM_AD_OF" = x ; then |
if test "x$MITGCM_AD_OF" = x ; then |
1480 |
AD_OPTFILE=$ROOTDIR/tools/adjoint_options/adjoint_default |
AD_OPTFILE=$ROOTDIR/tools/adjoint_options/adjoint_default |
1520 |
EOF |
EOF |
1521 |
exit 1 |
exit 1 |
1522 |
fi |
fi |
1523 |
|
if test "x$GET_FC_VERSION" != x ; then |
1524 |
|
echo "Get compiler version using: $FC $GET_FC_VERSION" >> $LOGFILE |
1525 |
|
$FC $GET_FC_VERSION >> $LOGFILE 2> /dev/null |
1526 |
|
echo "<-- compiler version ----" >> $LOGFILE |
1527 |
|
fi |
1528 |
|
|
1529 |
if test "x$CC" = x ; then |
if test "x$CC" = x ; then |
1530 |
look_for_C_compilers |
look_for_C_compilers |
2686 |
\$(EXECUTABLE): \$(SPECIAL_FILES) \$(F77_SRC_FILES) \$(C_SRC_FILES) \$(H_SRC_FILES) \$(F90_SRC_FILES) \$(OBJFILES) \$(EMBEDDED_FILES) |
\$(EXECUTABLE): \$(SPECIAL_FILES) \$(F77_SRC_FILES) \$(C_SRC_FILES) \$(H_SRC_FILES) \$(F90_SRC_FILES) \$(OBJFILES) \$(EMBEDDED_FILES) |
2687 |
@echo Creating \$@ ... |
@echo Creating \$@ ... |
2688 |
\$(LINK) -o \$@ \$(FFLAGS) \$(FOPTIM) \$(OBJFILES) \$(LIBS) |
\$(LINK) -o \$@ \$(FFLAGS) \$(FOPTIM) \$(OBJFILES) \$(LIBS) |
2689 |
|
|
2690 |
depend: |
depend: |
2691 |
@make links |
@make links |
2692 |
\$(MAKEDEPEND) -o .$FS \$(DEFINES) \$(INCLUDES) \$(F77_SRC_FILES) |
\$(MAKEDEPEND) -o .$FS \$(DEFINES) \$(INCLUDES) \$(F77_SRC_FILES) |
2699 |
ar rcv libmitgcmuv.a \$(OBJFILES) |
ar rcv libmitgcmuv.a \$(OBJFILES) |
2700 |
ar d libmitgcmuv.a main.o |
ar d libmitgcmuv.a main.o |
2701 |
|
|
2702 |
|
obj: \$(OBJFILES) |
2703 |
|
|
2704 |
links: \$(F77_SRC_FILES) \$(C_SRC_FILES) \$(H_SRC_FILES) \$(F90_SRC_FILES) \$(SPECIAL_FILES) |
links: \$(F77_SRC_FILES) \$(C_SRC_FILES) \$(H_SRC_FILES) \$(F90_SRC_FILES) \$(SPECIAL_FILES) |
2705 |
|
|
2706 |
small_f: \$(F77_PP_SRC_FILES) \$(F90_PP_SRC_FILES) |
small_f: \$(F77_PP_SRC_FILES) \$(F90_PP_SRC_FILES) |
2720 |
Clean: |
Clean: |
2721 |
@make clean |
@make clean |
2722 |
@make cleanlinks |
@make cleanlinks |
2723 |
-rm -f \$(SPECIAL_FILES) f90mkdepend.log |
-rm -f \$(SPECIAL_FILES) f90mkdepend.log $MAKEFILE.old |
2724 |
-rm -f taf_command taf_output taf_ad.log taf_ad_flow.log |
-rm -f taf_command taf_output taf_ad.log taf_ad_flow.log |
2725 |
-rm -f genmake_warnings genmake_errors make.log |
-rm -f genmake_warnings genmake_errors make.log |
2726 |
|
|
2728 |
# and output from a run (plus log files from testreport) |
# and output from a run (plus log files from testreport) |
2729 |
CLEAN: |
CLEAN: |
2730 |
@make Clean |
@make Clean |
2731 |
-rm -f \$(EXECUTABLE) \$(EXE_AD) *.bak $MAKEFILE.old |
-rm -f \$(EXECUTABLE) \$(EXE_AD) *.bak |
2732 |
-rm -f $LOGFILE genmake_state genmake_*optfile genmake.tr_log make.tr_log |
-rm -f $LOGFILE genmake_state genmake_*optfile |
2733 |
|
-rm -f SIZE.h.mpi genmake.tr_log make.tr_log |
2734 |
-find \$(EXEDIR) -name "*.meta" -exec rm {} \; |
-find \$(EXEDIR) -name "*.meta" -exec rm {} \; |
2735 |
-find \$(EXEDIR) -name "*.data" -exec rm {} \; |
-find \$(EXEDIR) -name "*.data" -exec rm {} \; |
2736 |
-find \$(EXEDIR) -name "fort.*" -exec rm {} \; |
-find \$(EXEDIR) -name "fort.*" -exec rm {} \; |
3258 |
for i in $gm_state ; do |
for i in $gm_state ; do |
3259 |
t1="t2=\$$i" |
t1="t2=\$$i" |
3260 |
eval $t1 |
eval $t1 |
3261 |
echo "$i='$t2'" >> genmake_state |
echo "$i='$t2'" | sed -e 's/ */ /g' >> genmake_state |
3262 |
done |
done |
3263 |
fi |
fi |