675 |
} |
} |
676 |
|
|
677 |
|
|
678 |
|
check_HAVE_STAT() { |
679 |
|
get_fortran_c_namemangling |
680 |
|
cat <<EOF > genmake_tc_1.c |
681 |
|
$FC_NAMEMANGLE |
682 |
|
#include <stdio.h> |
683 |
|
#include <stdlib.h> |
684 |
|
#include <unistd.h> |
685 |
|
#include <sys/stat.h> |
686 |
|
#include <sys/types.h> |
687 |
|
void FC_NAMEMANGLE(tfsize) ( int *nbyte ) |
688 |
|
{ |
689 |
|
char name[512]; |
690 |
|
struct stat astat; |
691 |
|
|
692 |
|
name[0] = 'a'; name[1] = '\0'; |
693 |
|
if (! stat(name, &astat)) |
694 |
|
*nbyte = (int)(astat.st_size); |
695 |
|
else |
696 |
|
*nbyte = -1; |
697 |
|
} |
698 |
|
EOF |
699 |
|
make genmake_tc_1.o >> genmake_tc.log 2>&1 |
700 |
|
RET_C=$? |
701 |
|
cat <<EOF > genmake_tc_2.f |
702 |
|
program hello |
703 |
|
integer nbyte |
704 |
|
call tfsize(nbyte) |
705 |
|
print *," HELLO WORLD", nbyte |
706 |
|
end program hello |
707 |
|
EOF |
708 |
|
$FC $FFLAGS -o genmake_tc genmake_tc_2.f genmake_tc_1.o >> genmake_tc.log 2>&1 |
709 |
|
RET_F=$? |
710 |
|
test -x ./genmake_tc && ./genmake_tc >> genmake_tc.log 2>&1 |
711 |
|
RETVAL=$? |
712 |
|
if test "x$RETVAL" = x0 ; then |
713 |
|
HAVE_STAT=t |
714 |
|
DEFINES="$DEFINES -DHAVE_STAT" |
715 |
|
fi |
716 |
|
rm -f genmake_tc* |
717 |
|
} |
718 |
|
|
719 |
|
|
720 |
check_netcdf_libs() { |
check_netcdf_libs() { |
721 |
echo "" > genmake_tnc.log |
echo "" > genmake_tnc.log |
722 |
cat <<EOF > genmake_tnc.for |
cat <<EOF > genmake_tnc.for |
810 |
HAVE_FDATE= |
HAVE_FDATE= |
811 |
FC_NAMEMANGLE= |
FC_NAMEMANGLE= |
812 |
HAVE_CLOC= |
HAVE_CLOC= |
813 |
|
HAVE_STAT= |
814 |
HAVE_NETCDF= |
HAVE_NETCDF= |
815 |
HAVE_ETIME= |
HAVE_ETIME= |
816 |
|
|
904 |
echo "none found" |
echo "none found" |
905 |
fi |
fi |
906 |
|
|
907 |
echo "$0::$1:$2:$3:$4:$5:$6:$7:" |
#echo "$0::$1:$2:$3:$4:$5:$6:$7:" |
908 |
#OPTIONS= |
#OPTIONS= |
909 |
#n=0 |
#n=0 |
910 |
#for i ; do |
#for i ; do |
1336 |
fi |
fi |
1337 |
rm -f genmake_t* |
rm -f genmake_t* |
1338 |
|
|
1339 |
|
printf " Can we use stat() through C calls... " |
1340 |
|
check_HAVE_STAT |
1341 |
|
if test "x$HAVE_STAT" != x ; then |
1342 |
|
echo "yes" |
1343 |
|
else |
1344 |
|
echo "no" |
1345 |
|
fi |
1346 |
|
rm -f genmake_t* |
1347 |
|
|
1348 |
printf " Can we create NetCDF-enabled binaries... " |
printf " Can we create NetCDF-enabled binaries... " |
1349 |
check_netcdf_libs |
check_netcdf_libs |
1350 |
if test "x$HAVE_NETCDF" != x ; then |
if test "x$HAVE_NETCDF" != x ; then |
1397 |
exit 1 |
exit 1 |
1398 |
fi |
fi |
1399 |
if test "x$S64" = x ; then |
if test "x$S64" = x ; then |
1400 |
S64='$(TOOLSDIR)/set64bitConst.sh' |
echo "3.0 _d 3" | ${TOOLSDIR}/set64bitConst.sh > /dev/null 2>&1 |
1401 |
|
RETVAL=$? |
1402 |
|
if test "x${RETVAL}" = x0 ; then |
1403 |
|
S64='$(TOOLSDIR)/set64bitConst.sh' |
1404 |
|
else |
1405 |
|
echo "3.0 _d 3" | ${TOOLSDIR}/set64bitConst.csh > /dev/null 2>&1 |
1406 |
|
RETVAL=$? |
1407 |
|
if test "x${RETVAL}" = x0 ; then |
1408 |
|
S64='$(TOOLSDIR)/set64bitConst.csh' |
1409 |
|
else |
1410 |
|
cat <<EOF |
1411 |
|
|
1412 |
|
ERROR: neither of the two default scripts: |
1413 |
|
|
1414 |
|
${TOOLSDIR}/set64bitConst.sh |
1415 |
|
${TOOLSDIR}/set64bitConst.csh |
1416 |
|
|
1417 |
|
are working so please check paths or specify (with \$S64) a |
1418 |
|
working version of this script. |
1419 |
|
|
1420 |
|
EOF |
1421 |
|
exit 1 |
1422 |
|
fi |
1423 |
|
fi |
1424 |
fi |
fi |
1425 |
THIS_SCRIPT=`echo ${0} | sed 's:'$TOOLSDIR':\$(TOOLSDIR):'` |
THIS_SCRIPT=`echo ${0} | sed 's:'$TOOLSDIR':\$(TOOLSDIR):'` |
1426 |
|
|
1977 |
NOOPTFILES = ${NOOPTFILES} |
NOOPTFILES = ${NOOPTFILES} |
1978 |
NOOPTFLAGS = ${NOOPTFLAGS} |
NOOPTFLAGS = ${NOOPTFLAGS} |
1979 |
# Flags and libraries needed for linking |
# Flags and libraries needed for linking |
1980 |
LIBS = ${LIBS} \$(XLIBS) |
LIBS = ${LIBS} |
1981 |
# Name of the Mekfile |
# Name of the Mekfile |
1982 |
MAKEFILE=${MAKEFILE} |
MAKEFILE=${MAKEFILE} |
1983 |
|
|
2148 |
ad_tamc: ad_tamc_output.o \$(OBJFILES) |
ad_tamc: ad_tamc_output.o \$(OBJFILES) |
2149 |
\$(LINK) -o ${EXE_AD} \$(FFLAGS) \$(FOPTIM) \$(OBJFILES) ad_tamc_output.o \$(LIBS) |
\$(LINK) -o ${EXE_AD} \$(FFLAGS) \$(FOPTIM) \$(OBJFILES) ad_tamc_output.o \$(LIBS) |
2150 |
|
|
2151 |
|
adonlyfwd: |
2152 |
|
patch < \$(TOOLSDIR)/ad_taf_output.f.onlyfwd.diff |
2153 |
|
|
2154 |
|
adtrick: |
2155 |
|
patch < \$(TOOLSDIR)/ad_taf_output.f.adtrick.diff |
2156 |
|
|
2157 |
# ... FTL ... |
# ... FTL ... |
2158 |
ftlall: ftl_taf |
ftlall: ftl_taf |