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 |
358 |
MAKEDEPEND= |
MAKEDEPEND= |
359 |
fi |
fi |
360 |
else |
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 |
echo " --> MAKEDEPEND=${MAKEDEPEND}" >> $LOGFILE |
367 |
fi |
fi |
368 |
fi |
fi |
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 |
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 |
1522 |
fi |
fi |
1523 |
if test "x$GET_FC_VERSION" != x ; then |
if test "x$GET_FC_VERSION" != x ; then |
1524 |
echo "Get compiler version using: $FC $GET_FC_VERSION" >> $LOGFILE |
echo "Get compiler version using: $FC $GET_FC_VERSION" >> $LOGFILE |
1525 |
$FC $GET_FC_VERSION >> $LOGFILE 2>&1 |
$FC $GET_FC_VERSION >> $LOGFILE 2> /dev/null |
1526 |
echo "<-- compiler version ----" >> $LOGFILE |
echo "<-- compiler version ----" >> $LOGFILE |
1527 |
fi |
fi |
1528 |
|
|
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) |
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 |