/[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.190 by utke, Wed Apr 22 18:35:00 2009 UTC revision 1.191 by jmc, Wed Apr 22 19:21:18 2009 UTC
# Line 1790  fi Line 1790  fi
1790    
1791  printf "\n===  Setting defaults  ===\n"  printf "\n===  Setting defaults  ===\n"
1792  printf "  Adding MODS directories: "  printf "  Adding MODS directories: "
 MPI_LNKF=  
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
# Line 1800  for d in $MODS ; do Line 1799  for d in $MODS ; do
1799          printf "$d "          printf "$d "
1800          SOURCEDIRS="$SOURCEDIRS $d"          SOURCEDIRS="$SOURCEDIRS $d"
1801          INCLUDEDIRS="$INCLUDEDIRS $d"          INCLUDEDIRS="$INCLUDEDIRS $d"
         #-------------------------------------------------------  
         # Put special links so that MPI specific files are used  
         MPI_FILES=`(cd $d ; find . -name "*_mpi" -print)`  
         for i in $MPI_FILES ; do  
           ii=`echo $i | sed 's:^\./::'`  
           name=`echo $ii | sed 's:_mpi::' `  
           if test "x$MPI" = x ; then  
           # NO: We undo an _mpi symbolically linked file  
             if test -L $name ; then  
               cmp $name "$d/$ii" > /dev/null 2>&1  
               RETVAL=$?  
               if test "x$RETVAL" = x0 ; then  
                 printf "Un-linking $name ; "  
                 rm -f $name  
               fi  
             fi  
           else  
           # YES: We symbolically link this file (with conditions if already there)  
             if test -L $name ; then  
               cmp $d/$ii $name > /dev/null 2>&1  
               RETVAL=$?  
               yy=0 ;  
               for xx in $MPI_LNKF ; do if test $xx = $name ; then yy=1 ; fi ; done  
               if test "x$RETVAL" != x0 -a $yy = 0 ; then  
               # remove sym-link if different and has not just been linked  
                 printf "Un-link + "  
                 rm -f $name  
               fi  
               if test "x$RETVAL" = x0 ; then  
               # if identical, keep sym-link and keep record of it  
                 MPI_LNKF="$MPI_LNKF $name"  
               fi  
             fi  
             if ! test -f $name ; then  
               # make sym-link and keep record of it  
                 printf "Linking $ii to $name ; "  
                 ln -sf $d/$ii $name  
                 MPI_LNKF="$MPI_LNKF $name"  
             fi  
           fi  
         done  
         #-------------------------------------------------------  
1802      fi      fi
1803  done  done
1804  echo  echo
 #echo "MPI_LNKF='$MPI_LNKF'"  
1805    
1806  if test "x${PLATFORM}" = x ; then  if test "x${PLATFORM}" = x ; then
1807      PLATFORM=$p_PLATFORM      PLATFORM=$p_PLATFORM

Legend:
Removed from v.1.190  
changed lines
  Added in v.1.191

  ViewVC Help
Powered by ViewVC 1.1.22