/[escript]/trunk/scripts/finley_wrapper_template
ViewVC logotype

Diff of /trunk/scripts/finley_wrapper_template

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

revision 2342 by jfenwick, Fri Mar 27 05:01:49 2009 UTC revision 2343 by jfenwick, Mon Mar 30 01:34:45 2009 UTC
# Line 77  Usage: escript [options] script.py [argu Line 77  Usage: escript [options] script.py [argu
77      -c      print compile information for escript and exit      -c      print compile information for escript and exit
78      -V      print escript version and exit      -V      print escript version and exit
79      -i      interactive mode      -i      interactive mode
80        -b      do not invoke python (run non-python programs)
81      -e      print export statements for environment and exit      -e      print export statements for environment and exit
82      -o      redirect output from MPI to files      -o      redirect output from MPI to files
83      -v      print diagnostics      -v      print diagnostics
# Line 109  MPI_NUM_PROCS=1 Line 110  MPI_NUM_PROCS=1
110    
111  # Parse the command-line options  # Parse the command-line options
112  # option e should not be followed by a :  # option e should not be followed by a :
113  while getopts 'n:p:t:f:h:ecVviox' option  while getopts 'bn:p:t:f:h:ecVviox' option
114  do  do
115      case "$option" in      case "$option" in
116          "b")  DOBINARY=yes
117            ;;
118        "n")  ESCRIPT_NUM_NODES=$OPTARG        "n")  ESCRIPT_NUM_NODES=$OPTARG
119          ;;          ;;
120        "p")  ESCRIPT_NUM_PROC=$OPTARG        "p")  ESCRIPT_NUM_PROC=$OPTARG
# Line 166  then Line 169  then
169      export DYLD_LIBRARY_PATH=$EXTRA_DYLD_LIBRARY_PATH:$EXTRA_LD_LIBRARY_PATH:$DYLD_LIBRARY_PATH      export DYLD_LIBRARY_PATH=$EXTRA_DYLD_LIBRARY_PATH:$EXTRA_LD_LIBRARY_PATH:$DYLD_LIBRARY_PATH
170  fi  fi
171    
172    if [ ! -z $DOBINARY ]
173    then
174        PYTHON_CMD=''
175    fi
176    
177    
178  # Check to see if the python version we were compiled with matches the one of PYTHON_CMD  # Check to see if the python version we were compiled with matches the one of PYTHON_CMD
179  if [ -f $ESCRIPT_ROOT/lib/pyversion ]  # We should only do this check if they are running a python script
180    if [[ (! -z $PYTHON_CMD ) && -f $ESCRIPT_ROOT/lib/pyversion ]]
181  then  then
182     compversion=`cat $ESCRIPT_ROOT/lib/pyversion`     compversion=`cat $ESCRIPT_ROOT/lib/pyversion`
183     intversion=`python --version 2>&1`     intversion=`$PYTHON_CMD --version 2>&1`
184     if [ "$compversion" != "$intversion" ]     if [ "$compversion" != "$intversion" ]
185     then     then
186        echo "Python versions do not match. Escript was compiled for "$compversion"."        echo "Python versions do not match. Escript was compiled for "$compversion"."
# Line 181  fi Line 191  fi
191    
192  # Must have at least one command-line arg: the python script  # Must have at least one command-line arg: the python script
193  if [ $# -eq 0 ]; then  if [ $# -eq 0 ]; then
194    echo "No python script specified. Starting python interpreter."    if [ ! -z $DOBINARY ]
195      then
196        echo "No program to run was specified. Exiting."
197        exit 1
198      else
199        echo "No python script specified. Starting python interpreter."
200      fi
201  fi  fi
202    
203  #Ensure the variables have sensible values  #Ensure the variables have sensible values

Legend:
Removed from v.2342  
changed lines
  Added in v.2343

  ViewVC Help
Powered by ViewVC 1.1.26