122 |
stop |
stop |
123 |
end |
end |
124 |
EOF |
EOF |
125 |
test -f Makefile && mv -f Makefile Makefile.bak |
test -f $MAKEFILE && mv -f $MAKEFILE $MAKEFILE".tst" |
126 |
cat <<EOF >> Makefile |
cat <<EOF >> $MAKEFILE |
|
%.$tfs : %.F |
|
127 |
.SUFFIXES: |
.SUFFIXES: |
128 |
genmake_hello.$tfs: genmake_hello.F |
.SUFFIXES: .$tfs .F |
129 |
$LN genmake_hello.F genmake_hello.$tfs |
.F.$tfs: |
130 |
|
$LN \$< \$@ |
131 |
EOF |
EOF |
132 |
$MAKE "genmake_hello."$tfs > /dev/null 2>&1 |
$MAKE "genmake_hello."$tfs > /dev/null 2>&1 |
133 |
RETVAL=$? |
RETVAL=$? |
148 |
return |
return |
149 |
fi |
fi |
150 |
fi |
fi |
151 |
rm -f genmake_hello.* Makefile |
rm -f genmake_hello.* $MAKEFILE |
152 |
test -f Makefile && mv -f Makefile.bak Makefile |
test -f $MAKEFILE".tst" && mv -f $MAKEFILE".tst" $MAKEFILE |
153 |
|
|
154 |
# If we make it here, use the extensions |
# If we make it here, use the extensions |
155 |
FS=$tfs |
FS=$tfs |
181 |
if test "x${MAKEDEPEND}" = x ; then |
if test "x${MAKEDEPEND}" = x ; then |
182 |
which makedepend > /dev/null 2>&1 |
which makedepend > /dev/null 2>&1 |
183 |
RV0=$? |
RV0=$? |
184 |
|
test -f $MAKEFILE && mv -f $MAKEFILE $MAKEFILE".tst" |
185 |
|
# echo 'MAKEFILE="'$MAKEFILE'"' |
186 |
|
cat <<EOF >> $MAKEFILE |
187 |
|
# THIS IS A TEST MAKEFILE GENERATED BY "genmake2" |
188 |
|
# |
189 |
|
# Some "makedepend" implementations will die if they cannot |
190 |
|
# find a Makefile -- so this file is here to gives them an |
191 |
|
# empty one to find and parse. |
192 |
|
EOF |
193 |
cat <<EOF >> genmake_tc.f |
cat <<EOF >> genmake_tc.f |
194 |
program test |
program test |
195 |
write(*,*) 'test' |
write(*,*) 'test' |
198 |
EOF |
EOF |
199 |
makedepend genmake_tc.f > /dev/null 2>&1 |
makedepend genmake_tc.f > /dev/null 2>&1 |
200 |
RV1=$? |
RV1=$? |
201 |
|
test -f $MAKEFILE && rm -f $MAKEFILE |
202 |
|
test -f $MAKEFILE".tst" && mv -f $MAKEFILE".tst" $MAKEFILE |
203 |
if test "x${RV0}${RV1}" = x00 ; then |
if test "x${RV0}${RV1}" = x00 ; then |
204 |
MAKEDEPEND=makedepend |
MAKEDEPEND=makedepend |
205 |
else |
else |
592 |
EOF |
EOF |
593 |
return 1 |
return 1 |
594 |
fi |
fi |
595 |
cat > genmake_tcomp.f <<EOF |
cat > genmake_tcomp.$FS <<EOF |
596 |
subroutine tcall( string ) |
subroutine tcall( string ) |
597 |
character*(*) string |
character*(*) string |
598 |
call tsub( string ) |
call tsub( string ) |
599 |
end |
end |
600 |
EOF |
EOF |
601 |
$FC $FFLAGS $DEFINES -c genmake_tcomp.f >> genmake_warnings 2>&1 |
$FC $FFLAGS $DEFINES -c genmake_tcomp.$FS >> genmake_warnings 2>&1 |
602 |
RETVAL=$? |
RETVAL=$? |
603 |
if test "x$RETVAL" != x0 ; then |
if test "x$RETVAL" != x0 ; then |
604 |
FC_NAMEMANGLE=$default_nm |
FC_NAMEMANGLE=$default_nm |
664 |
*curtim = *curtim/1.E6; |
*curtim = *curtim/1.E6; |
665 |
} |
} |
666 |
EOF |
EOF |
667 |
make genmake_tc_1.o >> genmake_tc.log 2>&1 |
make genmake_tc_1.o >> genmake_warnings 2>&1 |
668 |
RET_C=$? |
RET_C=$? |
669 |
cat <<EOF > genmake_tc_2.f |
cat <<EOF > genmake_tc_2.$FS |
670 |
program hello |
program hello |
671 |
Real*8 wtime |
Real*8 wtime |
672 |
external cloc |
external cloc |
674 |
print *," HELLO WORLD", wtime |
print *," HELLO WORLD", wtime |
675 |
end program hello |
end program hello |
676 |
EOF |
EOF |
677 |
$FC $FFLAGS -o genmake_tc genmake_tc_2.f genmake_tc_1.o >> genmake_tc.log 2>&1 |
$FC $FFLAGS -o genmake_tc genmake_tc_2.$FS genmake_tc_1.o >> genmake_warnings 2>&1 |
678 |
RET_F=$? |
RET_F=$? |
679 |
test -x ./genmake_tc && ./genmake_tc >> genmake_tc.log 2>&1 |
test -x ./genmake_tc && ./genmake_tc >> genmake_warnings 2>&1 |
680 |
RETVAL=$? |
RETVAL=$? |
681 |
if test "x$RETVAL" = x0 ; then |
if test "x$RETVAL" = x0 ; then |
682 |
HAVE_CLOC=t |
HAVE_CLOC=t |
686 |
} |
} |
687 |
|
|
688 |
|
|
689 |
|
check_HAVE_STAT() { |
690 |
|
get_fortran_c_namemangling |
691 |
|
cat <<EOF > genmake_tc_1.c |
692 |
|
$FC_NAMEMANGLE |
693 |
|
#include <stdio.h> |
694 |
|
#include <stdlib.h> |
695 |
|
#include <unistd.h> |
696 |
|
#include <sys/stat.h> |
697 |
|
#include <sys/types.h> |
698 |
|
void FC_NAMEMANGLE(tfsize) ( int *nbyte ) |
699 |
|
{ |
700 |
|
char name[512]; |
701 |
|
struct stat astat; |
702 |
|
|
703 |
|
name[0] = 'a'; name[1] = '\0'; |
704 |
|
if (! stat(name, &astat)) |
705 |
|
*nbyte = (int)(astat.st_size); |
706 |
|
else |
707 |
|
*nbyte = -1; |
708 |
|
} |
709 |
|
EOF |
710 |
|
make genmake_tc_1.o >> genmake_tc.log 2>&1 |
711 |
|
RET_C=$? |
712 |
|
cat <<EOF > genmake_tc_2.$FS |
713 |
|
program hello |
714 |
|
integer nbyte |
715 |
|
call tfsize(nbyte) |
716 |
|
print *," HELLO WORLD", nbyte |
717 |
|
end program hello |
718 |
|
EOF |
719 |
|
$FC $FFLAGS -o genmake_tc genmake_tc_2.$FS genmake_tc_1.o >> genmake_tc.log 2>&1 |
720 |
|
RET_F=$? |
721 |
|
test -x ./genmake_tc && ./genmake_tc >> genmake_tc.log 2>&1 |
722 |
|
RETVAL=$? |
723 |
|
if test "x$RETVAL" = x0 ; then |
724 |
|
HAVE_STAT=t |
725 |
|
DEFINES="$DEFINES -DHAVE_STAT" |
726 |
|
fi |
727 |
|
rm -f genmake_tc* |
728 |
|
} |
729 |
|
|
730 |
|
|
731 |
check_netcdf_libs() { |
check_netcdf_libs() { |
732 |
|
if test ! "x$SKIP_NETCDF_CHECK" = x ; then |
733 |
|
return |
734 |
|
fi |
735 |
echo "" > genmake_tnc.log |
echo "" > genmake_tnc.log |
736 |
cat <<EOF > genmake_tnc.for |
cat <<EOF > genmake_tnc.F |
737 |
program fgennc |
program fgennc |
738 |
#include "netcdf.inc" |
#include "netcdf.inc" |
739 |
|
EOF |
740 |
|
if test ! "x$MPI" = x ; then |
741 |
|
echo '#include "mpif.h"' >> genmake_tnc.F |
742 |
|
fi |
743 |
|
cat <<EOF >> genmake_tnc.F |
744 |
integer iret, ncid, xid |
integer iret, ncid, xid |
745 |
iret = nf_create('genmake_tnc.nc', NF_CLOBBER, ncid) |
iret = nf_create('genmake_tnc.nc', NF_CLOBBER, ncid) |
746 |
IF (iret .NE. NF_NOERR) write(*,*) NF_STRERROR(iret) |
IF (iret .NE. NF_NOERR) write(*,*) NF_STRERROR(iret) |
750 |
IF (iret .NE. NF_NOERR) write(*,*) NF_STRERROR(iret) |
IF (iret .NE. NF_NOERR) write(*,*) NF_STRERROR(iret) |
751 |
end |
end |
752 |
EOF |
EOF |
753 |
#echo "$CPP $DEFINES $INCLUDES genmake_tnc.for > genmake_tnc.f" |
echo "Executing:" > genmake_tnc.log |
754 |
#echo "$FC $FFLAGS $FOPTIM -c genmake_tnc.f" |
echo " $CPP $DEFINES $INCLUDES genmake_tnc.F > genmake_tnc.$FS" \ |
755 |
#echo "$LINK -o genmake_tnc.o $LIBS" |
> genmake_tnc.log |
756 |
$CPP $DEFINES $INCLUDES genmake_tnc.for > genmake_tnc.f 2>/dev/null \ |
RET_CPP=f |
757 |
&& $FC $FFLAGS $FOPTIM -c genmake_tnc.f \ |
$CPP $DEFINES $INCLUDES genmake_tnc.F > genmake_tnc.$FS 2>/dev/null \ |
758 |
|
&& RET_CPP=t |
759 |
|
if test "x$RET_CPP" = xf ; then |
760 |
|
echo " WARNING: CPP failed to pre-process the netcdf test." \ |
761 |
|
> genmake_tnc.log |
762 |
|
echo " Please check that \$INCLUDES is properly set." \ |
763 |
|
> genmake_tnc.log |
764 |
|
fi |
765 |
|
echo "Executing:" > genmake_tnc.log |
766 |
|
echo " $FC $FFLAGS $FOPTIM -c genmake_tnc.$FS" > genmake_tnc.log |
767 |
|
echo " $LINK -o genmake_tnc.o $LIBS" > genmake_tnc.log |
768 |
|
$FC $FFLAGS $FOPTIM -c genmake_tnc.$FS >> genmake_tnc.log 2>&1 \ |
769 |
&& $LINK -o genmake_tnc genmake_tnc.o $LIBS >> genmake_tnc.log 2>&1 |
&& $LINK -o genmake_tnc genmake_tnc.o $LIBS >> genmake_tnc.log 2>&1 |
770 |
RET_COMPILE=$? |
RET_COMPILE=$? |
771 |
test -x ./genmake_tnc && ./genmake_tnc >> genmake_tnc.log 2>&1 |
|
772 |
RETVAL=$? |
#EH3 Remove test program execution for machines that either disallow |
773 |
if test "x$RET_COMPILE" = x0 -a "x$RETVAL" = x0 ; then |
#EH3 execution or cannot support it (eg. cross-compilers) |
774 |
|
#EH3 |
775 |
|
#EH3 test -x ./genmake_tnc && ./genmake_tnc >> genmake_tnc.log 2>&1 |
776 |
|
#EH3 RETVAL=$? |
777 |
|
#EH3 if test "x$RET_COMPILE" = x0 -a "x$RETVAL" = x0 ; then |
778 |
|
|
779 |
|
if test "x$RET_COMPILE" = x0 ; then |
780 |
HAVE_NETCDF=t |
HAVE_NETCDF=t |
781 |
else |
else |
782 |
# try again with "-lnetcdf" added to the libs |
# try again with "-lnetcdf" added to the libs |
783 |
$CPP $DEFINES $INCLUDES genmake_tnc.for > genmake_tnc.f 2>/dev/null \ |
$CPP $DEFINES $INCLUDES genmake_tnc.F > genmake_tnc.$FS 2>/dev/null \ |
784 |
&& $FC $FFLAGS $FOPTIM -o genmake_tnc genmake_tnc.f \ |
&& $FC $FFLAGS $FOPTIM -c genmake_tnc.$FS >> genmake_tnc.log 2>&1 \ |
785 |
$LIBS -lnetcdf >> genmake_tnc_2.log 2>&1 |
&& $LINK -o genmake_tnc genmake_tnc.o $LIBS -lnetcdf >> genmake_tnc.log 2>&1 |
786 |
RET_COMPILE=$? |
RET_COMPILE=$? |
787 |
test -x ./genmake_tnc && ./genmake_tnc >> genmake_tnc.log 2>&1 |
if test "x$RET_COMPILE" = x0 ; then |
|
RETVAL=$? |
|
|
if test "x$RET_COMPILE" = x0 -a "x$RETVAL" = x0 ; then |
|
788 |
LIBS="$LIBS -lnetcdf" |
LIBS="$LIBS -lnetcdf" |
789 |
HAVE_NETCDF=t |
HAVE_NETCDF=t |
790 |
else |
else |
807 |
LN= |
LN= |
808 |
S64= |
S64= |
809 |
KPP= |
KPP= |
810 |
FC= |
#FC= |
811 |
#CC=gcc |
#CC=gcc |
812 |
CPP= |
#CPP= |
813 |
LINK= |
LINK= |
814 |
DEFINES= |
DEFINES= |
815 |
PACKAGES= |
PACKAGES= |
816 |
ENABLE= |
ENABLE= |
817 |
DISABLE= |
DISABLE= |
818 |
MAKEFILE= |
# MAKEFILE= |
819 |
#MAKEDEPEND= |
# MAKEDEPEND= |
820 |
PDEPEND= |
PDEPEND= |
821 |
DUMPSTATE=t |
DUMPSTATE=t |
822 |
PDEFAULT= |
PDEFAULT= |
823 |
OPTFILE= |
OPTFILE= |
824 |
INCLUDES="-I." |
INCLUDES="-I. $INCLUDES" |
825 |
FFLAGS= |
FFLAGS= |
826 |
FOPTIM= |
FOPTIM= |
827 |
CFLAGS= |
CFLAGS= |
840 |
HAVE_FDATE= |
HAVE_FDATE= |
841 |
FC_NAMEMANGLE= |
FC_NAMEMANGLE= |
842 |
HAVE_CLOC= |
HAVE_CLOC= |
843 |
|
HAVE_STAT= |
844 |
HAVE_NETCDF= |
HAVE_NETCDF= |
845 |
HAVE_ETIME= |
HAVE_ETIME= |
846 |
|
|
853 |
G2ARGS= |
G2ARGS= |
854 |
BASH= |
BASH= |
855 |
PWD=`pwd` |
PWD=`pwd` |
856 |
MAKE=make |
test "x$MAKE" = x && MAKE=make |
857 |
AWK=awk |
test "x$AWK" = x && AWK=awk |
858 |
THISHOSTNAME=`hostname` |
THISHOST=`hostname` |
859 |
THISCWD=`pwd` |
THISCWD=`pwd` |
860 |
THISDATE=`date` |
THISDATE=`date` |
861 |
|
THISUSER=`echo $USER` |
862 |
|
THISVER= |
863 |
MACHINE=`uname -a` |
MACHINE=`uname -a` |
864 |
EXECUTABLE= |
EXECUTABLE= |
865 |
EXEHOOK= |
EXEHOOK= |
893 |
# The following state is not directly set by command-line switches |
# The following state is not directly set by command-line switches |
894 |
gm_s3="LN S64 KPP LINK PACKAGES MAKEDEPEND PDEPEND PDEFAULT INCLUDES FFLAGS FOPTIM " |
gm_s3="LN S64 KPP LINK PACKAGES MAKEDEPEND PDEPEND PDEFAULT INCLUDES FFLAGS FOPTIM " |
895 |
gm_s4="CFLAGS KFLAGS1 KFLAGS2 LIBS KPPFILES NOOPTFILES NOOPTFLAGS" |
gm_s4="CFLAGS KFLAGS1 KFLAGS2 LIBS KPPFILES NOOPTFILES NOOPTFLAGS" |
896 |
gm_s5="TOOLSDIR SOURCEDIRS INCLUDEDIRS PWD MAKE THISHOSTNAME THISDATE MACHINE" |
gm_s5="TOOLSDIR SOURCEDIRS INCLUDEDIRS PWD MAKE THISHOST THISUSER THISDATE THISVER MACHINE" |
897 |
gm_s6="EXECUTABLE EXEHOOK EXEDIR PACKAGES_CONF" |
gm_s6="EXECUTABLE EXEHOOK EXEDIR PACKAGES_CONF" |
898 |
gm_s7="HAVE_SYSTEM HAVE_FDATE FC_NAMEMANGLE HAVE_ETIME" |
gm_s7="HAVE_SYSTEM HAVE_FDATE FC_NAMEMANGLE HAVE_ETIME" |
899 |
|
|
934 |
echo "none found" |
echo "none found" |
935 |
fi |
fi |
936 |
|
|
937 |
# echo "$0::$1:$2:$3:$4:$5:$6:$7:" |
#echo "$0::$1:$2:$3:$4:$5:$6:$7:" |
938 |
#OPTIONS= |
#OPTIONS= |
939 |
#n=0 |
#n=0 |
940 |
#for i ; do |
#for i ; do |
946 |
#done |
#done |
947 |
#parse_options |
#parse_options |
948 |
ac_prev= |
ac_prev= |
949 |
for ac_option in $@ ; do |
for ac_option in "$@" ; do |
950 |
|
|
951 |
G2ARGS="$G2ARGS \"$ac_option\"" |
G2ARGS="$G2ARGS \"$ac_option\"" |
952 |
|
|
1106 |
|
|
1107 |
done |
done |
1108 |
|
|
1109 |
|
|
1110 |
if test -f ./.genmakerc ; then |
if test -f ./.genmakerc ; then |
1111 |
echo |
echo |
1112 |
echo "WARNING: genmake2 has detected a copy of the old-style \"./.genmakerc\"" |
echo "WARNING: genmake2 has detected a copy of the old-style \"./.genmakerc\"" |
1119 |
echo |
echo |
1120 |
fi |
fi |
1121 |
|
|
1122 |
|
# Find the MITgcm ${ROOTDIR} |
1123 |
if test "x${ROOTDIR}" = x ; then |
if test "x${ROOTDIR}" = x ; then |
1124 |
tmp=`echo $PWD | sed -e 's/\// /g' | awk '{print $NR}'` |
tmp=`echo $PWD | sed -e 's/\// /g' | $AWK '{print $NR}'` |
1125 |
if test "x$tmp" = "xbin" -a -d ../model -a -d ../eesup -a -d ../pkg ; then |
if test "x$tmp" = "xbin" -a -d ../model -a -d ../eesup -a -d ../pkg ; then |
1126 |
ROOTDIR=".." |
ROOTDIR=".." |
1127 |
else |
else |
1146 |
exit 1 |
exit 1 |
1147 |
fi |
fi |
1148 |
|
|
1149 |
|
# Find the MITgcm ${THISVER} |
1150 |
|
if test -f "${ROOTDIR}/doc/tag-index" ; then |
1151 |
|
THISVER=`grep checkpoint ${ROOTDIR}/doc/tag-index | head -1` |
1152 |
|
fi |
1153 |
|
|
1154 |
|
if test "x$MAKEFILE" = x ; then |
1155 |
|
MAKEFILE="Makefile" |
1156 |
|
fi |
1157 |
|
|
1158 |
echo " getting OPTFILE information: " |
echo " getting OPTFILE information: " |
1159 |
if test "x${OPTFILE}" = x ; then |
if test "x${OPTFILE}" = x ; then |
1160 |
if test "x$MITGCM_OF" = x ; then |
if test "x$MITGCM_OF" = x ; then |
1184 |
fi |
fi |
1185 |
fi |
fi |
1186 |
|
|
|
# Check for broken systems that cannot correctly distinguish *.F and *.f files |
|
|
# check_for_broken_Ff |
|
|
|
|
1187 |
echo " getting AD_OPTFILE information: " |
echo " getting AD_OPTFILE information: " |
1188 |
if test "x${AD_OPTFILE}" = x ; then |
if test "x${AD_OPTFILE}" = x ; then |
1189 |
if test "x$MITGCM_AD_OF" = x ; then |
if test "x$MITGCM_AD_OF" = x ; then |
1211 |
fi |
fi |
1212 |
fi |
fi |
1213 |
|
|
1214 |
|
#==================================================================== |
1215 |
|
# Set default values if not set by the optfile |
1216 |
|
# |
1217 |
# Check that FC, CC, LINK, CPP, S64, LN, and MAKE are defined. If not, |
# Check that FC, CC, LINK, CPP, S64, LN, and MAKE are defined. If not, |
1218 |
# either set defaults or complain and abort! |
# either set defaults or complain and abort! |
1219 |
if test ! "x$BASH" = x ; then |
if test ! "x$BASH" = x ; then |
1302 |
|
|
1303 |
printf "\n=== Checking system libraries ===\n" |
printf "\n=== Checking system libraries ===\n" |
1304 |
printf " Do we have the system() command using $FC... " |
printf " Do we have the system() command using $FC... " |
1305 |
cat > genmake_tcomp.f <<EOF |
cat > genmake_tcomp.$FS <<EOF |
1306 |
program hello |
program hello |
1307 |
call system('echo hi') |
call system('echo hi') |
1308 |
end |
end |
1309 |
EOF |
EOF |
1310 |
$FC $FFLAGS $DEFINES -o genmake_tcomp genmake_tcomp.f > genmake_tcomp.log 2>&1 |
$FC $FFLAGS $DEFINES -o genmake_tcomp genmake_tcomp.$FS > genmake_tcomp.log 2>&1 |
1311 |
RETVAL=$? |
RETVAL=$? |
1312 |
if test "x$RETVAL" = x0 ; then |
if test "x$RETVAL" = x0 ; then |
1313 |
HAVE_SYSTEM=t |
HAVE_SYSTEM=t |
1320 |
rm -f genmake_tcomp* |
rm -f genmake_tcomp* |
1321 |
|
|
1322 |
printf " Do we have the fdate() command using $FC... " |
printf " Do we have the fdate() command using $FC... " |
1323 |
cat > genmake_tcomp.f <<EOF |
cat > genmake_tcomp.$FS <<EOF |
1324 |
program hello |
program hello |
1325 |
CHARACTER(128) string |
CHARACTER(128) string |
1326 |
string = ' ' |
string = ' ' |
1328 |
print *, string |
print *, string |
1329 |
end |
end |
1330 |
EOF |
EOF |
1331 |
$FC $FFLAGS $DEFINES -o genmake_tcomp genmake_tcomp.f > genmake_tcomp.log 2>&1 |
$FC $FFLAGS $DEFINES -o genmake_tcomp genmake_tcomp.$FS > genmake_tcomp.log 2>&1 |
1332 |
RETVAL=$? |
RETVAL=$? |
1333 |
if test "x$RETVAL" = x0 ; then |
if test "x$RETVAL" = x0 ; then |
1334 |
HAVE_FDATE=t |
HAVE_FDATE=t |
1341 |
rm -f genmake_tcomp* |
rm -f genmake_tcomp* |
1342 |
|
|
1343 |
printf " Do we have the etime() command using $FC... " |
printf " Do we have the etime() command using $FC... " |
1344 |
cat > genmake_tcomp.f <<EOF |
cat > genmake_tcomp.$FS <<EOF |
1345 |
program hello |
program hello |
1346 |
REAL*4 ACTUAL, TARRAY(2) |
REAL*4 ACTUAL, TARRAY(2) |
1347 |
EXTERNAL ETIME |
EXTERNAL ETIME |
1350 |
print *, tarray |
print *, tarray |
1351 |
end |
end |
1352 |
EOF |
EOF |
1353 |
$FC $FFLAGS $DEFINES -o genmake_tcomp genmake_tcomp.f > genmake_tcomp.log 2>&1 |
$FC $FFLAGS $DEFINES -o genmake_tcomp genmake_tcomp.$FS > genmake_tcomp.log 2>&1 |
1354 |
RETVAL=$? |
RETVAL=$? |
1355 |
if test "x$RETVAL" = x0 ; then |
if test "x$RETVAL" = x0 ; then |
1356 |
HAVE_ETIME=t |
HAVE_ETIME=t |
1371 |
fi |
fi |
1372 |
rm -f genmake_t* |
rm -f genmake_t* |
1373 |
|
|
1374 |
|
printf " Can we use stat() through C calls... " |
1375 |
|
check_HAVE_STAT |
1376 |
|
if test "x$HAVE_STAT" != x ; then |
1377 |
|
echo "yes" |
1378 |
|
else |
1379 |
|
echo "no" |
1380 |
|
fi |
1381 |
|
rm -f genmake_t* |
1382 |
|
|
1383 |
printf " Can we create NetCDF-enabled binaries... " |
printf " Can we create NetCDF-enabled binaries... " |
1384 |
check_netcdf_libs |
check_netcdf_libs |
1385 |
if test "x$HAVE_NETCDF" != x ; then |
if test "x$HAVE_NETCDF" != x ; then |
1404 |
done |
done |
1405 |
echo |
echo |
1406 |
|
|
|
if test "x$MAKEFILE" = x ; then |
|
|
MAKEFILE="Makefile" |
|
|
fi |
|
1407 |
if test "x${PLATFORM}" = x ; then |
if test "x${PLATFORM}" = x ; then |
1408 |
PLATFORM=$p_PLATFORM |
PLATFORM=$p_PLATFORM |
1409 |
fi |
fi |
1410 |
|
|
1411 |
if test "x${EXEDIR}" = x ; then |
if test "x${EXEDIR}" = x ; then |
1412 |
tmp=`echo $PWD | sed -e 's/\// /g' | awk '{print $NR}'` |
tmp=`echo $PWD | sed -e 's/\// /g' | $AWK '{print $NR}'` |
1413 |
if test "x$tmp" = "xbin" -a -d ../exe -a $ROOTDIR = .. ; then |
if test "x$tmp" = "xbin" -a -d ../exe -a $ROOTDIR = .. ; then |
1414 |
EXEDIR=../exe |
EXEDIR=../exe |
1415 |
else |
else |
1429 |
exit 1 |
exit 1 |
1430 |
fi |
fi |
1431 |
if test "x$S64" = x ; then |
if test "x$S64" = x ; then |
1432 |
S64='$(TOOLSDIR)/set64bitConst.sh' |
echo "3.0 _d 3" | ${TOOLSDIR}/set64bitConst.sh > /dev/null 2>&1 |
1433 |
|
RETVAL=$? |
1434 |
|
if test "x${RETVAL}" = x0 ; then |
1435 |
|
S64='$(TOOLSDIR)/set64bitConst.sh' |
1436 |
|
else |
1437 |
|
echo "3.0 _d 3" | ${TOOLSDIR}/set64bitConst.csh > /dev/null 2>&1 |
1438 |
|
RETVAL=$? |
1439 |
|
if test "x${RETVAL}" = x0 ; then |
1440 |
|
S64='$(TOOLSDIR)/set64bitConst.csh' |
1441 |
|
else |
1442 |
|
cat <<EOF |
1443 |
|
|
1444 |
|
ERROR: neither of the two default scripts: |
1445 |
|
|
1446 |
|
${TOOLSDIR}/set64bitConst.sh |
1447 |
|
${TOOLSDIR}/set64bitConst.csh |
1448 |
|
|
1449 |
|
are working so please check paths or specify (with \$S64) a |
1450 |
|
working version of this script. |
1451 |
|
|
1452 |
|
EOF |
1453 |
|
exit 1 |
1454 |
|
fi |
1455 |
|
fi |
1456 |
fi |
fi |
1457 |
THIS_SCRIPT=`echo ${0} | sed 's:'$TOOLSDIR':\$(TOOLSDIR):'` |
THIS_SCRIPT=`echo ${0} | sed 's:'$TOOLSDIR':\$(TOOLSDIR):'` |
1458 |
|
|
1597 |
rm -f ./.tmp_pack |
rm -f ./.tmp_pack |
1598 |
echo " packages are: $PACKAGES" |
echo " packages are: $PACKAGES" |
1599 |
|
|
1600 |
|
# Check availability of NetCDF and then either build the MNC template |
1601 |
|
# files or delete mnc from the list of available packages. |
1602 |
|
echo $PACKAGES | grep ' mnc ' > /dev/null 2>&1 |
1603 |
|
RETVAL=$? |
1604 |
|
if test "x$RETVAL" = x0 ; then |
1605 |
|
if test "x$HAVE_NETCDF" != xt ; then |
1606 |
|
cat <<EOF |
1607 |
|
|
1608 |
|
********************************************************************* |
1609 |
|
WARNING: the "mnc" package was enabled but tests failed to compile |
1610 |
|
NetCDF applications. Please check that: |
1611 |
|
|
1612 |
|
1) NetCDF is correctly installed for this compiler and |
1613 |
|
2) the LIBS variable (within the "optfile") specifies the correct |
1614 |
|
NetCDF library to link against. |
1615 |
|
|
1616 |
|
Due to this failure, the "mnc" package is now DISABLED. |
1617 |
|
********************************************************************* |
1618 |
|
|
1619 |
|
EOF |
1620 |
|
PACKAGES=`echo $PACKAGES | sed -e 's/mnc//g'` |
1621 |
|
DISABLE="$DISABLE mnc" |
1622 |
|
else |
1623 |
|
( cd $ROOTDIR"/pkg/mnc" && $MAKE testclean && $MAKE templates ) > make_mnc.errors 2>&1 |
1624 |
|
RETVAL=$? |
1625 |
|
if test "x${RETVAL}" = x0 ; then |
1626 |
|
rm -f make_mnc.errors |
1627 |
|
else |
1628 |
|
echo "Error: problem encountered while building source files in pkg/mnc:" |
1629 |
|
cat make_mnc.errors 1>&2 |
1630 |
|
exit 1 |
1631 |
|
fi |
1632 |
|
fi |
1633 |
|
fi |
1634 |
|
|
1635 |
echo " applying package dependency rules" |
echo " applying package dependency rules" |
1636 |
ck= |
ck= |
1637 |
while test "x$ck" != xtt ; do |
while test "x$ck" != xtt ; do |
1716 |
fi |
fi |
1717 |
done |
done |
1718 |
|
|
|
# Build MNC templates and check for ability to build and use NetCDF |
|
|
echo $PACKAGES | grep ' mnc ' > /dev/null 2>&1 |
|
|
RETVAL=$? |
|
|
if test "x$RETVAL" = x0 ; then |
|
|
( cd $ROOTDIR"/pkg/mnc" && $MAKE templates ) > make_mnc.errors 2>&1 |
|
|
RETVAL=$? |
|
|
if test "x${RETVAL}" = x0 ; then |
|
|
rm -f make_mnc.errors |
|
|
else |
|
|
echo "Error: problem encountered while building source files in pkg/mnc:" |
|
|
cat make_mnc.errors 1>&2 |
|
|
exit 1 |
|
|
fi |
|
|
if test "x$HAVE_NETCDF" != xt ; then |
|
|
cat <<EOF |
|
|
|
|
|
WARNING: the "mnc" package has been enabled but tests failed to |
|
|
compile and/or execute NetCDF applications. Please check that: |
|
|
|
|
|
1) NetCDF is installed for your compiler and |
|
|
2) the LIBS variable (within the 'optfile") specifies the correct |
|
|
NetCDF library to link against. |
|
|
|
|
|
EOF |
|
|
fi |
|
|
fi |
|
|
|
|
1719 |
# Create a list of #define and #undef to enable/disable packages |
# Create a list of #define and #undef to enable/disable packages |
1720 |
PACKAGES_DOT_H=PACKAGES_CONFIG.h |
PACKAGES_DOT_H=PACKAGES_CONFIG.h |
1721 |
# The following UGLY HACK sets multiple "#undef"s and it needs to go |
# The following UGLY HACK sets multiple "#undef"s and it needs to go |
1735 |
fi |
fi |
1736 |
done |
done |
1737 |
if test "x$has_pack" = xf ; then |
if test "x$has_pack" = xf ; then |
1738 |
undef=`echo "ALLOW_$n" | $AWK '{print toupper($0)}'` |
undef=`echo "ALLOW_$n" | sed -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` |
1739 |
DISABLED_PACKAGES="$DISABLED_PACKAGES -U$undef" |
DISABLED_PACKAGES="$DISABLED_PACKAGES -U$undef" |
1740 |
fi |
fi |
1741 |
fi |
fi |
1742 |
done |
done |
1743 |
ENABLED_PACKAGES= |
ENABLED_PACKAGES= |
1744 |
for i in $PACKAGES ; do |
for i in $PACKAGES ; do |
1745 |
def=`echo "ALLOW_$i" | $AWK '{print toupper($0)}'` |
def=`echo "ALLOW_$i" | sed -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` |
1746 |
ENABLED_PACKAGES="$ENABLED_PACKAGES -D$def" |
ENABLED_PACKAGES="$ENABLED_PACKAGES -D$def" |
1747 |
#eh3 DEFINES="$DEFINES -D$def" |
#eh3 DEFINES="$DEFINES -D$def" |
1748 |
|
|
1826 |
cat $i/$j >> ad_files |
cat $i/$j >> ad_files |
1827 |
done |
done |
1828 |
done |
done |
1829 |
|
if test ! "x"$FS = "x.f" ; then |
1830 |
|
cat ad_files | sed -e "s/\.f/$FS/g" > ad_files_f |
1831 |
|
mv -f ad_files_f ad_files |
1832 |
|
fi |
1833 |
|
|
1834 |
echo |
echo |
1835 |
echo "=== Creating the Makefile ===" |
echo "=== Creating the Makefile ===" |
1865 |
;; |
;; |
1866 |
./FC_NAMEMANGLE.h) |
./FC_NAMEMANGLE.h) |
1867 |
;; |
;; |
1868 |
|
./BUILD_INFO.h) |
1869 |
|
;; |
1870 |
*) |
*) |
1871 |
touch .links.tmp/$sf |
touch .links.tmp/$sf |
1872 |
deplist="$deplist $sf" |
deplist="$deplist $sf" |
1873 |
;; |
;; |
1874 |
esac |
esac |
1875 |
extn=`echo $sf | $AWK -F '.' '{print $NF}'` |
extn=`echo $sf | $AWK -F. '{print $NF}'` |
1876 |
case $extn in |
case $extn in |
1877 |
F) |
F) |
1878 |
echo " \\" >> srclist.inc |
echo " \\" >> srclist.inc |
1923 |
echo "# by the command:" >> $MAKEFILE |
echo "# by the command:" >> $MAKEFILE |
1924 |
echo "# $0 $G2ARGS" >> $MAKEFILE |
echo "# $0 $G2ARGS" >> $MAKEFILE |
1925 |
echo "# executed by:" >> $MAKEFILE |
echo "# executed by:" >> $MAKEFILE |
1926 |
echo "# $USER@${THISHOSTNAME}:${THISCWD}" >> $MAKEFILE |
echo "# ${THISUSER}@${THISHOST}:${THISCWD}" >> $MAKEFILE |
1927 |
|
|
1928 |
EXE_AD=$EXECUTABLE"_ad" |
EXE_AD=$EXECUTABLE"_ad" |
1929 |
EXE_FTL=$EXECUTABLE"_ftl" |
EXE_FTL=$EXECUTABLE"_ftl" |
1969 |
DISABLED_PACKAGES = ${DISABLED_PACKAGES} |
DISABLED_PACKAGES = ${DISABLED_PACKAGES} |
1970 |
|
|
1971 |
# These files are created by Makefile |
# These files are created by Makefile |
1972 |
SPECIAL_FILES = ${PACKAGES_DOT_H} AD_CONFIG.h FC_NAMEMANGLE.h |
SPECIAL_FILES = ${PACKAGES_DOT_H} AD_CONFIG.h FC_NAMEMANGLE.h BUILD_INFO.h |
1973 |
|
|
1974 |
EOF |
EOF |
1975 |
|
|
2012 |
NOOPTFILES = ${NOOPTFILES} |
NOOPTFILES = ${NOOPTFILES} |
2013 |
NOOPTFLAGS = ${NOOPTFLAGS} |
NOOPTFLAGS = ${NOOPTFLAGS} |
2014 |
# Flags and libraries needed for linking |
# Flags and libraries needed for linking |
2015 |
LIBS = ${LIBS} \$(XLIBS) |
LIBS = ${LIBS} |
2016 |
# Name of the Mekfile |
# Name of the Mekfile |
2017 |
MAKEFILE=${MAKEFILE} |
MAKEFILE=${MAKEFILE} |
2018 |
|
|
2073 |
cleanlinks: |
cleanlinks: |
2074 |
-find . -type l -exec rm {} \; |
-find . -type l -exec rm {} \; |
2075 |
|
|
2076 |
# Special targets ($SPECIAL_FILES) which are create by make |
# Special targets (SPECIAL_FILES) which are create by make |
2077 |
${PACKAGES_DOT_H}: |
${PACKAGES_DOT_H}: |
2078 |
@echo Creating \$@ ... |
@echo Creating \$@ ... |
2079 |
@$BASH\$(TOOLSDIR)/convert_cpp_cmd2defines "Warning - this file is automatically generated - do NOT edit" -bPACKAGES_CONFIG_H "Disabled packages:" \$(DISABLED_PACKAGES) " " "Enabled packages:" \$(ENABLED_PACKAGES) > \$@ |
@$BASH\$(TOOLSDIR)/convert_cpp_cmd2defines "Warning - this file is automatically generated - do NOT edit" -bPACKAGES_CONFIG_H "Disabled packages:" \$(DISABLED_PACKAGES) " " "Enabled packages:" \$(ENABLED_PACKAGES) > \$@ |
2084 |
@echo Creating \$@ ... |
@echo Creating \$@ ... |
2085 |
echo "$FC_NAMEMANGLE" > \$@ |
echo "$FC_NAMEMANGLE" > \$@ |
2086 |
|
|
2087 |
|
BUILD_INFO.h: |
2088 |
|
@echo Creating \$@ ... |
2089 |
|
EOF |
2090 |
|
|
2091 |
|
test ! "x$THISVER" = x && echo " -echo \"#define THISVER '$THISVER'\" > \$@" >> $MAKEFILE |
2092 |
|
test ! "x$THISUSER" = x && echo " -echo \"#define THISUSER '$THISUSER'\" >> \$@" >> $MAKEFILE |
2093 |
|
test ! "x$THISDATE" = x && echo " -echo \"#define THISDATE '$THISDATE'\" >> \$@" >> $MAKEFILE |
2094 |
|
test ! "x$THISHOST" = x && echo " -echo \"#define THISHOST '$THISHOST'\" >> \$@" >> $MAKEFILE |
2095 |
|
|
2096 |
|
cat >>$MAKEFILE <<EOF |
2097 |
|
|
2098 |
# The normal chain of rules is ( .F - .$FS - .o ) |
# The normal chain of rules is ( .F - .$FS - .o ) |
2099 |
|
|
2100 |
%.o : %.F |
## This nullifies any default implicit rules concerning these two file types: |
2101 |
|
## %.o : %.F |
2102 |
|
|
2103 |
.F.$FS: |
.F.$FS: |
2104 |
\$(CPP) \$(DEFINES) \$(INCLUDES) > \$@ |
\$(CPP) \$(DEFINES) \$(INCLUDES) > \$@ |
2154 |
|
|
2155 |
# ... AD ... |
# ... AD ... |
2156 |
adall: ad_taf |
adall: ad_taf |
2157 |
adtaf: ad_taf_output.f |
adtaf: ad_taf_output.$FS |
2158 |
adtamc: ad_tamc_output.f |
adtamc: ad_tamc_output.$FS |
2159 |
|
|
2160 |
ad_input_code.f: \$(AD_FILES) \$(HEADERFILES) |
ad_input_code.$FS: \$(AD_FILES) \$(HEADERFILES) |
2161 |
@$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 |
2162 |
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 |
2163 |
-rm -f ad_config.template |
-rm -f ad_config.template |
2164 |
@make \$(F77FILES) |
@make \$(F77FILES) |
2165 |
@make \$(AD_FLOW_FILES) |
@make \$(AD_FLOW_FILES) |
2166 |
cat \$(AD_FLOW_FILES) \$(AD_FILES) > ad_input_code.f |
cat \$(AD_FLOW_FILES) \$(AD_FILES) > ad_input_code.$FS |
2167 |
|
|
2168 |
ad_taf_output.f: ad_input_code.f |
ad_taf_output.$FS: ad_input_code.$FS |
2169 |
\$(TAF) \$(AD_TAF_FLAGS) \$(TAF_EXTRA) ad_input_code.f |
\$(TAF) \$(AD_TAF_FLAGS) \$(TAF_EXTRA) ad_input_code.$FS |
2170 |
cat ad_input_code_ad.f | sed -f \$(TOOLSDIR)/adjoint_sed > ad_taf_output.f |
cat ad_input_code_ad.$FS | sed -f \$(TOOLSDIR)/adjoint_sed > ad_taf_output.$FS |
2171 |
|
|
2172 |
adtafonly: |
adtafonly: |
2173 |
\$(TAF) \$(AD_TAF_FLAGS) \$(TAF_EXTRA) ad_input_code.f |
\$(TAF) \$(AD_TAF_FLAGS) \$(TAF_EXTRA) ad_input_code.$FS |
2174 |
cat ad_input_code_ad.f | sed -f \$(TOOLSDIR)/adjoint_sed > ad_taf_output.f |
cat ad_input_code_ad.$FS | sed -f \$(TOOLSDIR)/adjoint_sed > ad_taf_output.$FS |
2175 |
|
|
2176 |
ad_taf: ad_taf_output.o \$(OBJFILES) |
ad_taf: ad_taf_output.o \$(OBJFILES) |
2177 |
\$(LINK) -o ${EXE_AD} \$(FFLAGS) \$(FOPTIM) \$(OBJFILES) ad_taf_output.o \$(LIBS) |
\$(LINK) -o ${EXE_AD} \$(FFLAGS) \$(FOPTIM) \$(OBJFILES) ad_taf_output.o \$(LIBS) |
2178 |
|
|
2179 |
ad_tamc_output.f: ad_input_code.f |
ad_tamc_output.$FS: ad_input_code.$FS |
2180 |
\$(TAMC) \$(AD_TAMC_FLAGS) \$(TAMC_EXTRA) ad_input_code.f |
\$(TAMC) \$(AD_TAMC_FLAGS) \$(TAMC_EXTRA) ad_input_code.$FS |
2181 |
cat ad_input_code_ad.f | sed -f \$(TOOLSDIR)/adjoint_sed > ad_tamc_output.f |
cat ad_input_code_ad.$FS | sed -f \$(TOOLSDIR)/adjoint_sed > ad_tamc_output.$FS |
2182 |
|
|
2183 |
ad_tamc: ad_tamc_output.o \$(OBJFILES) |
ad_tamc: ad_tamc_output.o \$(OBJFILES) |
2184 |
\$(LINK) -o ${EXE_AD} \$(FFLAGS) \$(FOPTIM) \$(OBJFILES) ad_tamc_output.o \$(LIBS) |
\$(LINK) -o ${EXE_AD} \$(FFLAGS) \$(FOPTIM) \$(OBJFILES) ad_tamc_output.o \$(LIBS) |
2185 |
|
|
2186 |
|
adonlyfwd: |
2187 |
|
patch < \$(TOOLSDIR)/ad_taf_output.f.onlyfwd.diff |
2188 |
|
|
2189 |
|
adtrick: |
2190 |
|
patch < \$(TOOLSDIR)/ad_taf_output.f.adtrick.diff |
2191 |
|
|
2192 |
# ... FTL ... |
# ... FTL ... |
2193 |
ftlall: ftl_taf |
ftlall: ftl_taf |
2194 |
ftltaf: ftl_taf_output.f |
ftltaf: ftl_taf_output.$FS |
2195 |
ftltamc: ftl_tamc_output.f |
ftltamc: ftl_tamc_output.$FS |
2196 |
|
|
2197 |
ftl_input_code.f: \$(AD_FILES) \$(HEADERFILES) |
ftl_input_code.$FS: \$(AD_FILES) \$(HEADERFILES) |
2198 |
@$BASH\$(TOOLSDIR)/convert_cpp_cmd2defines "Warning - this file is automatically generated - do NOT edit" -UALLOW_ADJOINT_RUN -DALLOW_TANGENTLINEAR_RUN -UALLOW_ECCO_OPTIMIZATION > ftl_config.template |
@$BASH\$(TOOLSDIR)/convert_cpp_cmd2defines "Warning - this file is automatically generated - do NOT edit" -UALLOW_ADJOINT_RUN -DALLOW_TANGENTLINEAR_RUN -UALLOW_ECCO_OPTIMIZATION > ftl_config.template |
2199 |
cmp ftl_config.template AD_CONFIG.h || cat ftl_config.template > AD_CONFIG.h |
cmp ftl_config.template AD_CONFIG.h || cat ftl_config.template > AD_CONFIG.h |
2200 |
-rm -f ftl_config.template |
-rm -f ftl_config.template |
2201 |
@make \$(F77FILES) |
@make \$(F77FILES) |
2202 |
@make \$(AD_FLOW_FILES) |
@make \$(AD_FLOW_FILES) |
2203 |
cat \$(AD_FLOW_FILES) \$(AD_FILES) > ftl_input_code.f |
cat \$(AD_FLOW_FILES) \$(AD_FILES) > ftl_input_code.$FS |
2204 |
|
|
2205 |
ftl_taf_output.f: ftl_input_code.f |
ftl_taf_output.$FS: ftl_input_code.$FS |
2206 |
\$(TAF) \$(FTL_TAF_FLAGS) \$(TAF_EXTRA) ftl_input_code.f |
\$(TAF) \$(FTL_TAF_FLAGS) \$(TAF_EXTRA) ftl_input_code.$FS |
2207 |
cat ftl_input_code_ftl.f | sed -f \$(TOOLSDIR)/adjoint_sed > ftl_taf_output.f |
cat ftl_input_code_ftl.$FS | sed -f \$(TOOLSDIR)/adjoint_sed > ftl_taf_output.$FS |
2208 |
|
|
2209 |
ftltafonly: |
ftltafonly: |
2210 |
\$(TAF) \$(FTL_TAF_FLAGS) \$(TAF_EXTRA) ftl_input_code.f |
\$(TAF) \$(FTL_TAF_FLAGS) \$(TAF_EXTRA) ftl_input_code.$FS |
2211 |
cat ftl_input_code_ftl.f | sed -f \$(TOOLSDIR)/adjoint_sed > ftl_taf_output.f |
cat ftl_input_code_ftl.$FS | sed -f \$(TOOLSDIR)/adjoint_sed > ftl_taf_output.$FS |
2212 |
|
|
2213 |
ftl_taf: ftl_taf_output.o \$(OBJFILES) |
ftl_taf: ftl_taf_output.o \$(OBJFILES) |
2214 |
\$(LINK) -o ${EXE_FTL} \$(FFLAGS) \$(FOPTIM) \$(OBJFILES) ftl_taf_output.o \$(LIBS) |
\$(LINK) -o ${EXE_FTL} \$(FFLAGS) \$(FOPTIM) \$(OBJFILES) ftl_taf_output.o \$(LIBS) |
2215 |
|
|
2216 |
ftl_tamc_output.f: ftl_input_code.f |
ftl_tamc_output.$FS: ftl_input_code.$FS |
2217 |
\$(TAMC) \$(FTL_TAMC_FLAGS) \$(TAMC_EXTRA) ftl_input_code.f |
\$(TAMC) \$(FTL_TAMC_FLAGS) \$(TAMC_EXTRA) ftl_input_code.$FS |
2218 |
cat ftl_input_code_ftl.f | sed -f \$(TOOLSDIR)/adjoint_sed > ftl_tamc_output.f |
cat ftl_input_code_ftl.$FS | sed -f \$(TOOLSDIR)/adjoint_sed > ftl_tamc_output.$FS |
2219 |
|
|
2220 |
ftl_tamc: ftl_tamc_output.o \$(OBJFILES) |
ftl_tamc: ftl_tamc_output.o \$(OBJFILES) |
2221 |
\$(LINK) -o ${EXE_FTL} \$(FFLAGS) \$(FOPTIM) \$(OBJFILES) ftl_tamc_output.o \$(LIBS) |
\$(LINK) -o ${EXE_FTL} \$(FFLAGS) \$(FOPTIM) \$(OBJFILES) ftl_tamc_output.o \$(LIBS) |
2222 |
|
|
2223 |
|
|
2224 |
# ... SVD ... |
# ... SVD ... |
2225 |
svdtaf: ad_taf_output.f ftl_taf_output.f |
svdtaf: ad_taf_output.$FS ftl_taf_output.$FS |
2226 |
svdall: svd_taf |
@echo "--->>> Only ran TAF to generate SVD code! <<<---" |
2227 |
|
@echo "--->>> Do make svdall afterwards to compile. <<<---" |
2228 |
|
svdall: svd_touch svd_taf |
2229 |
|
|
2230 |
svd_taf: ad_taf_output.o ftl_taf_output.o \$(OBJFILES) |
svd_taf: \$(OBJFILES) |
2231 |
\$(LINK) -o mitgcmuv_svd \$(FFLAGS) \$(FOPTIM) \$(OBJFILES) ad_taf_output.o ftl_taf_output.o \$(LIBS) |
\$(LINK) -o mitgcmuv_svd \$(FFLAGS) \$(FOPTIM) \$(OBJFILES) ad_taf_output.o ftl_taf_output.o \$(LIBS) |
2232 |
|
|
2233 |
|
@echo "--->>> Only COMPILE svd code! <<<---" |
2234 |
|
@echo "--->>> Assumes you previously <<<---" |
2235 |
|
@echo "--->>> did make svdtaf <<<---" |
2236 |
|
|
2237 |
|
svd_touch: |
2238 |
|
@echo "--->>> Only COMPILE svd code! <<<---" |
2239 |
|
@echo "--->>> Assumes you previously <<<---" |
2240 |
|
@echo "--->>> did make svdtaf <<<---" |
2241 |
|
touch ad_taf_output.$FS ftl_taf_output.$FS |
2242 |
|
\$(FC) \$(FFLAGS) \$(FOPTIM) -c ad_taf_output.$FS |
2243 |
|
\$(FC) \$(FFLAGS) \$(FOPTIM) -c ftl_taf_output.$FS |
2244 |
|
@$BASH\$(TOOLSDIR)/convert_cpp_cmd2defines "Warning - this file is automatically generated - do NOT edit" -UALLOW_ADJOINT_RUN -DALLOW_TANGENTLINEAR_RUN -UALLOW_ECCO_OPTIMIZATION > ftl_config.template |
2245 |
|
cmp ftl_config.template AD_CONFIG.h || cat ftl_config.template > AD_CONFIG.h |
2246 |
|
-rm -f ftl_config.template |
2247 |
|
|
2248 |
#========================================= |
#========================================= |
2249 |
|
|