/[MITgcm]/MITgcm/tools/genmake2
ViewVC logotype

Diff of /MITgcm/tools/genmake2

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.115 by edhill, Thu Jan 6 15:09:54 2005 UTC revision 1.118 by edhill, Wed Feb 9 17:34:19 2005 UTC
# Line 581  WARNING: Please contact <MITgcm-support@ Line 581  WARNING: Please contact <MITgcm-support@
581  EOF  EOF
582          return 1          return 1
583      fi      fi
584      cat > genmake_tcomp.f <<EOF      cat > genmake_tcomp.$FS <<EOF
585        subroutine tcall( string )        subroutine tcall( string )
586        character*(*) string        character*(*) string
587        call tsub( string )        call tsub( string )
588        end        end
589  EOF  EOF
590      $FC $FFLAGS $DEFINES -c genmake_tcomp.f >> genmake_warnings 2>&1      $FC $FFLAGS $DEFINES -c genmake_tcomp.$FS >> genmake_warnings 2>&1
591      RETVAL=$?      RETVAL=$?
592      if test "x$RETVAL" != x0 ; then      if test "x$RETVAL" != x0 ; then
593          FC_NAMEMANGLE=$default_nm          FC_NAMEMANGLE=$default_nm
# Line 653  void FC_NAMEMANGLE(cloc) ( double *curti Line 653  void FC_NAMEMANGLE(cloc) ( double *curti
653   *curtim = *curtim/1.E6;   *curtim = *curtim/1.E6;
654  }  }
655  EOF  EOF
656      make genmake_tc_1.o >> genmake_tc.log 2>&1      make genmake_tc_1.o >> genmake_warnings 2>&1
657      RET_C=$?      RET_C=$?
658      cat <<EOF > genmake_tc_2.f      cat <<EOF > genmake_tc_2.$FS
659        program hello        program hello
660        Real*8 wtime        Real*8 wtime
661        external cloc        external cloc
# Line 663  EOF Line 663  EOF
663        print *," HELLO WORLD", wtime        print *," HELLO WORLD", wtime
664        end program hello        end program hello
665  EOF  EOF
666      $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
667      RET_F=$?      RET_F=$?
668      test -x ./genmake_tc  &&  ./genmake_tc >> genmake_tc.log 2>&1      test -x ./genmake_tc  &&  ./genmake_tc >> genmake_warnings 2>&1
669      RETVAL=$?      RETVAL=$?
670      if test "x$RETVAL" = x0 ; then      if test "x$RETVAL" = x0 ; then
671          HAVE_CLOC=t          HAVE_CLOC=t
# Line 698  void FC_NAMEMANGLE(tfsize) ( int *nbyte Line 698  void FC_NAMEMANGLE(tfsize) ( int *nbyte
698  EOF  EOF
699      make genmake_tc_1.o >> genmake_tc.log 2>&1      make genmake_tc_1.o >> genmake_tc.log 2>&1
700      RET_C=$?      RET_C=$?
701      cat <<EOF > genmake_tc_2.f      cat <<EOF > genmake_tc_2.$FS
702        program hello        program hello
703        integer nbyte        integer nbyte
704        call tfsize(nbyte)        call tfsize(nbyte)
705        print *," HELLO WORLD", nbyte        print *," HELLO WORLD", nbyte
706        end program hello        end program hello
707  EOF  EOF
708      $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_tc.log 2>&1
709      RET_F=$?      RET_F=$?
710      test -x ./genmake_tc  &&  ./genmake_tc >> genmake_tc.log 2>&1      test -x ./genmake_tc  &&  ./genmake_tc >> genmake_tc.log 2>&1
711      RETVAL=$?      RETVAL=$?
# Line 722  check_netcdf_libs()  { Line 722  check_netcdf_libs()  {
722          return          return
723      fi      fi
724      echo "" > genmake_tnc.log      echo "" > genmake_tnc.log
725      cat <<EOF > genmake_tnc.for      cat <<EOF > genmake_tnc.F
726        program fgennc        program fgennc
727  #include "netcdf.inc"  #include "netcdf.inc"
728  EOF  EOF
729      if test ! "x$MPI" = x ; then      if test ! "x$MPI" = x ; then
730          echo '#include "mpif.h"' >> genmake_tnc.for          echo '#include "mpif.h"' >> genmake_tnc.F
731      fi      fi
732      cat <<EOF >> genmake_tnc.for      cat <<EOF >> genmake_tnc.F
733        integer iret, ncid, xid        integer iret, ncid, xid
734        iret = nf_create('genmake_tnc.nc', NF_CLOBBER, ncid)        iret = nf_create('genmake_tnc.nc', NF_CLOBBER, ncid)
735        IF (iret .NE. NF_NOERR) write(*,*) NF_STRERROR(iret)        IF (iret .NE. NF_NOERR) write(*,*) NF_STRERROR(iret)
# Line 740  EOF Line 740  EOF
740        end        end
741  EOF  EOF
742      echo "Executing:" > genmake_tnc.log      echo "Executing:" > genmake_tnc.log
743      echo "  $CPP $DEFINES $INCLUDES genmake_tnc.for > genmake_tnc.f" \      echo "  $CPP $DEFINES $INCLUDES genmake_tnc.F > genmake_tnc.$FS" \
744          > genmake_tnc.log          > genmake_tnc.log
745      RET_CPP=f      RET_CPP=f
746      $CPP $DEFINES $INCLUDES genmake_tnc.for > genmake_tnc.f 2>/dev/null  \      $CPP $DEFINES $INCLUDES genmake_tnc.F > genmake_tnc.$FS 2>/dev/null  \
747          &&  RET_CPP=t          &&  RET_CPP=t
748      if test "x$RET_CPP" = xf ; then      if test "x$RET_CPP" = xf ; then
749          echo "  WARNING: CPP failed to pre-process the netcdf test." \          echo "  WARNING: CPP failed to pre-process the netcdf test." \
# Line 752  EOF Line 752  EOF
752              > genmake_tnc.log              > genmake_tnc.log
753      fi      fi
754      echo "Executing:" > genmake_tnc.log      echo "Executing:" > genmake_tnc.log
755      echo "  $FC $FFLAGS $FOPTIM -c genmake_tnc.f" > genmake_tnc.log      echo "  $FC $FFLAGS $FOPTIM -c genmake_tnc.$FS" > genmake_tnc.log
756      echo "  $LINK -o genmake_tnc.o $LIBS" > genmake_tnc.log      echo "  $LINK -o genmake_tnc.o $LIBS" > genmake_tnc.log
757      $FC $FFLAGS $FOPTIM -c genmake_tnc.f >> genmake_tnc.log 2>&1  \      $FC $FFLAGS $FOPTIM -c genmake_tnc.$FS >> genmake_tnc.log 2>&1  \
758          &&  $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
759      RET_COMPILE=$?      RET_COMPILE=$?
760    
# Line 769  EOF Line 769  EOF
769          HAVE_NETCDF=t          HAVE_NETCDF=t
770      else      else
771          # try again with "-lnetcdf" added to the libs          # try again with "-lnetcdf" added to the libs
772          $CPP $DEFINES $INCLUDES genmake_tnc.for > genmake_tnc.f 2>/dev/null  \          $CPP $DEFINES $INCLUDES genmake_tnc.F > genmake_tnc.$FS 2>/dev/null  \
773              &&  $FC $FFLAGS $FOPTIM -c genmake_tnc.f >> genmake_tnc.log 2>&1  \              &&  $FC $FFLAGS $FOPTIM -c genmake_tnc.$FS >> genmake_tnc.log 2>&1  \
774              &&  $LINK -o genmake_tnc genmake_tnc.o $LIBS -lnetcdf >> genmake_tnc.log 2>&1              &&  $LINK -o genmake_tnc genmake_tnc.o $LIBS -lnetcdf >> genmake_tnc.log 2>&1
775          RET_COMPILE=$?          RET_COMPILE=$?
776          if test "x$RET_COMPILE" = x0 ; then          if test "x$RET_COMPILE" = x0 ; then
# Line 1286  fi Line 1286  fi
1286    
1287  printf "\n===  Checking system libraries  ===\n"  printf "\n===  Checking system libraries  ===\n"
1288  printf "  Do we have the system() command using $FC...  "  printf "  Do we have the system() command using $FC...  "
1289  cat > genmake_tcomp.f <<EOF  cat > genmake_tcomp.$FS <<EOF
1290        program hello        program hello
1291        call system('echo hi')        call system('echo hi')
1292        end        end
1293  EOF  EOF
1294  $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
1295  RETVAL=$?  RETVAL=$?
1296  if test "x$RETVAL" = x0 ; then  if test "x$RETVAL" = x0 ; then
1297      HAVE_SYSTEM=t      HAVE_SYSTEM=t
# Line 1304  fi Line 1304  fi
1304  rm -f genmake_tcomp*  rm -f genmake_tcomp*
1305    
1306  printf "  Do we have the fdate() command using $FC...  "  printf "  Do we have the fdate() command using $FC...  "
1307  cat > genmake_tcomp.f <<EOF  cat > genmake_tcomp.$FS <<EOF
1308        program hello        program hello
1309        CHARACTER(128) string        CHARACTER(128) string
1310        string = ' '        string = ' '
# Line 1312  cat > genmake_tcomp.f <<EOF Line 1312  cat > genmake_tcomp.f <<EOF
1312        print *, string        print *, string
1313        end        end
1314  EOF  EOF
1315  $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
1316  RETVAL=$?  RETVAL=$?
1317  if test "x$RETVAL" = x0 ; then  if test "x$RETVAL" = x0 ; then
1318      HAVE_FDATE=t      HAVE_FDATE=t
# Line 1325  fi Line 1325  fi
1325  rm -f genmake_tcomp*  rm -f genmake_tcomp*
1326    
1327  printf "  Do we have the etime() command using $FC...  "  printf "  Do we have the etime() command using $FC...  "
1328  cat > genmake_tcomp.f <<EOF  cat > genmake_tcomp.$FS <<EOF
1329        program hello        program hello
1330        REAL*4 ACTUAL, TARRAY(2)        REAL*4 ACTUAL, TARRAY(2)
1331        EXTERNAL ETIME        EXTERNAL ETIME
# Line 1334  cat > genmake_tcomp.f <<EOF Line 1334  cat > genmake_tcomp.f <<EOF
1334        print *, tarray        print *, tarray
1335        end        end
1336  EOF  EOF
1337  $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
1338  RETVAL=$?  RETVAL=$?
1339  if test "x$RETVAL" = x0 ; then  if test "x$RETVAL" = x0 ; then
1340      HAVE_ETIME=t      HAVE_ETIME=t
# Line 1722  for n in $names ; do Line 1722  for n in $names ; do
1722              fi              fi
1723          done          done
1724          if test "x$has_pack" = xf ; then          if test "x$has_pack" = xf ; then
1725              undef=`echo "ALLOW_$n" | $AWK '{print toupper($0)}'`              undef=`echo "ALLOW_$n" | sed -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
1726              DISABLED_PACKAGES="$DISABLED_PACKAGES -U$undef"              DISABLED_PACKAGES="$DISABLED_PACKAGES -U$undef"
1727          fi          fi
1728      fi      fi
1729  done  done
1730  ENABLED_PACKAGES=  ENABLED_PACKAGES=
1731  for i in $PACKAGES ; do  for i in $PACKAGES ; do
1732      def=`echo "ALLOW_$i" | $AWK '{print toupper($0)}'`      def=`echo "ALLOW_$i" | sed -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
1733      ENABLED_PACKAGES="$ENABLED_PACKAGES -D$def"      ENABLED_PACKAGES="$ENABLED_PACKAGES -D$def"
1734  #eh3 DEFINES="$DEFINES -D$def"  #eh3 DEFINES="$DEFINES -D$def"
1735    

Legend:
Removed from v.1.115  
changed lines
  Added in v.1.118

  ViewVC Help
Powered by ViewVC 1.1.22