208 |
expand_pkg_groups() { |
expand_pkg_groups() { |
209 |
new_packages= |
new_packages= |
210 |
if test -r $PKG_GROUPS ; then |
if test -r $PKG_GROUPS ; then |
211 |
cat $PKG_GROUPS | sed -e 's/#.*$//g' | sed -e 's/:/ : /g' > ./p1.tmp |
cat $PKG_GROUPS | sed -e 's/#.*$//g' | sed -e 's/:/ : /g' > $TMP.p1 |
212 |
cat ./p1.tmp | $AWK '(NF>2 && $2==":"){ print $0 }' > ./p2.tmp |
cat $TMP.p1 | $AWK '(NF>2 && $2==":"){ print $0 }' > $TMP.p2 |
213 |
matched=0 |
matched=0 |
214 |
for i in $PACKAGES ; do |
for i in $PACKAGES ; do |
215 |
line=`grep "^ *$i" ./p2.tmp` |
line=`grep "^ *$i" $TMP.p2` |
216 |
RETVAL=$? |
RETVAL=$? |
217 |
if test "x$RETVAL" = x0 ; then |
if test "x$RETVAL" = x0 ; then |
218 |
matched=1 |
matched=1 |
224 |
fi |
fi |
225 |
done |
done |
226 |
PACKAGES=$new_packages |
PACKAGES=$new_packages |
227 |
rm -f ./p[1,2].tmp |
rm -f $TMP.p[1,2] |
228 |
return $matched |
return $matched |
229 |
else |
else |
230 |
echo "Warning: can't read package groups definition file: $PKG_GROUPS" |
echo "Warning: can't read package groups definition file: $PKG_GROUPS" |
1351 |
gm_s4="LN S64 LINK PACKAGES INCLUDES FFLAGS FOPTIM" |
gm_s4="LN S64 LINK PACKAGES INCLUDES FFLAGS FOPTIM" |
1352 |
gm_s5="CFLAGS LIBS KPP KFLAGS1 KFLAGS2 KPPFILES NOOPTFILES NOOPTFLAGS" |
gm_s5="CFLAGS LIBS KPP KFLAGS1 KFLAGS2 KPPFILES NOOPTFILES NOOPTFLAGS" |
1353 |
gm_s6="PWD TOOLSDIR SOURCEDIRS INCLUDEDIRS EXEDIR EXECUTABLE EXEHOOK" |
gm_s6="PWD TOOLSDIR SOURCEDIRS INCLUDEDIRS EXEDIR EXECUTABLE EXEHOOK" |
1354 |
gm_s7="THISHOST THISUSER THISDATE THISVER MACHINE FC_NAMEMANGLE" |
gm_s7="TMP THISHOST THISUSER THISDATE THISVER MACHINE FC_NAMEMANGLE" |
1355 |
gm_s8="HAVE_NETCDF HAVE_SYSTEM HAVE_FDATE HAVE_ETIME HAVE_LAPACK HAVE_FLUSH" |
gm_s8="HAVE_NETCDF HAVE_SYSTEM HAVE_FDATE HAVE_ETIME HAVE_LAPACK HAVE_FLUSH" |
1356 |
|
|
1357 |
# The following are all related to adjoint/tangent-linear stuff |
# The following are all related to adjoint/tangent-linear stuff |
1576 |
|
|
1577 |
done |
done |
1578 |
|
|
1579 |
|
#TMP=./genmk_$$ |
1580 |
|
#- try to put temporary files in system-local /tmp dir |
1581 |
|
TMP=/tmp/genmk_$$ |
1582 |
|
touch $TMP ; retVal=$? |
1583 |
|
if [ $retVal -eq 0 ] ; then |
1584 |
|
if test ! -r $TMP ; then TMP=./genmk_$$ ; fi |
1585 |
|
else |
1586 |
|
TMP=./genmk_$$ |
1587 |
|
fi |
1588 |
|
rm -f $TMP |
1589 |
|
#echo " temp files: $TMP.*" |
1590 |
|
|
1591 |
printf " getting local config information: " |
printf " getting local config information: " |
1592 |
if test -f $gm_local ; then |
if test -f $gm_local ; then |
1593 |
echo "using $gm_local" |
echo "using $gm_local" |
2249 |
fi |
fi |
2250 |
|
|
2251 |
echo " applying DISABLE settings" |
echo " applying DISABLE settings" |
2252 |
echo "" > ./.tmp_pack |
echo "" > $TMP.pack |
2253 |
for i in $PACKAGES ; do |
for i in $PACKAGES ; do |
2254 |
echo $i >> ./.tmp_pack |
echo $i >> $TMP.pack |
2255 |
done |
done |
2256 |
for i in `grep "-" ./.tmp_pack` ; do |
for i in `grep "-" $TMP.pack` ; do |
2257 |
j=`echo $i | sed 's/[-]//'` |
j=`echo $i | sed 's/[-]//'` |
2258 |
DISABLE="$DISABLE $j" |
DISABLE="$DISABLE $j" |
2259 |
done |
done |
2271 |
done |
done |
2272 |
PACKAGES="$pack" |
PACKAGES="$pack" |
2273 |
echo " applying ENABLE settings" |
echo " applying ENABLE settings" |
2274 |
echo "" > ./.tmp_pack |
echo "" > $TMP.pack |
2275 |
PACKAGES="$PACKAGES $ENABLE" |
PACKAGES="$PACKAGES $ENABLE" |
2276 |
# Test if each explicitly referenced package exists |
# Test if each explicitly referenced package exists |
2277 |
for i in $PACKAGES ; do |
for i in $PACKAGES ; do |
2280 |
echo "Error: dir '$ROOTDIR/pkg/$i' missing for package '$i'" |
echo "Error: dir '$ROOTDIR/pkg/$i' missing for package '$i'" |
2281 |
exit 1 |
exit 1 |
2282 |
fi |
fi |
2283 |
echo $i >> ./.tmp_pack |
echo $i >> $TMP.pack |
2284 |
done |
done |
2285 |
PACKAGES= |
PACKAGES= |
2286 |
for i in `grep -v "-" ./.tmp_pack | sort | uniq` ; do |
for i in `grep -v "-" $TMP.pack | sort | uniq` ; do |
2287 |
PACKAGES="$PACKAGES $i" |
PACKAGES="$PACKAGES $i" |
2288 |
done |
done |
2289 |
rm -f ./.tmp_pack |
rm -f $TMP.pack |
2290 |
echo " packages are: $PACKAGES" |
echo " packages are: $PACKAGES" |
2291 |
|
|
2292 |
# Check for package MNC: if NetCDF is available, then build the MNC |
# Check for package MNC: if NetCDF is available, then build the MNC |
2377 |
fi |
fi |
2378 |
fi |
fi |
2379 |
|
|
2380 |
|
# Make sure the openad package is enabled if using OpenAD |
2381 |
|
if test "x$OPENAD" != x ; then |
2382 |
|
echo " $PACKAGES " | grep ' openad ' > /dev/null 2>&1 |
2383 |
|
RETVAL=$? |
2384 |
|
if test "x$RETVAL" != x0 ; then |
2385 |
|
cat <<EOF |
2386 |
|
|
2387 |
|
********************************************************************* |
2388 |
|
ERROR: when generating an adjoint with OpenAD, the openad package |
2389 |
|
must be enabled. Please add it to packages.conf. |
2390 |
|
********************************************************************* |
2391 |
|
|
2392 |
|
EOF |
2393 |
|
exit 1 |
2394 |
|
fi |
2395 |
|
fi |
2396 |
|
|
2397 |
if test "x${PKG_DEPEND}" != x ; then |
if test "x${PKG_DEPEND}" != x ; then |
2398 |
echo " applying package dependency rules" |
echo " applying package dependency rules" |
2399 |
ck= |
ck= |
2582 |
|
|
2583 |
# Here, we build the list of files to be "run through" the adjoint |
# Here, we build the list of files to be "run through" the adjoint |
2584 |
# compiler. |
# compiler. |
2585 |
if test -f ./adSrcFiles.tmp ; then |
if test -f $TMP.adSrcFiles ; then |
2586 |
rm -f ./adSrcFiles.tmp |
rm -f $TMP.adSrcFiles |
2587 |
fi |
fi |
2588 |
echo " Creating the list of files for the adjoint compiler." |
echo " Creating the list of files for the adjoint compiler." |
2589 |
touch adSrcFiles.tmp |
touch $TMP.adSrcFiles |
2590 |
for i in $SOURCEDIRS ; do |
for i in $SOURCEDIRS ; do |
2591 |
list_files=`( cd $i && ls -1 *.list 2>/dev/null )` |
list_files=`( cd $i && ls -1 *.list 2>/dev/null )` |
2592 |
for j in $list_files ; do |
for j in $list_files ; do |
2593 |
cat $i/$j >> adSrcFiles.tmp |
cat $i/$j >> $TMP.adSrcFiles |
2594 |
done |
done |
2595 |
done |
done |
2596 |
if test ! "x"$FS = "x.f" ; then |
if test ! "x"$FS = "x.f" ; then |
2597 |
cat adSrcFiles.tmp | sed -e "s/\.f/.$FS/g" > adSrcFiles.tmp_f |
cat $TMP.adSrcFiles | sed -e "s/\.f/.$FS/g" > $TMP.adSrcFiles_f |
2598 |
mv -f adSrcFiles.tmp_f adSrcFiles.tmp |
mv -f $TMP.adSrcFiles_f $TMP.adSrcFiles |
2599 |
fi |
fi |
2600 |
|
|
2601 |
echo |
echo |
2617 |
fi |
fi |
2618 |
|
|
2619 |
echo " Determining the list of source and include files" |
echo " Determining the list of source and include files" |
2620 |
rm -rf .links.tmp |
rm -rf $TMP.links |
2621 |
mkdir .links.tmp |
mkdir $TMP.links |
2622 |
touch .links.tmp/foo |
touch $TMP.links/foo |
2623 |
if test ! -r ".links.tmp/foo" ; then |
if test ! -r "$TMP.links/foo" ; then |
2624 |
echo |
echo |
2625 |
echo "ERROR : something is wrong with your directory permissions or" |
echo "ERROR : something is wrong with your directory permissions or" |
2626 |
echo " your user file-creation mask (\"umask\") since creating a" |
echo " your user file-creation mask (\"umask\") since creating a" |
2636 |
echo |
echo |
2637 |
exit 1 |
exit 1 |
2638 |
fi |
fi |
2639 |
rm -f .links.tmp/foo |
rm -f $TMP.links/foo |
2640 |
|
|
2641 |
if test "x$OPENAD" != x ; then |
if test "x$OPENAD" != x ; then |
2642 |
OAD_DONT_COMPILE="/dev/null" |
OAD_DONT_COMPILE="/dev/null" |
2679 |
echo " OpenAD exceptions: " |
echo " OpenAD exceptions: " |
2680 |
fi |
fi |
2681 |
|
|
2682 |
echo "# This section creates symbolic links" > srclinks.tmp |
echo "# This section creates symbolic links" > $TMP.srclinks |
2683 |
echo "" >> srclinks.tmp |
echo "" >> $TMP.srclinks |
2684 |
printf 'F77_SRC_FILES = ' > F77srclist.tmp |
printf 'F77_SRC_FILES = ' > $TMP.F77srclist |
2685 |
printf 'NON_AD_F77_SRC_FILES = ' > nonADF77srclist.tmp |
printf 'NON_AD_F77_SRC_FILES = ' > $TMP.nonADF77srclist |
2686 |
printf 'C_SRC_FILES = ' > csrclist.tmp |
printf 'C_SRC_FILES = ' > $TMP.csrclist |
2687 |
printf 'F90_SRC_FILES = ' > F90srclist.tmp |
printf 'F90_SRC_FILES = ' > $TMP.F90srclist |
2688 |
printf 'H_SRC_FILES = ' > hsrclist.tmp |
printf 'H_SRC_FILES = ' > $TMP.hsrclist |
2689 |
printf 'AD_FLOW_FILES = ' > ad_flow_files.tmp |
printf 'AD_FLOW_FILES = ' > $TMP.ad_flow_files |
2690 |
alldirs="$SOURCEDIRS $INCLUDEDIRS ." |
alldirs="$SOURCEDIRS $INCLUDEDIRS ." |
2691 |
for d in $alldirs ; do |
for d in $alldirs ; do |
2692 |
deplist= |
deplist= |
2696 |
sfiles=`( echo $sfiles | grep -v _cb2m\. )` |
sfiles=`( echo $sfiles | grep -v _cb2m\. )` |
2697 |
fi |
fi |
2698 |
for sf in $sfiles ; do |
for sf in $sfiles ; do |
2699 |
if test ! -r ".links.tmp/$sf" ; then |
if test ! -r "$TMP.links/$sf" ; then |
2700 |
if test -f "$d/$sf" ; then |
if test -f "$d/$sf" ; then |
2701 |
ignore_f=f |
ignore_f=f |
2702 |
case $d/$sf in |
case $d/$sf in |
2721 |
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 |
2722 |
ignore_f=t |
ignore_f=t |
2723 |
else |
else |
2724 |
touch .links.tmp/$sf |
touch $TMP.links/$sf |
2725 |
deplist="$deplist $sf" |
deplist="$deplist $sf" |
2726 |
fi |
fi |
2727 |
;; |
;; |
2730 |
extn=`echo $sf | $AWK -F. '{print $NF}'` |
extn=`echo $sf | $AWK -F. '{print $NF}'` |
2731 |
case $extn in |
case $extn in |
2732 |
F) |
F) |
2733 |
echo " \\" >> F77srclist.tmp |
echo " \\" >> $TMP.F77srclist |
2734 |
printf " $sf" >> F77srclist.tmp |
printf " $sf" >> $TMP.F77srclist |
2735 |
if test "x$OPENAD" = x ; then |
if test "x$OPENAD" = x ; then |
2736 |
basename=${sf%%.F} |
basename=${sf%%.F} |
2737 |
isAD=`egrep ^$basename.f'[ ]*' adSrcFiles.tmp` |
isAD=`egrep ^$basename.f'[ ]*' $TMP.adSrcFiles` |
2738 |
if test -z "$isAD" ; then |
if test -z "$isAD" ; then |
2739 |
echo " \\" >> nonADF77srclist.tmp |
echo " \\" >> $TMP.nonADF77srclist |
2740 |
printf " $sf" >> nonADF77srclist.tmp |
printf " $sf" >> $TMP.nonADF77srclist |
2741 |
fi |
fi |
2742 |
else #- OpenAD case: |
else #- OpenAD case: |
2743 |
basename=${sf%%.F} |
basename=${sf%%.F} |
2744 |
isAD=`egrep ^$basename.f'[ ]*' adSrcFiles.tmp` |
isAD=`egrep ^$basename.f'[ ]*' $TMP.adSrcFiles` |
2745 |
if test -z "$isAD" ; then |
if test -z "$isAD" ; then |
2746 |
toBeIgnored=`egrep ^$basename'[ ]*' ${OAD_DONT_COMPILE}` |
toBeIgnored=`egrep ^$basename'[ ]*' ${OAD_DONT_COMPILE}` |
2747 |
if test -z "$toBeIgnored" ; then |
if test -z "$toBeIgnored" ; then |
2748 |
echo " \\" >> nonADF77srclist.tmp |
echo " \\" >> $TMP.nonADF77srclist |
2749 |
printf " $sf" >> nonADF77srclist.tmp |
printf " $sf" >> $TMP.nonADF77srclist |
2750 |
else |
else |
2751 |
echo " not to be compiled : $sf" |
echo " not to be compiled : $sf" |
2752 |
fi |
fi |
2761 |
echo " original to be kept : $sf" |
echo " original to be kept : $sf" |
2762 |
fi |
fi |
2763 |
if test -n "$notToBeTransformed" -o -n "$untransformedVersionToBeKept" ; then |
if test -n "$notToBeTransformed" -o -n "$untransformedVersionToBeKept" ; then |
2764 |
echo " \\" >> nonADF77srclist.tmp |
echo " \\" >> $TMP.nonADF77srclist |
2765 |
printf " $sf" >> nonADF77srclist.tmp |
printf " $sf" >> $TMP.nonADF77srclist |
2766 |
fi |
fi |
2767 |
fi |
fi |
2768 |
fi |
fi |
2769 |
;; |
;; |
2770 |
F90) |
F90) |
2771 |
echo " \\" >> F90srclist.tmp |
echo " \\" >> $TMP.F90srclist |
2772 |
printf " $sf" >> F90srclist.tmp |
printf " $sf" >> $TMP.F90srclist |
2773 |
;; |
;; |
2774 |
c) |
c) |
2775 |
echo " \\" >> csrclist.tmp |
echo " \\" >> $TMP.csrclist |
2776 |
printf " $sf" >> csrclist.tmp |
printf " $sf" >> $TMP.csrclist |
2777 |
;; |
;; |
2778 |
h) |
h) |
2779 |
echo " \\" >> hsrclist.tmp |
echo " \\" >> $TMP.hsrclist |
2780 |
printf " $sf" >> hsrclist.tmp |
printf " $sf" >> $TMP.hsrclist |
2781 |
;; |
;; |
2782 |
flow) |
flow) |
2783 |
echo " \\" >> ad_flow_files.tmp |
echo " \\" >> $TMP.ad_flow_files |
2784 |
printf " $sf" >> ad_flow_files.tmp |
printf " $sf" >> $TMP.ad_flow_files |
2785 |
;; |
;; |
2786 |
esac |
esac |
2787 |
fi |
fi |
2790 |
done |
done |
2791 |
if test "x$deplist" != x ; then |
if test "x$deplist" != x ; then |
2792 |
if test "$d" != "." ; then |
if test "$d" != "." ; then |
2793 |
echo "" >> srclinks.tmp |
echo "" >> $TMP.srclinks |
2794 |
echo "# These files are linked from $d" >> srclinks.tmp |
echo "# These files are linked from $d" >> $TMP.srclinks |
2795 |
echo "$deplist :" >> srclinks.tmp |
echo "$deplist :" >> $TMP.srclinks |
2796 |
# We need to make sure that the link isn't already there. |
# We need to make sure that the link isn't already there. |
2797 |
# This may happen when make thinks that a header file has to be "remade" |
# This may happen when make thinks that a header file has to be "remade" |
2798 |
# because a module it depends on has changed. In this case we do nothing. |
# because a module it depends on has changed. In this case we do nothing. |
2799 |
printf "\tif [ ! -L \$@ ]; then \$(LN) %s/\$@ \$@; fi\n" $d >> srclinks.tmp |
printf "\tif [ ! -L \$@ ]; then \$(LN) %s/\$@ \$@; fi\n" $d >> $TMP.srclinks |
2800 |
fi |
fi |
2801 |
fi |
fi |
2802 |
done |
done |
2803 |
rm -rf .links.tmp |
rm -rf $TMP.links |
2804 |
echo "" >> F77srclist.tmp |
echo "" >> $TMP.F77srclist |
2805 |
echo "" >> nonADF77srclist.tmp |
echo "" >> $TMP.nonADF77srclist |
2806 |
echo "" >> csrclist.tmp |
echo "" >> $TMP.csrclist |
2807 |
echo "" >> F90srclist.tmp |
echo "" >> $TMP.F90srclist |
2808 |
echo "" >> hsrclist.tmp |
echo "" >> $TMP.hsrclist |
2809 |
echo "" >> ad_flow_files.tmp |
echo "" >> $TMP.ad_flow_files |
2810 |
|
|
2811 |
CMDLINE=$0 |
CMDLINE=$0 |
2812 |
for xx in "$@" ; do nw=`echo $xx | wc -w` |
for xx in "$@" ; do nw=`echo $xx | wc -w` |
2928 |
|
|
2929 |
EOF |
EOF |
2930 |
|
|
2931 |
cat F77srclist.tmp >> $MAKEFILE |
cat $TMP.F77srclist >> $MAKEFILE |
2932 |
cat nonADF77srclist.tmp >> $MAKEFILE |
cat $TMP.nonADF77srclist >> $MAKEFILE |
2933 |
cat csrclist.tmp >> $MAKEFILE |
cat $TMP.csrclist >> $MAKEFILE |
2934 |
cat F90srclist.tmp >> $MAKEFILE |
cat $TMP.F90srclist >> $MAKEFILE |
2935 |
cat hsrclist.tmp >> $MAKEFILE |
cat $TMP.hsrclist >> $MAKEFILE |
2936 |
cat ad_flow_files.tmp >> $MAKEFILE |
cat $TMP.ad_flow_files >> $MAKEFILE |
2937 |
|
|
2938 |
rm -f F77srclist.tmp nonADF77srclist.tmp csrclist.tmp F90srclist.tmp hsrclist.tmp ad_flow_files.tmp |
rm -f $TMP.F77srclist $TMP.nonADF77srclist $TMP.csrclist $TMP.F90srclist $TMP.hsrclist $TMP.ad_flow_files |
2939 |
|
|
2940 |
echo >> $MAKEFILE |
echo >> $MAKEFILE |
2941 |
|
|
3132 |
echo " Add the source list for AD code generation" |
echo " Add the source list for AD code generation" |
3133 |
echo >> $MAKEFILE |
echo >> $MAKEFILE |
3134 |
printf "AD_FILES = " >> $MAKEFILE |
printf "AD_FILES = " >> $MAKEFILE |
3135 |
AD_FILES=`cat adSrcFiles.tmp` |
AD_FILES=`cat $TMP.adSrcFiles` |
3136 |
for i in $AD_FILES ; do |
for i in $AD_FILES ; do |
3137 |
echo " \\" >> $MAKEFILE |
echo " \\" >> $MAKEFILE |
3138 |
printf " $i" >> $MAKEFILE |
printf " $i" >> $MAKEFILE |
3139 |
done |
done |
3140 |
echo >> $MAKEFILE |
echo >> $MAKEFILE |
3141 |
rm -f adSrcFiles.tmp |
rm -f $TMP.adSrcFiles |
3142 |
|
|
3143 |
cat >>$MAKEFILE <<EOF |
cat >>$MAKEFILE <<EOF |
3144 |
|
|
3163 |
cat \$(FLOWFILES) \$(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 |
3164 |
|
|
3165 |
ad_taf_output.$FS: ad_input_code.$FS |
ad_taf_output.$FS: ad_input_code.$FS |
3166 |
|
@-rm -f ad_input_code_ad.$FS ; echo '' |
3167 |
\$(TAF) \$(AD_TAF_FLAGS) \$(TAF_EXTRA) ad_input_code.$FS |
\$(TAF) \$(AD_TAF_FLAGS) \$(TAF_EXTRA) ad_input_code.$FS |
3168 |
ls -l ad_input_code_ad.$FS |
ls -l ad_input_code_ad.$FS |
3169 |
cat ad_input_code_ad.$FS | sed -f \$(TOOLSDIR)/adjoint_sed > ad_taf_output.$FS |
cat ad_input_code_ad.$FS | sed -f \$(TOOLSDIR)/adjoint_sed > ad_taf_output.$FS |
3174 |
cat ad_input_code_ad.$FS | sed -f \$(TOOLSDIR)/adjoint_sed > ad_taf_output.$FS |
cat ad_input_code_ad.$FS | sed -f \$(TOOLSDIR)/adjoint_sed > ad_taf_output.$FS |
3175 |
|
|
3176 |
\$(EXE_AD): \$(SPECIAL_FILES) \$(H_SRC_FILES) ad_taf_output.o \$(NON_AD_F77_SRC_FILES:.F=.o) \$(F90_SRC_FILES:.F90=.o) \$(C_SRC_FILES:.c=.o) \$(EMBEDDED_FILES) |
\$(EXE_AD): \$(SPECIAL_FILES) \$(H_SRC_FILES) ad_taf_output.o \$(NON_AD_F77_SRC_FILES:.F=.o) \$(F90_SRC_FILES:.F90=.o) \$(C_SRC_FILES:.c=.o) \$(EMBEDDED_FILES) |
3177 |
\$(LINK) -o \${EXE_AD} \$(FFLAGS) \$(FOPTIM) ad_taf_output.o \$(NON_AD_F77_SRC_FILES:.F=.o) $(F90_SRC_FILES:.F90=.o) \$(C_SRC_FILES:.c=.o) \$(LIBS) |
\$(LINK) -o \${EXE_AD} \$(FFLAGS) \$(FOPTIM) ad_taf_output.o \$(NON_AD_F77_SRC_FILES:.F=.o) \$(F90_SRC_FILES:.F90=.o) \$(C_SRC_FILES:.c=.o) \$(LIBS) |
3178 |
|
|
3179 |
ad_tamc_output.$FS: ad_input_code.$FS |
ad_tamc_output.$FS: ad_input_code.$FS |
3180 |
\$(TAMC) \$(AD_TAMC_FLAGS) \$(TAMC_EXTRA) ad_input_code.$FS |
\$(TAMC) \$(AD_TAMC_FLAGS) \$(TAMC_EXTRA) ad_input_code.$FS |
3189 |
adtrick: |
adtrick: |
3190 |
patch < \$(TOOLSDIR)/ad_taf_output.f.adtrick.diff |
patch < \$(TOOLSDIR)/ad_taf_output.f.adtrick.diff |
3191 |
|
|
3192 |
adobj: ad_taf_output.o \$(OBJFILES) |
adobj: ad_taf_output.o \$(NON_AD_F77_SRC_FILES:.F=.o) \$(F90_SRC_FILES:.F90=.o) \$(C_SRC_FILES:.c=.o) |
3193 |
|
|
3194 |
# ... FTL ... |
# ... FTL ... |
3195 |
ftlall: ftl_exe_target |
ftlall: ftl_exe_target |
3212 |
cat \$(AD_FLOW_FILES) \$(AD_FILES) | sed -f \$(TOOLSDIR)/remove_comments_sed > ftl_input_code.$FS |
cat \$(AD_FLOW_FILES) \$(AD_FILES) | sed -f \$(TOOLSDIR)/remove_comments_sed > ftl_input_code.$FS |
3213 |
|
|
3214 |
ftl_taf_output.$FS: ftl_input_code.$FS |
ftl_taf_output.$FS: ftl_input_code.$FS |
3215 |
|
@-rm -f ftl_input_code_tl.$FS ; echo '' |
3216 |
\$(TAF) \$(FTL_TAF_FLAGS) \$(TAF_EXTRA) ftl_input_code.$FS |
\$(TAF) \$(FTL_TAF_FLAGS) \$(TAF_EXTRA) ftl_input_code.$FS |
3217 |
ls -l ftl_input_code_tl.$FS |
ls -l ftl_input_code_tl.$FS |
3218 |
cat ftl_input_code_tl.$FS | sed -f \$(TOOLSDIR)/adjoint_sed > ftl_taf_output.$FS |
cat ftl_input_code_tl.$FS | sed -f \$(TOOLSDIR)/adjoint_sed > ftl_taf_output.$FS |
3223 |
cat ftl_input_code_tl.$FS | sed -f \$(TOOLSDIR)/adjoint_sed > ftl_taf_output.$FS |
cat ftl_input_code_tl.$FS | sed -f \$(TOOLSDIR)/adjoint_sed > ftl_taf_output.$FS |
3224 |
|
|
3225 |
\$(EXE_FTL): \$(SPECIAL_FILES) \$(H_SRC_FILES) ftl_taf_output.o \$(NON_AD_F77_SRC_FILES:.F=.o) \$(F90_SRC_FILES:.F90=.o) \$(C_SRC_FILES:.c=.o) \$(EMBEDDED_FILES) |
\$(EXE_FTL): \$(SPECIAL_FILES) \$(H_SRC_FILES) ftl_taf_output.o \$(NON_AD_F77_SRC_FILES:.F=.o) \$(F90_SRC_FILES:.F90=.o) \$(C_SRC_FILES:.c=.o) \$(EMBEDDED_FILES) |
3226 |
\$(LINK) -o \${EXE_FTL} \$(FFLAGS) \$(FOPTIM) ftl_taf_output.o \$(NON_AD_F77_SRC_FILES:.F=.o) $(F90_SRC_FILES:.F90=.o) \$(C_SRC_FILES:.c=.o) \$(LIBS) |
\$(LINK) -o \${EXE_FTL} \$(FFLAGS) \$(FOPTIM) ftl_taf_output.o \$(NON_AD_F77_SRC_FILES:.F=.o) \$(F90_SRC_FILES:.F90=.o) \$(C_SRC_FILES:.c=.o) \$(LIBS) |
3227 |
|
|
3228 |
ftl_tamc_output.$FS: ftl_input_code.$FS |
ftl_tamc_output.$FS: ftl_input_code.$FS |
3229 |
\$(TAMC) \$(FTL_TAMC_FLAGS) \$(TAMC_EXTRA) ftl_input_code.$FS |
\$(TAMC) \$(FTL_TAMC_FLAGS) \$(TAMC_EXTRA) ftl_input_code.$FS |
3306 |
echo " \\" >> $MAKEFILE |
echo " \\" >> $MAKEFILE |
3307 |
printf " ${i}_mod.f$FS90" >> $MAKEFILE |
printf " ${i}_mod.f$FS90" >> $MAKEFILE |
3308 |
done |
done |
3309 |
AD_FILES=`cat adSrcFiles.tmp` |
AD_FILES=`cat $TMP.adSrcFiles` |
3310 |
for i in $AD_FILES ; do |
for i in $AD_FILES ; do |
3311 |
basename=${i%%.f} |
basename=${i%%.f} |
3312 |
toBeIgnored=`egrep ^$basename'[ ]*' ${OAD_DONT_COMPILE} ${OAD_DONT_TRANSFORM}` |
toBeIgnored=`egrep ^$basename'[ ]*' ${OAD_DONT_COMPILE} ${OAD_DONT_TRANSFORM}` |
3316 |
fi |
fi |
3317 |
done |
done |
3318 |
echo >> $MAKEFILE |
echo >> $MAKEFILE |
3319 |
rm -f adSrcFiles.tmp |
rm -f $TMP.adSrcFiles |
3320 |
|
|
3321 |
cat >>$MAKEFILE <<EOF |
cat >>$MAKEFILE <<EOF |
3322 |
|
|
3422 |
ad_input_code_sf.pre.s2p.xb.x2w.w2f.td.f$FS90: ad_input_code_sf.pre.s2p.xb.x2w.w2f.f$FS90 \${OADTOOLS}/insertTemplateDir.bash |
ad_input_code_sf.pre.s2p.xb.x2w.w2f.td.f$FS90: ad_input_code_sf.pre.s2p.xb.x2w.w2f.f$FS90 \${OADTOOLS}/insertTemplateDir.bash |
3423 |
\${OADTOOLS}/insertTemplateDir.bash \$< \$@ |
\${OADTOOLS}/insertTemplateDir.bash \$< \$@ |
3424 |
|
|
3425 |
PPEXTRAS=\$(wildcard \${OADTOOLS}/ad_template.*.F) \${OADTOOLS}/ad_inline.F |
PPEXTRAS=\$(notdir \$(wildcard \${OADTOOLS}/ad_template.*.F)) ad_inline.F |
3426 |
# postprocess F' |
# postprocess F' |
3427 |
postProcess.tag: ad_input_code_sf.pre.s2p.xb.x2w.w2f.td.f$FS90 \$(PPEXTRAS:.F=.f) | w2f__types.f90 |
postProcess.tag: ad_input_code_sf.pre.s2p.xb.x2w.w2f.td.f$FS90 \$(PPEXTRAS:.F=.f) | w2f__types.f90 |
3428 |
\${OPENADFORTTK_BASE}/tools/SourceProcessing/postProcess.py --progress --timing --infoUnitFile w2f__types.f90 --outputFormat=fixed --separateOutput --pathSuffix "" --filenameSuffix "_oad" -m r -i \${OADTOOLS}/ad_inline.f \$< |
\${OPENADFORTTK_BASE}/tools/SourceProcessing/postProcess.py --progress --timing --infoUnitFile w2f__types.f90 --outputFormat=fixed --separateOutput --pathSuffix "" --filenameSuffix "_oad" -m r -i ad_inline.f \$< |
3429 |
# 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 |
3430 |
touch \$@ |
touch \$@ |
3431 |
# put this so make knows about the postprocessing output |
# put this so make knows about the postprocessing output |
3436 |
\$(LN) \${XAIFSCHEMAROOT}/schema/\$@ . |
\$(LN) \${XAIFSCHEMAROOT}/schema/\$@ . |
3437 |
|
|
3438 |
# link the support files: |
# link the support files: |
3439 |
\$(OPENAD_SUPPORT_F90_SRC_FILES) \$(OPENAD_SUPPORT_C_SRC_FILES): |
\$(OPENAD_SUPPORT_F90_SRC_FILES) \$(OPENAD_SUPPORT_C_SRC_FILES) \$(PPEXTRAS): |
3440 |
\$(LN) \${OADTOOLS}/\$@ . |
\$(LN) \${OADTOOLS}/\$@ . |
3441 |
|
|
3442 |
AD_CLEAN += *_mod.h *_mod.F90 *.FF90 *.mod-whirl temp.sed oad_cp.* postProcess.tag \$(PPEXTRAS:.F=.f) |
AD_CLEAN += *_mod.h *_mod.F90 *.FF90 *.mod-whirl temp.sed oad_cp.* postProcess.tag |
3443 |
|
|
3444 |
# ============ end OpenAD specific section ============== |
# ============ end OpenAD specific section ============== |
3445 |
|
|
3475 |
done |
done |
3476 |
|
|
3477 |
echo " Add rules for links" |
echo " Add rules for links" |
3478 |
cat srclinks.tmp >> $MAKEFILE |
cat $TMP.srclinks >> $MAKEFILE |
3479 |
rm -f srclinks.tmp |
rm -f $TMP.srclinks |
3480 |
|
|
3481 |
echo " Adding makedepend marker" |
echo " Adding makedepend marker" |
3482 |
printf "\n\n# DO NOT DELETE\n" >> $MAKEFILE |
printf "\n\n# DO NOT DELETE\n" >> $MAKEFILE |