#!/bin/sh usage() { echo "usage: $0 [-symlinks ]" echo echo " Configure Xplor-NIH executable and scripts." echo echo " If the optional -symlinks option is given. Symlinks to" echo " the xplor executable and script will be placed in the given" echo " path." echo } while [ -n "$1" ]; do opt=$1 shift case "$opt" in -help|-h|--help) usage exit 0 ;; -symlinks) symlinkPath=$1 shift ;; *) echo "invalid option: $opt" usage exit 1 ;; esac done pwd=`pwd` scriptFiles="xplor testDist seq2psf pdb2psf pyXplor tclXplor xplor_mpi\ targetRMSD torsionReport\ calcTensor calcDaRh calcETensor\ domainDecompose mleFit calcSAXS" for binFile in $scriptFiles; do sed "s%__XPLOR_DIR__%$pwd%g" bin/$binFile chmod 755 bin/$binFile done #get the value of ARCH str=`./bin/xplor -sh-env` if [ $? -eq 0 ]; then eval $str else echo $str echo "configure failed" exit 1 fi #pre-compile python files if [ -d python ]; then echo "import compileall; compileall.compile_dir('python')" |\ env PYTHONOPTIMIZE=1 bin/xplor -py >/dev/null echo "import compileall; compileall.compile_dir('bin.$ARCH')" |\ env PYTHONOPTIMIZE=1 bin/xplor -py >/dev/null fi [ "$symlinkPath" = "" ] && exit 0 mkdirhier=$pwd/bin/mkdirhier [ -d $symlinkPath ] || $mkdirhier $symlinkPath for script in getBest findXcookie $scriptFiles; do rm -f $symlinkPath/$script ln -s $pwd/bin/$script $symlinkPath done