aboutsummaryrefslogtreecommitdiff
path: root/m/runmath.sh
diff options
context:
space:
mode:
authortbode <tbode@4f5cb9a8-4dd8-4c2d-9bbd-173fa4467843>2010-05-07 00:59:10 +0000
committertbode <tbode@4f5cb9a8-4dd8-4c2d-9bbd-173fa4467843>2010-05-07 00:59:10 +0000
commitb3aafc21d0044b4d68ee7a6c088c472799ed9503 (patch)
tree3da4d04b0e3acc44f6b8e5feaf34c62095c05eea /m/runmath.sh
parentf33a18fee7267ff212baec75795ecb13670643e8 (diff)
WeylScal4:
Remove variable modifications in Kranc script. Fix tensor parity tags. Add old-style BC compatibility. Add intelligence to runmath.sh in finding Kranc. Change bash script permissions. Add testsuites. Expand README description. git-svn-id: http://svn.einsteintoolkit.org/cactus/EinsteinAnalysis/WeylScal4/trunk@52 4f5cb9a8-4dd8-4c2d-9bbd-173fa4467843
Diffstat (limited to 'm/runmath.sh')
-rwxr-xr-x[-rw-r--r--]m/runmath.sh42
1 files changed, 42 insertions, 0 deletions
diff --git a/m/runmath.sh b/m/runmath.sh
index 306b2e1..b9a7bbf 100644..100755
--- a/m/runmath.sh
+++ b/m/runmath.sh
@@ -2,6 +2,8 @@
# Abort on errors
set -e
+# null-expand non-matching globs
+set -u
MATHEMATICA="math"
@@ -13,6 +15,46 @@ if test -z "$script"; then
exit 2
fi
+KRANCPATH="${KRANCPATH:+$KRANCPATH}"
+if [ -z "$KRANCPATH" ] ; then
+ KRANCPATHS=(. ../../../../arrangements/.. ../../../arrangements/.. $HOME)
+ # look for Kranc in a number of likely locations
+ # choice 2 and 3 are $CCTK_HOME if the thorn resides in arrangements or
+ # git-repos
+ for i in ${KRANCPATHS[@]} ; do
+ if [ -d $i/kranc/Tools ] ; then
+ KRANCPATH=$i/kranc
+ break
+ elif [ -d $i/Kranc/Tools ] ; then
+ KRANCPATH=$i/Kranc
+ break
+ fi
+ done
+fi
+if [ -z "$KRANCPATH" ] ; then # try some more clever things...
+ KRANCBIN="$(which kranc || true)"
+ if [ -h "$KRANCBIN" ] ; then
+ KRANCBIN=$(readlink "$KRANCBIN")
+ fi
+ if [ -d "$(dirname "$KRANCBIN")/../Tools" ] ; then
+ KRANCPATH="$(dirname "$KRANCBIN")/.."
+ fi
+fi
+if [ -n "$KRANCPATH" ] ; then
+ LOCALKRANCPATH="$KRANCPATH/Tools/CodeGen:$KRANCPATH/Tools/MathematicaMisc"
+
+ if [ -z "${MATHPATH:+}" ]
+ then
+ MATHPATH=$LOCALKRANCPATH
+ else
+ MATHPATH=$LOCALKRANCPATH:$MATHPATH
+ fi
+
+ export MATHPATH
+else
+ echo -e "Could not find Kranc. Expect trouble unless you have made sure Mathematica\nwill find Kranc. You might also consider setting \$KRANCPATH."
+fi
+
error=$(basename $script .m).err
output=$(basename $script .m).out