305 |
FS90='fr9' |
FS90='fr9' |
306 |
check_for_broken_Ff |
check_for_broken_Ff |
307 |
else |
else |
308 |
cat <<EOF 2>&1 |
echo "ERROR: test: '$MAKE -f $MAKEFILE genmake_hello.$tfs' Failed" |
309 |
ERROR: Your file system cannot distinguish between *.F and *.f files |
echo " see simple makefile: '$MAKEFILE' (left here)" |
310 |
(fails the "make/ln" test) and this program cannot find a suitable |
echo " Please check (1) your '$MAKE' command, (2) your '$LN' command" |
311 |
replacement extension. Please try a different build environment or |
echo " and (3) the allowed sufix '.F' and '.$tfs' in makefile" |
312 |
contact the <MITgcm-support@mitgcm.org> list for help. |
echo " or contact the <MITgcm-support@mitgcm.org> list for help." |
313 |
|
echo "" |
|
EOF |
|
314 |
exit -1 |
exit -1 |
315 |
return |
return |
316 |
fi |
fi |
577 |
if test "x$OPTFILE" = x ; then |
if test "x$OPTFILE" = x ; then |
578 |
OPTFILE=$ROOTDIR"/tools/build_options/"$PLATFORM"_"$FC |
OPTFILE=$ROOTDIR"/tools/build_options/"$PLATFORM"_"$FC |
579 |
if test ! -r $OPTFILE ; then |
if test ! -r $OPTFILE ; then |
580 |
echo " I looked for the file "$OPTFILE" but did not find it" |
echo " I looked for the file "$OPTFILE" but did not find it" |
581 |
fi |
fi |
582 |
fi |
fi |
583 |
|
|
584 |
if test "x$OPTFILE" = x ; then |
if test "x$OPTFILE" = x ; then |
649 |
|
|
650 |
#echo "FC_NAMEMANGLE = \"$FC_NAMEMANGLE\"" |
#echo "FC_NAMEMANGLE = \"$FC_NAMEMANGLE\"" |
651 |
if test ! "x$FC_NAMEMANGLE" = x ; then |
if test ! "x$FC_NAMEMANGLE" = x ; then |
652 |
return 0 |
return 0 |
653 |
fi |
fi |
654 |
echo " running: get_fortran_c_namemangling()" >> $LOGFILE |
echo " running: get_fortran_c_namemangling()" >> $LOGFILE |
655 |
|
|
1036 |
echo "running: check_lapack_libs()" >> $LOGFILE |
echo "running: check_lapack_libs()" >> $LOGFILE |
1037 |
cat <<EOF > genmake_tla.F |
cat <<EOF > genmake_tla.F |
1038 |
program fgenla |
program fgenla |
1039 |
integer info |
integer info |
1040 |
integer ipiv( 2 ) |
integer ipiv( 2 ) |
1041 |
double precision ab( 4, 2 ), b( 2 ) |
double precision ab( 4, 2 ), b( 2 ) |
1042 |
data ab / 0., 0., 1., 2., 0., 2., 1., 0. / |
data ab / 0., 0., 1., 2., 0., 2., 1., 0. / |
1107 |
LIBS="$LIBS -llapack -lf77blas -lcblas" |
LIBS="$LIBS -llapack -lf77blas -lcblas" |
1108 |
HAVE_LAPACK=t |
HAVE_LAPACK=t |
1109 |
echo "check_lapack: successful" >> $LOGFILE |
echo "check_lapack: successful" >> $LOGFILE |
1110 |
else |
else |
1111 |
# try again with "-latlas" added to the libs |
# try again with "-latlas" added to the libs |
1112 |
echo "==> try again with added '-llapack -lf77blas -lcblas -latlas'" > genmake_tla.log |
echo "==> try again with added '-llapack -lf77blas -lcblas -latlas'" > genmake_tla.log |
1113 |
echo "cat genmake_tla.F | $CPP $DEFINES $INCLUDES > genmake_tla.$FS \ " >> genmake_tla.log |
echo "cat genmake_tla.F | $CPP $DEFINES $INCLUDES > genmake_tla.$FS \ " >> genmake_tla.log |
1114 |
echo " && $FC $FFLAGS $FOPTIM -c genmake_tla.$FS \ " >> genmake_tla.log |
echo " && $FC $FFLAGS $FOPTIM -c genmake_tla.$FS \ " >> genmake_tla.log |
1115 |
echo " && $LINK $FFLAGS $FOPTIM -o genmake_tla genmake_tla.o $LIBS -llapack -lf77blas -lcblas -latlas" >> genmake_tla.log |
echo " && $LINK $FFLAGS $FOPTIM -o genmake_tla genmake_tla.o $LIBS -llapack -lf77blas -lcblas -latlas" >> genmake_tla.log |
1116 |
cat genmake_tla.F | $CPP $DEFINES $INCLUDES > genmake_tla.$FS 2>/dev/null \ |
cat genmake_tla.F | $CPP $DEFINES $INCLUDES > genmake_tla.$FS 2>/dev/null \ |
1117 |
&& $FC $FFLAGS $FOPTIM -c genmake_tla.$FS >> genmake_tla.log 2>&1 \ |
&& $FC $FFLAGS $FOPTIM -c genmake_tla.$FS >> genmake_tla.log 2>&1 \ |
1118 |
&& $LINK $FFLAGS $FOPTIM -o genmake_tla genmake_tla.o $LIBS -llapack -lf77blas -lcblas -latlas >> genmake_tla.log 2>&1 |
&& $LINK $FFLAGS $FOPTIM -o genmake_tla genmake_tla.o $LIBS -llapack -lf77blas -lcblas -latlas >> genmake_tla.log 2>&1 |
1119 |
RET_COMPILE=$? |
RET_COMPILE=$? |
1120 |
echo >> $LOGFILE |
echo >> $LOGFILE |
1121 |
cat genmake_tla.log >> $LOGFILE |
cat genmake_tla.log >> $LOGFILE |
1122 |
if test "x$RET_COMPILE" = x0 ; then |
if test "x$RET_COMPILE" = x0 ; then |
1123 |
LIBS="$LIBS -llapack -lf77blas -lcblas -latlas" |
LIBS="$LIBS -llapack -lf77blas -lcblas -latlas" |
1124 |
HAVE_LAPACK=t |
HAVE_LAPACK=t |
1125 |
echo "check_lapack: successful" >> $LOGFILE |
echo "check_lapack: successful" >> $LOGFILE |
1126 |
fi |
fi |
1127 |
fi |
fi |
1128 |
fi |
fi |
1129 |
fi |
fi |
1305 |
ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` |
ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` |
1306 |
|
|
1307 |
case $ac_option in |
case $ac_option in |
1308 |
|
|
1309 |
-help | --help | -h | --h) |
-help | --help | -h | --h) |
1310 |
usage ;; |
usage ;; |
1311 |
|
|
1312 |
-nooptfile | --nooptfile) |
-nooptfile | --nooptfile) |
1313 |
OPTFILE="NONE" ;; |
OPTFILE="NONE" ;; |
1314 |
-optfile | --optfile | -of | --of) |
-optfile | --optfile | -of | --of) |
1315 |
ac_prev=OPTFILE ;; |
ac_prev=OPTFILE ;; |
1316 |
-optfile=* | --optfile=* | -of=* | --of=*) |
-optfile=* | --optfile=* | -of=* | --of=*) |
1317 |
OPTFILE=$ac_optarg ;; |
OPTFILE=$ac_optarg ;; |
1318 |
|
|
1319 |
-adoptfile | --adoptfile | -adof | --adof) |
-adoptfile | --adoptfile | -adof | --adof) |
1320 |
ac_prev=AD_OPTFILE ;; |
ac_prev=AD_OPTFILE ;; |
1321 |
-adoptfile=* | --adoptfile=* | -adof=* | --adof=*) |
-adoptfile=* | --adoptfile=* | -adof=* | --adof=*) |
1322 |
AD_OPTFILE=$ac_optarg ;; |
AD_OPTFILE=$ac_optarg ;; |
1323 |
|
|
1324 |
-pdepend | --pdepend) |
-pdepend | --pdepend) |
1325 |
ac_prev=PKG_DEPEND ;; |
ac_prev=PKG_DEPEND ;; |
1326 |
-pdepend=* | --pdepend=*) |
-pdepend=* | --pdepend=*) |
1327 |
PKG_DEPEND=$ac_optarg ;; |
PKG_DEPEND=$ac_optarg ;; |
1328 |
|
|
1329 |
-pgroups | --pgroups) |
-pgroups | --pgroups) |
1330 |
ac_prev=PKG_GROUPS ;; |
ac_prev=PKG_GROUPS ;; |
1331 |
-pgroups=* | --pgroups=*) |
-pgroups=* | --pgroups=*) |
1332 |
PKG_GROUPS=$ac_optarg ;; |
PKG_GROUPS=$ac_optarg ;; |
1333 |
|
|
1334 |
-make | --make | -m | --m) |
-make | --make | -m | --m) |
1335 |
ac_prev=MAKE ;; |
ac_prev=MAKE ;; |
1336 |
-make=* | --make=* | -m=* | --m=*) |
-make=* | --make=* | -m=* | --m=*) |
1337 |
MAKE=$ac_optarg ;; |
MAKE=$ac_optarg ;; |
1338 |
|
|
1339 |
-bash | --bash) |
-bash | --bash) |
1340 |
ac_prev=BASH ;; |
ac_prev=BASH ;; |
1341 |
-bash=* | --bash=*) |
-bash=* | --bash=*) |
1342 |
BASH=$ac_optarg ;; |
BASH=$ac_optarg ;; |
1343 |
|
|
1344 |
-makedepend | --makedepend | -md | --md) |
-makedepend | --makedepend | -md | --md) |
1345 |
ac_prev=MAKEDEPEND ;; |
ac_prev=MAKEDEPEND ;; |
1346 |
-makedepend=* | --makedepend=* | -md=* | --md=*) |
-makedepend=* | --makedepend=* | -md=* | --md=*) |
1347 |
MAKEDEPEND=$ac_optarg ;; |
MAKEDEPEND=$ac_optarg ;; |
1348 |
|
|
1349 |
-makefile | --makefile | -ma | --ma) |
-makefile | --makefile | -ma | --ma) |
1350 |
ac_prev=MAKEFILE ;; |
ac_prev=MAKEFILE ;; |
1351 |
-makefile=* | --makefile=* | -ma=* | --ma=*) |
-makefile=* | --makefile=* | -ma=* | --ma=*) |
1352 |
MAKEFILE=$ac_optarg ;; |
MAKEFILE=$ac_optarg ;; |
1353 |
|
|
1354 |
-platform | --platform | -pl | --pl | -platform=* | --platform=* | -pl=* | --pl=*) |
-platform | --platform | -pl | --pl | -platform=* | --platform=* | -pl=* | --pl=*) |
1355 |
echo "ERROR: The platform option has been removed. Please specify" |
echo "ERROR: The platform option has been removed. Please specify" |
1356 |
echo " the build options using the \"optfile\" mechanism." |
echo " the build options using the \"optfile\" mechanism." |
1357 |
echo |
echo |
1358 |
usage |
usage |
1359 |
;; |
;; |
1360 |
|
|
1361 |
-rootdir | --rootdir | -rd | --rd) |
-rootdir | --rootdir | -rd | --rd) |
1362 |
ac_prev=ROOTDIR ;; |
ac_prev=ROOTDIR ;; |
1363 |
-rootdir=* | --rootdir=* | -rd=* | --rd=*) |
-rootdir=* | --rootdir=* | -rd=* | --rd=*) |
1364 |
ROOTDIR=$ac_optarg ;; |
ROOTDIR=$ac_optarg ;; |
1365 |
|
|
1366 |
-mods | --mods | -mo | --mo) |
-mods | --mods | -mo | --mo) |
1367 |
ac_prev=MODS ;; |
ac_prev=MODS ;; |
1368 |
-mods=* | --mods=* | -mo=* | --mo=*) |
-mods=* | --mods=* | -mo=* | --mo=*) |
1369 |
MODS=$ac_optarg ;; |
MODS=$ac_optarg ;; |
1370 |
|
|
1371 |
-disable | --disable) |
-disable | --disable) |
1372 |
ac_prev=DISABLE ;; |
ac_prev=DISABLE ;; |
1373 |
-disable=* | --disable=*) |
-disable=* | --disable=*) |
1374 |
DISABLE=$ac_optarg ;; |
DISABLE=$ac_optarg ;; |
1375 |
|
|
1376 |
-enable | --enable) |
-enable | --enable) |
1377 |
ac_prev=ENABLE ;; |
ac_prev=ENABLE ;; |
1378 |
-enable=* | --enable=*) |
-enable=* | --enable=*) |
1379 |
ENABLE=$ac_optarg ;; |
ENABLE=$ac_optarg ;; |
1380 |
|
|
1381 |
-standarddirs | --standarddirs) |
-standarddirs | --standarddirs) |
1382 |
ac_prev=STANDARDDIRS ;; |
ac_prev=STANDARDDIRS ;; |
1383 |
-standarddirs=* | --standarddirs=*) |
-standarddirs=* | --standarddirs=*) |
1387 |
# ac_prev=cpp ;; |
# ac_prev=cpp ;; |
1388 |
# -cpp=* | --cpp=*) |
# -cpp=* | --cpp=*) |
1389 |
# CPP=$ac_optarg ;; |
# CPP=$ac_optarg ;; |
1390 |
|
|
1391 |
-cc | --cc) |
-cc | --cc) |
1392 |
ac_prev=CC ;; |
ac_prev=CC ;; |
1393 |
-cc=* | --cc=*) |
-cc=* | --cc=*) |
1394 |
CC=$ac_optarg ;; |
CC=$ac_optarg ;; |
1395 |
|
|
1396 |
-fortran | --fortran | -fc | --fc) |
-fortran | --fortran | -fc | --fc) |
1397 |
ac_prev=FC ;; |
ac_prev=FC ;; |
1398 |
-fc=* | --fc=*) |
-fc=* | --fc=*) |
1399 |
FC=$ac_optarg ;; |
FC=$ac_optarg ;; |
1400 |
|
|
1401 |
-fs | --fs) |
-fs | --fs) |
1402 |
ac_prev=FS ;; |
ac_prev=FS ;; |
1403 |
-fs=* | --fs=*) |
-fs=* | --fs=*) |
1404 |
FS=$ac_optarg ;; |
FS=$ac_optarg ;; |
1405 |
|
|
1406 |
-fs90 | --fs90) |
-fs90 | --fs90) |
1407 |
ac_prev=FS90 ;; |
ac_prev=FS90 ;; |
1408 |
-fs90=* | --fs90=*) |
-fs90=* | --fs90=*) |
1409 |
FS90=$ac_optarg ;; |
FS90=$ac_optarg ;; |
1410 |
|
|
1411 |
-use_real4 | -use_r4 | -ur4 | --use_real4 | --use_r4 | --ur4 ) |
-use_real4 | -use_r4 | -ur4 | --use_real4 | --use_r4 | --ur4 ) |
1412 |
USE_R4=true ;; |
USE_R4=true ;; |
1413 |
|
|
1440 |
-mpi=* | --mpi=*) |
-mpi=* | --mpi=*) |
1441 |
MPIPATH=$ac_optarg |
MPIPATH=$ac_optarg |
1442 |
MPI=true ;; |
MPI=true ;; |
1443 |
|
|
1444 |
-omp | --omp) |
-omp | --omp) |
1445 |
OMP=true ;; |
OMP=true ;; |
1446 |
-omp=* | --omp=*) |
-omp=* | --omp=*) |
1447 |
OMPFLAG=$ac_optarg |
OMPFLAG=$ac_optarg |
1448 |
OMP=true ;; |
OMP=true ;; |
1449 |
|
|
1450 |
-ds | --ds) |
-ds | --ds) |
1451 |
DUMPSTATE=t ;; |
DUMPSTATE=t ;; |
1452 |
|
|
1453 |
-extra_flag | --extra_flag) |
-extra_flag | --extra_flag) |
1454 |
ac_prev=FEXTRAFLAGS ;; |
ac_prev=FEXTRAFLAGS ;; |
1455 |
-extra_flag=* | --extra_flag=*) |
-extra_flag=* | --extra_flag=*) |
1456 |
FEXTRAFLAGS=$ac_optarg ;; |
FEXTRAFLAGS=$ac_optarg ;; |
1457 |
|
|
1458 |
-taf_extra | --taf_extra) |
-taf_extra | --taf_extra) |
1459 |
ac_prev=TAF_EXTRA ;; |
ac_prev=TAF_EXTRA ;; |
1460 |
-taf_extra=* | --taf_extra=*) |
-taf_extra=* | --taf_extra=*) |
1464 |
ac_prev=TAMC_EXTRA ;; |
ac_prev=TAMC_EXTRA ;; |
1465 |
-tamc_extra=* | --tamc_extra=*) |
-tamc_extra=* | --tamc_extra=*) |
1466 |
TAMC_EXTRA=$ac_optarg ;; |
TAMC_EXTRA=$ac_optarg ;; |
1467 |
|
|
1468 |
-ignoretime | -ignore_time | --ignoretime | --ignore_time) |
-ignoretime | -ignore_time | --ignoretime | --ignore_time) |
1469 |
IGNORE_TIME="-DIGNORE_TIME" ;; |
IGNORE_TIME="-DIGNORE_TIME" ;; |
1470 |
|
|
1475 |
echo "Error: unrecognized option: "$ac_option |
echo "Error: unrecognized option: "$ac_option |
1476 |
usage |
usage |
1477 |
;; |
;; |
1478 |
|
|
1479 |
*) |
*) |
1480 |
echo "Error: unrecognized argument: "$ac_option |
echo "Error: unrecognized argument: "$ac_option |
1481 |
usage |
usage |
1482 |
;; |
;; |
1483 |
|
|
1484 |
esac |
esac |
1485 |
|
|
1486 |
done |
done |
1713 |
if test ! "x$TS" = x ; then |
if test ! "x$TS" = x ; then |
1714 |
echo " Turning on timing per timestep" |
echo " Turning on timing per timestep" |
1715 |
if test ! "x$FOOLAD" = x ; then |
if test ! "x$FOOLAD" = x ; then |
1716 |
DEFINES="$DEFINES -DTIME_PER_TIMESTEP_SFP" |
DEFINES="$DEFINES -DTIME_PER_TIMESTEP_SFP" |
1717 |
else |
else |
1718 |
DEFINES="$DEFINES -DTIME_PER_TIMESTEP" |
DEFINES="$DEFINES -DTIME_PER_TIMESTEP" |
1719 |
fi |
fi |
1749 |
echo " Sticking with PAPI flop summary per timestep!" |
echo " Sticking with PAPI flop summary per timestep!" |
1750 |
else |
else |
1751 |
echo " Turning on performance analysis with PAPI" |
echo " Turning on performance analysis with PAPI" |
1752 |
echo " Please make sure PAPIINC, PAPILIB are defined" |
echo " Please make sure PAPIINC, PAPILIB are defined" |
1753 |
DEFINES="$DEFINES -DUSE_PAPI" |
DEFINES="$DEFINES -DUSE_PAPI" |
1754 |
INCLUDES="$INCLUDES $PAPIINC" |
INCLUDES="$INCLUDES $PAPIINC" |
1755 |
LIBS="$LIBS $PAPILIB" |
LIBS="$LIBS $PAPILIB" |
1761 |
echo " Sticking with PCL flop summary per timestep!" |
echo " Sticking with PCL flop summary per timestep!" |
1762 |
else |
else |
1763 |
echo " Turning on performance analysis with PCL" |
echo " Turning on performance analysis with PCL" |
1764 |
echo " Please make sure PCLINC, PCLLIB are defined" |
echo " Please make sure PCLINC, PCLLIB are defined" |
1765 |
DEFINES="$DEFINES -DUSE_PCL" |
DEFINES="$DEFINES -DUSE_PCL" |
1766 |
INCLUDES="$INCLUDES $PCLINC" |
INCLUDES="$INCLUDES $PCLINC" |
1767 |
LIBS="$LIBS $PCLLIB" |
LIBS="$LIBS $PCLLIB" |
1776 |
echo " Sticking with PCL!" |
echo " Sticking with PCL!" |
1777 |
else |
else |
1778 |
echo " Turning on performance analysis with the HPM Toolkit" |
echo " Turning on performance analysis with the HPM Toolkit" |
1779 |
echo " Please make sure HPMTINC, HPMTLIB are defined" |
echo " Please make sure HPMTINC, HPMTLIB are defined" |
1780 |
DEFINES="$DEFINES -DUSE_LIBHPM" |
DEFINES="$DEFINES -DUSE_LIBHPM" |
1781 |
INCLUDES="$INCLUDES $HPMTINC" |
INCLUDES="$INCLUDES $HPMTINC" |
1782 |
LIBS="$LIBS $HPMTLIB" |
LIBS="$LIBS $HPMTLIB" |
1783 |
fi |
fi |
1784 |
fi |
fi |
2155 |
j=`echo $i | sed 's/[-+]//'` |
j=`echo $i | sed 's/[-+]//'` |
2156 |
if test ! -d "$ROOTDIR/pkg/$j" ; then |
if test ! -d "$ROOTDIR/pkg/$j" ; then |
2157 |
echo "Error: dir '$ROOTDIR/pkg/$i' missing for package '$i'" |
echo "Error: dir '$ROOTDIR/pkg/$i' missing for package '$i'" |
2158 |
exit 1 |
exit 1 |
2159 |
fi |
fi |
2160 |
echo $i >> ./.tmp_pack |
echo $i >> ./.tmp_pack |
2161 |
done |
done |
2299 |
|
|
2300 |
# Do we need to add $dname according to the dependency rules? |
# Do we need to add $dname according to the dependency rules? |
2301 |
if test "x$pin" = xt -a "x$plus" = "x+" -a "x$din" = xf ; then |
if test "x$pin" = xt -a "x$plus" = "x+" -a "x$din" = xf ; then |
2302 |
#echo " " $pname ": need to add :" $dname |
#echo " " $pname ": need to add :" $dname |
2303 |
in_dis="f" |
in_dis="f" |
2304 |
for dis in $DISABLE ; do |
for dis in $DISABLE ; do |
2305 |
if test "x$dis" = "x$dname" ; then |
if test "x$dis" = "x$dname" ; then |
2324 |
echo " the dependency rules for \"$dname\"" |
echo " the dependency rules for \"$dname\"" |
2325 |
exit 1 |
exit 1 |
2326 |
fi |
fi |
2327 |
i=`echo "$i + 1" | bc -l` |
i=`echo "$i + 1" | bc -l` |
2328 |
#i=$(( $i + 1 )) |
#i=$(( $i + 1 )) |
2329 |
done |
done |
2330 |
ck=$ck"t" |
ck=$ck"t" |
2365 |
done |
done |
2366 |
if test "x$has_pack" = xf ; then |
if test "x$has_pack" = xf ; then |
2367 |
undef=`echo "ALLOW_$n" | sed -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` |
undef=`echo "ALLOW_$n" | sed -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` |
2368 |
DISABLED_PACKAGES="$DISABLED_PACKAGES -U$undef" |
DISABLED_PACKAGES="$DISABLED_PACKAGES -U$undef" |
2369 |
fi |
fi |
2370 |
fi |
fi |
2371 |
done |
done |
2378 |
#EH3 WARNING : This is an UGLY HACK that needs to be removed!!! |
#EH3 WARNING : This is an UGLY HACK that needs to be removed!!! |
2379 |
case $i in |
case $i in |
2380 |
aim_v23) |
aim_v23) |
2381 |
ENABLED_PACKAGES="$ENABLED_PACKAGES -DALLOW_AIM" |
ENABLED_PACKAGES="$ENABLED_PACKAGES -DALLOW_AIM" |
2382 |
echo "Warning: ALLOW_AIM is set to enable aim_v23." |
echo "Warning: ALLOW_AIM is set to enable aim_v23." |
2383 |
;; |
;; |
2384 |
esac |
esac |
2420 |
if test -f $try -a -r $try -a "x$CPP_OPTIONS" = x ; then |
if test -f $try -a -r $try -a "x$CPP_OPTIONS" = x ; then |
2421 |
echo " found CPP_OPTIONS=\"$try\"" |
echo " found CPP_OPTIONS=\"$try\"" |
2422 |
CPP_OPTIONS="$try" |
CPP_OPTIONS="$try" |
2423 |
# New safety test: make sure packages are not mentioned in CPP_OPTIONS.h |
# New safety test: make sure packages are not mentioned in CPP_OPTIONS.h |
2424 |
for n in $names ; do |
for n in $names ; do |
2425 |
test_for_package_in_cpp_options $CPP_OPTIONS $n |
test_for_package_in_cpp_options $CPP_OPTIONS $n |
2426 |
done |
done |
2427 |
fi |
fi |
2428 |
try="$i/CPP_EEOPTIONS.h" |
try="$i/CPP_EEOPTIONS.h" |
2429 |
if test -f $try -a -r $try -a "x$CPP_EEOPTIONS" = x ; then |
if test -f $try -a -r $try -a "x$CPP_EEOPTIONS" = x ; then |
2430 |
echo " found CPP_EEOPTIONS=\"$try\"" |
echo " found CPP_EEOPTIONS=\"$try\"" |
2431 |
# New safety test: make sure MPI is not determined by CPP_EEOPTIONS.h |
# New safety test: make sure MPI is not determined by CPP_EEOPTIONS.h |
2432 |
#**** not yet enabled **** |
#**** not yet enabled **** |
2433 |
# test_for_mpi_in_cpp_eeoptions $try |
# test_for_mpi_in_cpp_eeoptions $try |
2434 |
#**** not yet enabled **** |
#**** not yet enabled **** |
2574 |
if test ! -r ".links.tmp/$sf" ; then |
if test ! -r ".links.tmp/$sf" ; then |
2575 |
if test -f "$d/$sf" ; then |
if test -f "$d/$sf" ; then |
2576 |
ignore_f=f |
ignore_f=f |
2577 |
case $d/$sf in |
case $d/$sf in |
2578 |
./$PACKAGES_DOT_H) |
./$PACKAGES_DOT_H) |
2579 |
ignore_f=t |
ignore_f=t |
2580 |
;; |
;; |
2581 |
./AD_CONFIG.h) |
./AD_CONFIG.h) |
2582 |
ignore_f=t |
ignore_f=t |
2583 |
;; |
;; |
2584 |
./FC_NAMEMANGLE.h) |
./FC_NAMEMANGLE.h) |
2585 |
ignore_f=t |
ignore_f=t |
2586 |
;; |
;; |
2587 |
./BUILD_INFO.h) |
./BUILD_INFO.h) |
2588 |
ignore_f=t |
ignore_f=t |
2589 |
;; |
;; |
2590 |
./EMBEDDED_FILES.h) |
./EMBEDDED_FILES.h) |
2591 |
ignore_f=t |
ignore_f=t |
2592 |
;; |
;; |
2593 |
*) |
*) |
2594 |
# For the local directory *ONLY*, |
# For the local directory *ONLY*, |
2595 |
# ignore all soft-links |
# ignore all soft-links |
2596 |
if test "x$HAVE_TEST_L" = xt -a "x$d" = x. -a -L $sf ; then |
if test "x$HAVE_TEST_L" = xt -a "x$d" = x. -a -L $sf ; then |
2600 |
deplist="$deplist $sf" |
deplist="$deplist $sf" |
2601 |
fi |
fi |
2602 |
;; |
;; |
2603 |
esac |
esac |
2604 |
if test "x$ignore_f" = xf ; then |
if test "x$ignore_f" = xf ; then |
2605 |
extn=`echo $sf | $AWK -F. '{print $NF}'` |
extn=`echo $sf | $AWK -F. '{print $NF}'` |
2606 |
case $extn in |
case $extn in |
2647 |
echo " \\" >> hsrclist.tmp |
echo " \\" >> hsrclist.tmp |
2648 |
printf " $sf" >> hsrclist.tmp |
printf " $sf" >> hsrclist.tmp |
2649 |
;; |
;; |
2650 |
flow) |
flow) |
2651 |
echo " \\" >> ad_flow_files.tmp |
echo " \\" >> ad_flow_files.tmp |
2652 |
printf " $sf" >> ad_flow_files.tmp |
printf " $sf" >> ad_flow_files.tmp |
2653 |
;; |
;; |
2658 |
done |
done |
2659 |
if test "x$deplist" != x ; then |
if test "x$deplist" != x ; then |
2660 |
if test "$d" != "." ; then |
if test "$d" != "." ; then |
2661 |
echo "" >> srclinks.tmp |
echo "" >> srclinks.tmp |
2662 |
echo "# These files are linked from $d" >> srclinks.tmp |
echo "# These files are linked from $d" >> srclinks.tmp |
2663 |
echo "$deplist :" >> srclinks.tmp |
echo "$deplist :" >> srclinks.tmp |
2664 |
# We need to make sure that the link isn't already there. |
# We need to make sure that the link isn't already there. |
2812 |
echo 'F77_PP_SRC_FILES = $(F77_SRC_FILES:.F=.'$FS')' >> $MAKEFILE |
echo 'F77_PP_SRC_FILES = $(F77_SRC_FILES:.F=.'$FS')' >> $MAKEFILE |
2813 |
echo 'F90_PP_SRC_FILES = $(F90_SRC_FILES:.F90=.'$FS90')' >> $MAKEFILE |
echo 'F90_PP_SRC_FILES = $(F90_SRC_FILES:.F90=.'$FS90')' >> $MAKEFILE |
2814 |
echo 'OBJFILES= $(F77_SRC_FILES:.F=.o) $(C_SRC_FILES:.c=.o) $(F90_SRC_FILES:.F90=.o)' >> $MAKEFILE |
echo 'OBJFILES= $(F77_SRC_FILES:.F=.o) $(C_SRC_FILES:.c=.o) $(F90_SRC_FILES:.F90=.o)' >> $MAKEFILE |
2815 |
echo 'FLOFILES = $(AD_FLOW_FILES:.flow=.flowdir)' >> $MAKEFILE |
echo 'FLOWFILES = $(AD_FLOW_FILES:.flow=.flowdir)' >> $MAKEFILE |
2816 |
echo >> $MAKEFILE |
echo >> $MAKEFILE |
2817 |
echo '.SUFFIXES:' >> $MAKEFILE |
echo '.SUFFIXES:' >> $MAKEFILE |
2818 |
echo '.SUFFIXES: .o .'$FS' .p .F .c .f'$FS90' .'$FS90' .FF90 .F90 .flowdir .flow' >> $MAKEFILE |
echo '.SUFFIXES: .o .'$FS' .p .F .c .f'$FS90' .'$FS90' .FF90 .F90 .flowdir .flow' >> $MAKEFILE |
3004 |
cmp ad_config.template AD_CONFIG.h || cat ad_config.template > AD_CONFIG.h |
cmp ad_config.template AD_CONFIG.h || cat ad_config.template > AD_CONFIG.h |
3005 |
-rm -f ad_config.template |
-rm -f ad_config.template |
3006 |
@make -f \$(MAKEFILE) \$(F77_PP_SRC_FILES) |
@make -f \$(MAKEFILE) \$(F77_PP_SRC_FILES) |
3007 |
@make -f \$(MAKEFILE) \$(FLOFILES) |
@make -f \$(MAKEFILE) \$(FLOWFILES) |
3008 |
cat \$(FLOFILES) \$(AD_FILES) | sed -f \$(TOOLSDIR)/remove_comments_sed > ad_input_code.$FS |
cat \$(FLOWFILES) \$(AD_FILES) | sed -f \$(TOOLSDIR)/remove_comments_sed > ad_input_code.$FS |
3009 |
|
|
3010 |
ad_taf_output.$FS: ad_input_code.$FS |
ad_taf_output.$FS: ad_input_code.$FS |
3011 |
\$(TAF) \$(AD_TAF_FLAGS) \$(TAF_EXTRA) ad_input_code.$FS |
\$(TAF) \$(AD_TAF_FLAGS) \$(TAF_EXTRA) ad_input_code.$FS |
3203 |
%_mod.FF90 : %.h ../OAD_support/cb2mGetModules.csh ../OAD_support/cb2mGetModules.awk |
%_mod.FF90 : %.h ../OAD_support/cb2mGetModules.csh ../OAD_support/cb2mGetModules.awk |
3204 |
../OAD_support/cb2mGetModules.csh $< ../OAD_support/cb2mGetModules.awk |
../OAD_support/cb2mGetModules.csh $< ../OAD_support/cb2mGetModules.awk |
3205 |
|
|
3206 |
# create new header files with USE statements for the new modules made above |
# create new header files with USE statements for the new modules made above |
3207 |
%_mod.h : %.h ../OAD_support/cb2mGetHeaders.csh ../OAD_support/cb2mGetHeaders.awk |
%_mod.h : %.h ../OAD_support/cb2mGetHeaders.csh ../OAD_support/cb2mGetHeaders.awk |
3208 |
../OAD_support/cb2mGetHeaders.csh $< ../OAD_support/cb2mGetHeaders.awk \$(CB2M_F90_SRC_NAMES) |
../OAD_support/cb2mGetHeaders.csh $< ../OAD_support/cb2mGetHeaders.awk \$(CB2M_F90_SRC_NAMES) |
3209 |
|
|
3226 |
cat \$^ > \$@ |
cat \$^ > \$@ |
3227 |
|
|
3228 |
# canonicalizer |
# canonicalizer |
3229 |
ad_input_code_sf.pre.f90 : \$(CB2M_AD_FILES) |
ad_input_code_sf.pre.f90 : \$(CB2M_AD_FILES) |
3230 |
\${OPENADFORTTK_BASE}/tools/SourceProcessing/preProcess.py --timing --r8 -H -S -o \$@ \$^ |
\${OPENADFORTTK_BASE}/tools/SourceProcessing/preProcess.py --timing --r8 -H -S -o \$@ \$^ |
3231 |
|
|
3232 |
# replace stop statements (to avoid the implied unstructured control flow) with print statements |
# replace stop statements (to avoid the implied unstructured control flow) with print statements |
3238 |
\${OPEN64ROOT}/crayf90/sgi/mfef90 -r8 -z -F ad_input_code_sf.pre.s2p.f90 |
\${OPEN64ROOT}/crayf90/sgi/mfef90 -r8 -z -F ad_input_code_sf.pre.s2p.f90 |
3239 |
|
|
3240 |
# WHIRL -> XAIF |
# WHIRL -> XAIF |
3241 |
ad_input_code_sf.pre.s2p.xaif : ad_input_code_sf.pre.s2p.B |
ad_input_code_sf.pre.s2p.xaif : ad_input_code_sf.pre.s2p.B |
3242 |
\${OPENADFORTTK}/bin/whirl2xaif -s -n --debug 1 -o \$@ \$< |
\${OPENADFORTTK}/bin/whirl2xaif -s -n --debug 1 -o \$@ \$< |
3243 |
|
|
3244 |
# XAIF -> XAIF' |
# XAIF -> XAIF' |
3245 |
ad_input_code_sf.pre.s2p.xb.xaif : ad_input_code_sf.pre.s2p.xaif xaif.xsd xaif_base.xsd xaif_inlinable_intrinsics.xsd xaif_derivative_propagator.xsd xaif_output.xsd |
ad_input_code_sf.pre.s2p.xb.xaif : ad_input_code_sf.pre.s2p.xaif xaif.xsd xaif_base.xsd xaif_inlinable_intrinsics.xsd xaif_derivative_propagator.xsd xaif_output.xsd |
3246 |
\${XAIFBOOSTERROOT}/xaifBooster/algorithms/BasicBlockPreaccumulationReverse/driver/oadDriver -f -t forward_step -i \$< -c \${XAIFSCHEMAROOT}/schema/examples/inlinable_intrinsics.xaif -o \$@ -I -r |
\${XAIFBOOSTERROOT}/xaifBooster/algorithms/BasicBlockPreaccumulationReverse/driver/oadDriver -f -t forward_step -i \$< -c \${XAIFSCHEMAROOT}/schema/examples/inlinable_intrinsics.xaif -o \$@ -I -r |
3247 |
|
|
3248 |
# XAIF' -> WHIRL' |
# XAIF' -> WHIRL' |
3249 |
ad_input_code_sf.pre.s2p.xb.x2w.B : ad_input_code_sf.pre.s2p.xb.xaif |
ad_input_code_sf.pre.s2p.xb.x2w.B : ad_input_code_sf.pre.s2p.xb.xaif |
3250 |
\${OPENADFORTTK}/bin/xaif2whirl --debug 1 ad_input_code_sf.pre.s2p.B \$< |
\${OPENADFORTTK}/bin/xaif2whirl --debug 1 ad_input_code_sf.pre.s2p.B \$< |
3251 |
|
|
3252 |
# WHIRL' -> F' |
# WHIRL' -> F' |
3253 |
ad_input_code_sf.pre.s2p.xb.x2w.w2f.f$FS90: ad_input_code_sf.pre.s2p.xb.x2w.B |
ad_input_code_sf.pre.s2p.xb.x2w.w2f.f$FS90: ad_input_code_sf.pre.s2p.xb.x2w.B |
3254 |
\${OPEN64ROOT}/whirl2f/whirl2f -FLIST:ftn_file=\$@ -openad \$< |
\${OPEN64ROOT}/whirl2f/whirl2f -FLIST:ftn_file=\$@ -openad \$< |
3255 |
|
|
3256 |
# insert template directives |
# insert template directives |
3263 |
\${OPENADFORTTK_BASE}/tools/SourceProcessing/postProcess.py --progress --timing --infoUnitFile w2f__types.f90 --outputFormat=fixed --separateOutput --pathSuffix "" --filenameSuffix "_oad" -m r -i ../OAD_support/ad_inline.f \$< |
\${OPENADFORTTK_BASE}/tools/SourceProcessing/postProcess.py --progress --timing --infoUnitFile w2f__types.f90 --outputFormat=fixed --separateOutput --pathSuffix "" --filenameSuffix "_oad" -m r -i ../OAD_support/ad_inline.f \$< |
3264 |
# the target is a placeholder to trigger a single execution of the rule |
# the target is a placeholder to trigger a single execution of the rule |
3265 |
touch \$@ |
touch \$@ |
3266 |
# put this so make knows about the postprocessing output |
# put this so make knows about the postprocessing output |
3267 |
OAD_intrinsics_oad.f \$(CB2M_AD_FILES:.f$FS90=_oad.f): postProcess.tag |
OAD_intrinsics_oad.f \$(CB2M_AD_FILES:.f$FS90=_oad.f): postProcess.tag |
3268 |
|
|
3269 |
# link the XAIF schema files |
# link the XAIF schema files |