46 |
PKG_GROUPS=$ROOTDIR"/pkg/pkg_groups" |
PKG_GROUPS=$ROOTDIR"/pkg/pkg_groups" |
47 |
if test -r $PKG_GROUPS ; then |
if test -r $PKG_GROUPS ; then |
48 |
cat $PKG_GROUPS | sed -e 's/#.*$//g' | sed -e 's/:/ : /g' > ./p1.tmp |
cat $PKG_GROUPS | sed -e 's/#.*$//g' | sed -e 's/:/ : /g' > ./p1.tmp |
49 |
cat ./p1.tmp | awk '(NF>2 && $2==":"){ print $0 }' > ./p2.tmp |
cat ./p1.tmp | $AWK '(NF>2 && $2==":"){ print $0 }' > ./p2.tmp |
50 |
matched=0 |
matched=0 |
51 |
for i in $PACKAGES ; do |
for i in $PACKAGES ; do |
52 |
line=`grep "^ *$i" ./p2.tmp` |
line=`grep "^ *$i" ./p2.tmp` |
53 |
RETVAL=$? |
RETVAL=$? |
54 |
if test "x$RETVAL" = x0 ; then |
if test "x$RETVAL" = x0 ; then |
55 |
matched=1 |
matched=1 |
56 |
replace=`echo $line | awk '{ $1=""; $2=""; print $0 }'` |
replace=`echo $line | $AWK '{ $1=""; $2=""; print $0 }'` |
57 |
echo " replacing \"$i\" with: $replace" |
echo " replacing \"$i\" with: $replace" |
58 |
new_packages="$new_packages $replace" |
new_packages="$new_packages $replace" |
59 |
else |
else |
136 |
echo " The possible FORTRAN compilers found in your path are:" |
echo " The possible FORTRAN compilers found in your path are:" |
137 |
echo " "$p_FC |
echo " "$p_FC |
138 |
if test "x$FC" = x ; then |
if test "x$FC" = x ; then |
139 |
FC=`echo $p_FC | awk '{print $1}'` |
FC=`echo $p_FC | $AWK '{print $1}'` |
140 |
fi |
fi |
141 |
fi |
fi |
142 |
|
|
202 |
# strip the comments and then convert the dependency file into |
# strip the comments and then convert the dependency file into |
203 |
# two arrays: PNAME, DNAME |
# two arrays: PNAME, DNAME |
204 |
cat $1 | sed -e 's/#.*$//g' \ |
cat $1 | sed -e 's/#.*$//g' \ |
205 |
| awk 'BEGIN{nn=0;} (NF>0){ for(i=2;i<=NF;i++){nn++; print "PNAME["nn"]="$1"\nDNAME["nn"]="$i} }' \ |
| $AWK 'BEGIN{nn=0;} (NF>0){ for(i=2;i<=NF;i++){nn++; print "PNAME["nn"]="$1"\nDNAME["nn"]="$i} }' \ |
206 |
> ./.pd_tmp |
> ./.pd_tmp |
207 |
source ./.pd_tmp |
source ./.pd_tmp |
208 |
rm -f ./.pd_tmp |
rm -f ./.pd_tmp |
319 |
|
|
320 |
PWD=`pwd` |
PWD=`pwd` |
321 |
MAKE=make |
MAKE=make |
322 |
|
AWK=awk |
323 |
THISHOSTNAME=`hostname` |
THISHOSTNAME=`hostname` |
324 |
THISCWD=`pwd` |
THISCWD=`pwd` |
325 |
THISDATE=`date` |
THISDATE=`date` |
335 |
|
|
336 |
AUTODIFF_PKG_USED=f |
AUTODIFF_PKG_USED=f |
337 |
AD_OPTFILE= |
AD_OPTFILE= |
338 |
|
TAF= |
339 |
|
AD_TAF_FLAGS= |
340 |
|
FTL_TAF_FLAGS= |
341 |
|
SVD_TAF_FLAGS= |
342 |
|
TAF_EXTRA= |
343 |
|
TAMC= |
344 |
|
AD_TAMC_FLAGS= |
345 |
|
FTL_TAF_FLAGS= |
346 |
|
SVD_TAMC_FLAGS= |
347 |
|
TAMC_EXTRA= |
348 |
|
|
349 |
|
|
350 |
# The following state can be set directly by command-line switches |
# The following state can be set directly by command-line switches |
351 |
gm_s1="OPTFILE PDEPEND PDEFAULT MAKEFILE PLATFORM ROOTDIR MODS DISABLE ENABLE NOOPT" |
gm_s1="OPTFILE PDEPEND PDEFAULT MAKEFILE PLATFORM ROOTDIR MODS DISABLE ENABLE NOOPT" |
358 |
gm_s6="EXECUTABLE EXEHOOK EXEDIR PACKAGES_CONF" |
gm_s6="EXECUTABLE EXEHOOK EXEDIR PACKAGES_CONF" |
359 |
|
|
360 |
# The following are all related to adjoint/tangent-linear stuff |
# The following are all related to adjoint/tangent-linear stuff |
361 |
gm_s7="AUTODIFF_PKG_USED AD_OPTFILE TAMC TAF DIFF_FLAGS AD_TAMC_FLAGS AD_TAF_FLAGS" |
gm_s7="AUTODIFF_PKG_USED AD_OPTFILE TAMC TAF AD_TAMC_FLAGS AD_TAF_FLAGS" |
362 |
gm_s8="FTL_TAMC_FLAGS FTL_TAF_FLAGS SVD_TAMC_FLAGS SVD_TAF_FLAGS" |
gm_s8="FTL_TAMC_FLAGS FTL_TAF_FLAGS SVD_TAMC_FLAGS SVD_TAF_FLAGS" |
363 |
gm_s9="" |
gm_s9="TAF_EXTRA TAMC_EXTRA" |
364 |
|
|
365 |
gm_state="COMMANDL $gm_s1 $gm_s2 $gm_s3 $gm_s4 $gm_s5 $gm_s6 $gm_s7 $gm_s8" |
gm_state="COMMANDL $gm_s1 $gm_s2 $gm_s3 $gm_s4 $gm_s5 $gm_s6 $gm_s7 $gm_s8 $gm_s9" |
366 |
|
|
367 |
|
|
368 |
echo |
echo |
507 |
-ds | --ds) |
-ds | --ds) |
508 |
DUMPSTATE=t ;; |
DUMPSTATE=t ;; |
509 |
|
|
510 |
|
-taf_extra | --taf_extra) |
511 |
|
ac_prev=TAF_EXTRA ;; |
512 |
|
-taf_extra=* | --taf_extra=*) |
513 |
|
TAF_EXTRA=$ac_optarg ;; |
514 |
|
|
515 |
|
-tamc_extra | --tamc_extra) |
516 |
|
ac_prev=TAMC_EXTRA ;; |
517 |
|
-tamc_extra=* | --tamc_extra=*) |
518 |
|
TAMC_EXTRA=$ac_optarg ;; |
519 |
|
|
520 |
-*) |
-*) |
521 |
echo "Error: unrecognized option: "$ac_option |
echo "Error: unrecognized option: "$ac_option |
522 |
usage |
usage |
743 |
# Strip the comments and then convert the dependency file into |
# Strip the comments and then convert the dependency file into |
744 |
# two arrays: PNAME, DNAME |
# two arrays: PNAME, DNAME |
745 |
cat $PDEPEND | sed -e 's/#.*$//g' \ |
cat $PDEPEND | sed -e 's/#.*$//g' \ |
746 |
| awk 'BEGIN{nn=-1;} (NF>0){ for(i=2;i<=NF;i++){nn++; print "PNAME_"nn"="$1"\nDNAME_"nn"="$i}} END{print "nname="nn}' \ |
| $AWK 'BEGIN{nn=-1;} (NF>0){ for(i=2;i<=NF;i++){nn++; print "PNAME_"nn"="$1"\nDNAME_"nn"="$i}} END{print "nname="nn}' \ |
747 |
> ./.pd_tmp |
> ./.pd_tmp |
748 |
RETVAL=$? |
RETVAL=$? |
749 |
if test ! "x${RETVAL}" = x0 ; then |
if test ! "x${RETVAL}" = x0 ; then |
777 |
else |
else |
778 |
echo " using PDEFAULT=\"$PDEFAULT\"" |
echo " using PDEFAULT=\"$PDEFAULT\"" |
779 |
# Strip the comments and add all the names |
# Strip the comments and add all the names |
780 |
def=`cat $PDEFAULT | sed -e 's/#.*$//g' | awk '(NF>0){print $0}'` |
def=`cat $PDEFAULT | sed -e 's/#.*$//g' | $AWK '(NF>0){print $0}'` |
781 |
RETVAL=$? |
RETVAL=$? |
782 |
if test "x${RETVAL}" != x0 ; then |
if test "x${RETVAL}" != x0 ; then |
783 |
echo -n "Error: can't parse default package list " |
echo -n "Error: can't parse default package list " |
957 |
fi |
fi |
958 |
done |
done |
959 |
if test "x$has_pack" = xf ; then |
if test "x$has_pack" = xf ; then |
960 |
undef=`echo "ALLOW_$n" | awk '{print toupper($0)}'` |
undef=`echo "ALLOW_$n" | $AWK '{print toupper($0)}'` |
961 |
echo "#undef $undef" >> $PACKAGES_DOT_H".tmp" |
echo "#undef $undef" >> $PACKAGES_DOT_H".tmp" |
962 |
# DEFINES="$DEFINES -U$undef" |
# DEFINES="$DEFINES -U$undef" |
963 |
|
|
983 |
C Packages enabled by genmake: |
C Packages enabled by genmake: |
984 |
EOF |
EOF |
985 |
for i in $PACKAGES ; do |
for i in $PACKAGES ; do |
986 |
def=`echo "ALLOW_$i" | awk '{print toupper($0)}'` |
def=`echo "ALLOW_$i" | $AWK '{print toupper($0)}'` |
987 |
echo "#define $def" >> $PACKAGES_DOT_H".tmp" |
echo "#define $def" >> $PACKAGES_DOT_H".tmp" |
988 |
#eh3 DEFINES="$DEFINES -D$def" |
#eh3 DEFINES="$DEFINES -D$def" |
989 |
|
|
1118 |
for sf in $sfiles ; do |
for sf in $sfiles ; do |
1119 |
if test ! -r ".links.tmp/$sf" ; then |
if test ! -r ".links.tmp/$sf" ; then |
1120 |
if test -f "$d/$sf" ; then |
if test -f "$d/$sf" ; then |
1121 |
extn=`echo $sf | awk -F '.' '{print $NF}'` |
extn=`echo $sf | $AWK -F '.' '{print $NF}'` |
1122 |
touch .links.tmp/$sf |
touch .links.tmp/$sf |
1123 |
deplist="$deplist $sf" |
deplist="$deplist $sf" |
1124 |
case $extn in |
case $extn in |
1295 |
-find \$(EXEDIR) -name "fort.*" -exec rm {} \; |
-find \$(EXEDIR) -name "fort.*" -exec rm {} \; |
1296 |
-rm -f \$(EXECUTABLE) output.txt |
-rm -f \$(EXECUTABLE) output.txt |
1297 |
|
|
1298 |
Makefile: makefile |
#eh3 Makefile: makefile |
1299 |
makefile: |
makefile: |
1300 |
${0} $@ |
${0} $@ |
1301 |
cleanlinks: |
cleanlinks: |
1325 |
TAMC = ${TAMC} |
TAMC = ${TAMC} |
1326 |
TAF = ${TAF} |
TAF = ${TAF} |
1327 |
|
|
1328 |
|
TAF_EXTRA = ${TAF_EXTRA} |
1329 |
|
TAMC_EXTRA = ${TAMC_EXTRA} |
1330 |
|
|
1331 |
EOF |
EOF |
1332 |
|
|
1333 |
ad_vars="AD_TAMC_FLAGS AD_TAF_FLAGS" |
ad_vars="AD_TAMC_FLAGS AD_TAF_FLAGS" |
1353 |
|
|
1354 |
cat >>$MAKEFILE <<EOF |
cat >>$MAKEFILE <<EOF |
1355 |
|
|
|
|
|
1356 |
ad_input_code.f: \$(F77FILES) |
ad_input_code.f: \$(F77FILES) |
1357 |
@make \$(AD_FLOW_FILES) |
@make \$(AD_FLOW_FILES) |
1358 |
cat \$(AD_FLOW_FILES) \$(AD_FILES) > ad_input_code.f |
cat \$(AD_FLOW_FILES) \$(AD_FILES) > ad_input_code.f |
1359 |
|
|
1360 |
|
# ... AD ... |
1361 |
ad_taf_output.f: ad_input_code.f |
ad_taf_output.f: ad_input_code.f |
1362 |
\$(TAF) \$(AD_TAF_FLAGS) ad_input_code.f |
\$(TAF) \$(AD_TAF_FLAGS) \$(TAF_EXTRA) ad_input_code.f |
1363 |
cat ad_input_code_ad.f | sed -f adjoint_sed > ad_taf_output.f |
cat ad_input_code_ad.f | sed -f adjoint_sed > ad_taf_output.f |
1364 |
|
|
1365 |
ad_taf: ad_taf_output.o \$(OBJFILES) |
ad_taf: ad_taf_output.o \$(OBJFILES) |
1366 |
\$(LINK) -o ${EXECUTABLE} \$(FFLAGS) \$(FOPTIM) \$(OBJFILES) ad_taf_output.o \$(LIBS) |
\$(LINK) -o ${EXECUTABLE} \$(FFLAGS) \$(FOPTIM) \$(OBJFILES) ad_taf_output.o \$(LIBS) |
1367 |
|
|
|
|
|
1368 |
ad_tamc_output.f: ad_input_code.f |
ad_tamc_output.f: ad_input_code.f |
1369 |
\$(TAMC) \$(AD_TAMC_FLAGS) ad_input_code.f |
\$(TAMC) \$(AD_TAMC_FLAGS) \$(TAMC_EXTRA) ad_input_code.f |
1370 |
cat ad_input_code_ad.f | sed -f adjoint_sed > ad_taf_output.f |
cat ad_input_code_ad.f | sed -f adjoint_sed > ad_tamc_output.f |
1371 |
|
|
1372 |
ad_tamc: ad_tamc_output.o \$(OBJFILES) |
ad_tamc: ad_tamc_output.o \$(OBJFILES) |
1373 |
\$(LINK) -o ${EXECUTABLE} \$(FFLAGS) \$(FOPTIM) \$(OBJFILES) ad_tamc_output.o \$(LIBS) |
\$(LINK) -o ${EXECUTABLE} \$(FFLAGS) \$(FOPTIM) \$(OBJFILES) ad_tamc_output.o \$(LIBS) |
1374 |
|
|
1375 |
|
|
1376 |
flt_taf_output.f: ad_input_code.f |
# ... FTL ... |
1377 |
\$(TAF) \$(FTL_TAF_FLAGS) ad_input_code.f |
ftl_taf_output.f: ad_input_code.f |
1378 |
cat ad_input_code_ad.f | sed -f adjoint_sed > flt_taf_output.f |
\$(TAF) \$(FTL_TAF_FLAGS) \$(TAF_EXTRA) ad_input_code.f |
1379 |
|
cat ad_input_code_ad.f | sed -f adjoint_sed > ftl_taf_output.f |
1380 |
|
|
1381 |
|
ftl_taf: ftl_taf_output.o \$(OBJFILES) |
1382 |
|
\$(LINK) -o ${EXECUTABLE} \$(FFLAGS) \$(FOPTIM) \$(OBJFILES) ftl_taf_output.o \$(LIBS) |
1383 |
|
|
1384 |
|
ftl_tamc_output.f: ad_input_code.f |
1385 |
|
\$(TAMC) \$(FTL_TAMC_FLAGS) \$(TAMC_EXTRA) ad_input_code.f |
1386 |
|
cat ad_input_code_ad.f | sed -f adjoint_sed > ftl_tamc_output.f |
1387 |
|
|
1388 |
|
ftl_tamc: ftl_tamc_output.o \$(OBJFILES) |
1389 |
|
\$(LINK) -o ${EXECUTABLE} \$(FFLAGS) \$(FOPTIM) \$(OBJFILES) ftl_tamc_output.o \$(LIBS) |
1390 |
|
|
1391 |
|
|
1392 |
flt_taf: flt_taf_output.o \$(OBJFILES) |
# ... SVD ... |
1393 |
\$(LINK) -o ${EXECUTABLE} \$(FFLAGS) \$(FOPTIM) \$(OBJFILES) flt_taf_output.o \$(LIBS) |
svd_taf_output.f: ad_input_code.f |
1394 |
|
\$(TAF) \$(SVD_TAF_FLAGS) \$(TAF_EXTRA) ad_input_code.f |
1395 |
|
cat ad_input_code_ad.f | sed -f adjoint_sed > svd_taf_output.f |
1396 |
|
|
1397 |
|
svd_taf: svd_taf_output.o \$(OBJFILES) |
1398 |
|
\$(LINK) -o ${EXECUTABLE} \$(FFLAGS) \$(FOPTIM) \$(OBJFILES) svd_taf_output.o \$(LIBS) |
1399 |
|
|
1400 |
|
|
1401 |
#========================================= |
#========================================= |