611 |
set to PATH. i.e. Include files from \$PATH/include, link to libraries |
set to PATH. i.e. Include files from \$PATH/include, link to libraries |
612 |
from \$PATH/lib and use binaries from \$PATH/bin. |
from \$PATH/lib and use binaries from \$PATH/bin. |
613 |
|
|
614 |
|
-omp | --omp |
615 |
|
Activate OpenMP code + use Compiler option OMPFLAG |
616 |
|
-omp=OMPFLAG | --omp=OMPFLAG |
617 |
|
Activate OpenMP code + use Compiler option OMPFLAG |
618 |
|
|
619 |
-es | --es | -embed-source | --embed-source |
-es | --es | -embed-source | --embed-source |
620 |
Embed a tarball containing the full source code |
Embed a tarball containing the full source code |
621 |
(including the Makefile, etc.) used to build the |
(including the Makefile, etc.) used to build the |
1051 |
FFLAGS= |
FFLAGS= |
1052 |
FOPTIM= |
FOPTIM= |
1053 |
FEXTRAFLAGS= |
FEXTRAFLAGS= |
1054 |
|
USE_EXTENDED_SRC= |
1055 |
|
EXTENDED_SRC_FLAG= |
1056 |
CFLAGS= |
CFLAGS= |
1057 |
KFLAGS1= |
KFLAGS1= |
1058 |
KFLAGS2= |
KFLAGS2= |
1063 |
NOOPTFLAGS= |
NOOPTFLAGS= |
1064 |
MPI= |
MPI= |
1065 |
MPIPATH= |
MPIPATH= |
1066 |
|
OMP= |
1067 |
|
OMPFLAG= |
1068 |
TS= |
TS= |
1069 |
PAPIS= |
PAPIS= |
1070 |
PCLS= |
PCLS= |
1132 |
|
|
1133 |
# The following state can be set directly by command-line switches |
# The following state can be set directly by command-line switches |
1134 |
gm_s1="OPTFILE PDEPEND PDEFAULT MAKEFILE PLATFORM ROOTDIR MODS DISABLE ENABLE" |
gm_s1="OPTFILE PDEPEND PDEFAULT MAKEFILE PLATFORM ROOTDIR MODS DISABLE ENABLE" |
1135 |
gm_s2="FC CPP IEEE TS PAPIS PCLS PAPI PCL HPMT GSL DEVEL MPI JAM DUMPSTATE STANDARDDIRS" |
gm_s2="FC CPP IEEE TS PAPIS PCLS PAPI PCL HPMT GSL DEVEL MPI OMP DUMPSTATE STANDARDDIRS" |
1136 |
|
|
1137 |
# The following state is not directly set by command-line switches |
# The following state is not directly set by command-line switches |
1138 |
gm_s3="LN S64 KPP LINK PACKAGES MAKEDEPEND PDEPEND PDEFAULT INCLUDES FFLAGS FOPTIM FEXTRAFLAGS" |
gm_s3="LN S64 KPP LINK PACKAGES MAKEDEPEND PDEPEND PDEFAULT INCLUDES FFLAGS FOPTIM FEXTRAFLAGS" |
1333 |
MPIPATH=$ac_optarg |
MPIPATH=$ac_optarg |
1334 |
MPI=true ;; |
MPI=true ;; |
1335 |
|
|
1336 |
# -jam | --jam) |
-omp | --omp) |
1337 |
# JAM=1 ;; |
OMP=true ;; |
1338 |
# -nojam | --nojam) |
-omp=* | --omp=*) |
1339 |
# JAM=0 ;; |
OMPFLAG=$ac_optarg |
1340 |
|
OMP=true ;; |
1341 |
|
|
1342 |
-ds | --ds) |
-ds | --ds) |
1343 |
DUMPSTATE=t ;; |
DUMPSTATE=t ;; |
1575 |
echo " Turning on MPI cpp macros" |
echo " Turning on MPI cpp macros" |
1576 |
DEFINES="$DEFINES -DALLOW_USE_MPI -DALWAYS_USE_MPI" |
DEFINES="$DEFINES -DALLOW_USE_MPI -DALWAYS_USE_MPI" |
1577 |
fi |
fi |
1578 |
|
if test ! "x$OMP" = x ; then |
1579 |
|
echo " Add OMPFLAG and turn on OpenMP cpp macros" |
1580 |
|
FFLAGS="$FFLAGS $OMPFLAG" |
1581 |
|
F90FLAGS="$F90FLAGS $OMPFLAG" |
1582 |
|
DEFINES="$DEFINES -DUSE_OMP_THREADING" |
1583 |
|
fi |
1584 |
|
|
1585 |
if test ! "x$TS" = x ; then |
if test ! "x$TS" = x ; then |
1586 |
echo " Turning on timing per timestep" |
echo " Turning on timing per timestep" |
1662 |
INCLUDES="$INCLUDES $GSLINC" |
INCLUDES="$INCLUDES $GSLINC" |
1663 |
LIBS="$LIBS $GSLLIB" |
LIBS="$LIBS $GSLLIB" |
1664 |
fi |
fi |
1665 |
|
#- if USE_EXTENDED_SRC is set, add EXTENDED_SRC_FLAG to FFLAGS : |
1666 |
|
if test ! "x$USE_EXTENDED_SRC" = x ; then |
1667 |
|
FFLAGS="$FFLAGS $EXTENDED_SRC_FLAG" |
1668 |
|
F90FIXEDFORMAT="$F90FIXEDFORMAT $EXTENDED_SRC_FLAG" |
1669 |
|
fi |
1670 |
|
|
1671 |
printf "\n=== Checking system libraries ===\n" |
printf "\n=== Checking system libraries ===\n" |
1672 |
printf " Do we have the system() command using $FC... " |
printf " Do we have the system() command using $FC... " |
1789 |
|
|
1790 |
|
|
1791 |
printf "\n=== Setting defaults ===\n" |
printf "\n=== Setting defaults ===\n" |
1792 |
printf " Adding MODS directories: " |
printf " Adding MODS directories: " |
1793 |
for d in $MODS ; do |
for d in $MODS ; do |
1794 |
if test ! -d $d ; then |
if test ! -d $d ; then |
1795 |
echo |
echo |
1796 |
echo "Error: MODS directory \"$d\" not found!" |
echo "Error: MODS directory \"$d\" not found!" |
1797 |
exit 1 |
exit 1 |
1798 |
else |
else |
1799 |
printf " $d" |
printf "$d " |
1800 |
SOURCEDIRS="$SOURCEDIRS $d" |
SOURCEDIRS="$SOURCEDIRS $d" |
1801 |
INCLUDEDIRS="$INCLUDEDIRS $d" |
INCLUDEDIRS="$INCLUDEDIRS $d" |
1802 |
fi |
fi |
2542 |
echo "EMBEDDED_FILES = " >>$MAKEFILE |
echo "EMBEDDED_FILES = " >>$MAKEFILE |
2543 |
fi |
fi |
2544 |
|
|
|
# Note: figure out some way to add Hyades JAM libraries here |
|
2545 |
cat >>$MAKEFILE <<EOF |
cat >>$MAKEFILE <<EOF |
2546 |
# Unix ln (link) |
# Unix ln (link) |
2547 |
LN = ${LN} |
LN = ${LN} |
2740 |
#=== Automatic Differentiation Rules === |
#=== Automatic Differentiation Rules === |
2741 |
#=== for TAMC/TAF ====================== |
#=== for TAMC/TAF ====================== |
2742 |
|
|
2743 |
if test "x$OPENAD" == x ; then |
if test "x$OPENAD" = x ; then |
2744 |
|
|
2745 |
cat >>$MAKEFILE <<EOF |
cat >>$MAKEFILE <<EOF |
2746 |
|
|
2781 |
adtaf: ad_taf_output.$FS |
adtaf: ad_taf_output.$FS |
2782 |
adtamc: ad_tamc_output.$FS |
adtamc: ad_tamc_output.$FS |
2783 |
|
|
2784 |
ad_input_code.$FS: \$(AD_FILES) \$(H_SRC_FILES) |
ad_input_code.$FS: \$(AD_FILES) \$(H_SRC_FILES) \$(AD_FLOW_FILES) |
2785 |
@$BASH\$(TOOLSDIR)/convert_cpp_cmd2defines "Warning - this file is automatically generated - do NOT edit" -DALLOW_ADJOINT_RUN -UALLOW_TANGENTLINEAR_RUN -UALLOW_ECCO_OPTIMIZATION > ad_config.template |
@$BASH\$(TOOLSDIR)/convert_cpp_cmd2defines "Warning - this file is automatically generated - do NOT edit" -DALLOW_ADJOINT_RUN -UALLOW_TANGENTLINEAR_RUN -UALLOW_ECCO_OPTIMIZATION > ad_config.template |
2786 |
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 |
2787 |
-rm -f ad_config.template |
-rm -f ad_config.template |
3025 |
|
|
3026 |
# canonicalizer |
# canonicalizer |
3027 |
ad_input_code_sf.w2f.pre.f$FS90: ad_input_code_sf.w2f.f$FS90 preProcess.py |
ad_input_code_sf.w2f.pre.f$FS90: ad_input_code_sf.w2f.f$FS90 preProcess.py |
3028 |
./preProcess.py -H \$< -o \$@ |
./preProcess.py -H -S \$< -o \$@ |
3029 |
|
|
3030 |
# F -> WHIRL |
# F -> WHIRL |
3031 |
# note that the canonicalized version cuts off at col 72 |
# note that the canonicalized version cuts off at col 72 |
3042 |
./whirl2xaif -s -n --debug 1 -o \$@ \$< |
./whirl2xaif -s -n --debug 1 -o \$@ \$< |
3043 |
|
|
3044 |
# XAIF -> XAIF' |
# XAIF -> XAIF' |
3045 |
ad_input_code_sf.w2f.pre.xb.xaif : ad_input_code_sf.w2f.pre.xaif xaif.xsd xaif_base.xsd xaif_inlinable_intrinsics.xsd xaif_derivative_propagator.xsd xaif_output.xsd openad_adm |
ad_input_code_sf.w2f.pre.xb.xaif : ad_input_code_sf.w2f.pre.xaif xaif.xsd xaif_base.xsd xaif_inlinable_intrinsics.xsd xaif_derivative_propagator.xsd xaif_output.xsd oadDriver |
3046 |
./openad_adm -f -t forward_step -i \$< -c \${XAIFSCHEMAROOT}/schema/examples/inlinable_intrinsics.xaif -o \$@ -I -r |
./oadDriver -f -t forward_step -i \$< -c \${XAIFSCHEMAROOT}/schema/examples/inlinable_intrinsics.xaif -o \$@ -I -r |
3047 |
|
|
3048 |
# XAIF' -> WHIRL' |
# XAIF' -> WHIRL' |
3049 |
ad_input_code_sf.w2f.pre.xb.x2w.B : ad_input_code_sf.w2f.pre.xb.xaif xaif2whirl |
ad_input_code_sf.w2f.pre.xb.x2w.B : ad_input_code_sf.w2f.pre.xb.xaif xaif2whirl |
3057 |
ad_input_code_sf.w2f.pre.xb.x2w.w2f.td.f$FS90: ad_input_code_sf.w2f.pre.xb.x2w.w2f.f$FS90 ../OAD_support/insertTemplateDir.bash |
ad_input_code_sf.w2f.pre.xb.x2w.w2f.td.f$FS90: ad_input_code_sf.w2f.pre.xb.x2w.w2f.f$FS90 ../OAD_support/insertTemplateDir.bash |
3058 |
../OAD_support/insertTemplateDir.bash \$< \$@ |
../OAD_support/insertTemplateDir.bash \$< \$@ |
3059 |
|
|
3060 |
|
PPEXTRAS=\$(wildcard ../OAD_support/ad_template.*.F) ../OAD_support/ad_inline.F |
3061 |
# postprocess F' |
# postprocess F' |
3062 |
ad_input_code_sf.w2f.pre.xb.x2w.w2f.td.pp.f$FS90: ad_input_code_sf.w2f.pre.xb.x2w.w2f.td.f$FS90 multi-pp.pl ../OAD_support/ad_inline.f \$(wildcard ../OAD_support/ad_template.*.f) |
ad_input_code_sf.w2f.pre.xb.x2w.w2f.td.pp.f$FS90: ad_input_code_sf.w2f.pre.xb.x2w.w2f.td.f$FS90 postProcess.py \$(PPEXTRAS:.F=.f) |
3063 |
perl multi-pp.pl -inline=../OAD_support/ad_inline.f \$< |
./postProcess.py -m r -i ../OAD_support/ad_inline.f -o \$@ \$< |
|
# the postprocessor still gets the name wrong |
|
|
cat \$<.pp | sed 's/RETURN//' > \$@ |
|
3064 |
|
|
3065 |
# extract all transformed modules |
# extract all transformed modules |
3066 |
all_mods.xb.x2w.w2f.pp.f$FS90: ad_input_code_sf.w2f.pre.xb.x2w.w2f.td.pp.f$FS90 |
all_mods.xb.x2w.w2f.pp.f$FS90: ad_input_code_sf.w2f.pre.xb.x2w.w2f.td.pp.f$FS90 |
3087 |
whirl2xaif xaif2whirl: |
whirl2xaif xaif2whirl: |
3088 |
\$(LN) \${OPENADFORTTK}/bin/\$@ . |
\$(LN) \${OPENADFORTTK}/bin/\$@ . |
3089 |
|
|
3090 |
%.pl: |
preProcess.py postProcess.py: |
|
\$(LN) \${OPENADFORTTK}/bin/\$@ . |
|
|
|
|
|
preProcess.py: |
|
3091 |
\$(LN) \${OPENADFORTTK_BASE}/tools/SourceProcessing/\$@ . |
\$(LN) \${OPENADFORTTK_BASE}/tools/SourceProcessing/\$@ . |
3092 |
|
|
3093 |
whirl2f whirl2f_be: |
whirl2f whirl2f_be: |
3094 |
\$(LN) \${OPEN64ROOT}/whirl2f/\$@ . |
\$(LN) \${OPEN64ROOT}/whirl2f/\$@ . |
3095 |
|
|
3096 |
openad_adm: |
oadDriver: |
3097 |
\$(LN) \${XAIFBOOSTERROOT}/xaifBooster/algorithms/BasicBlockPreaccumulationReverse/test/t \$@ |
\$(LN) \${XAIFBOOSTERROOT}/xaifBooster/algorithms/BasicBlockPreaccumulationReverse/driver/oadDriver \$@ |
3098 |
|
|
3099 |
# ============ end OpenAD specific section ============== |
# ============ end OpenAD specific section ============== |
3100 |
|
|