aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoreschnett <eschnett@4f5cb9a8-4dd8-4c2d-9bbd-173fa4467843>2011-12-12 20:12:15 +0000
committereschnett <eschnett@4f5cb9a8-4dd8-4c2d-9bbd-173fa4467843>2011-12-12 20:12:15 +0000
commit197d563bcfce4b13b85d9ff9e2c7020862205041 (patch)
tree4a0ed0c9cc9dd2175ae13e41e315d2f062018283
parentc317e4282ee974b225d852cda15af274d1eb6bf9 (diff)
Call Mathematica via Kranc/Bin/kranc
git-svn-id: http://svn.einsteintoolkit.org/cactus/EinsteinAnalysis/WeylScal4/trunk@89 4f5cb9a8-4dd8-4c2d-9bbd-173fa4467843
-rw-r--r--m/Makefile8
-rw-r--r--m/WeylScal4.m8
-rwxr-xr-xm/runmath.sh61
3 files changed, 5 insertions, 72 deletions
diff --git a/m/Makefile b/m/Makefile
index 4d19481..931a7b4 100644
--- a/m/Makefile
+++ b/m/Makefile
@@ -9,12 +9,8 @@ WeylScal4.out: WeylScal4.m
rm -rf WeylScal4
./runmath.sh $^
grep --silent 'Thorn ./WeylScal4 created successfully' WeylScal4.out
- for thorn in WeylScal4; do \
- ./copy-if-changed.sh $$thorn/configuration.ccl ../../$$thorn/configuration.ccl && \
- ./copy-if-changed.sh $$thorn/interface.ccl ../../$$thorn/interface.ccl && \
- ./copy-if-changed.sh $$thorn/param.ccl ../../$$thorn/param.ccl && \
- ./copy-if-changed.sh $$thorn/schedule.ccl ../../$$thorn/schedule.ccl && \
- ./copy-if-changed.sh $$thorn/src ../../$$thorn/src; \
+ for file in $$(ls WeylScal4); do \
+ ./copy-if-changed.sh WeylScal4/$$file ../$$file; \
done
clean:
diff --git a/m/WeylScal4.m b/m/WeylScal4.m
index f6f6bbb..ba54b6d 100644
--- a/m/WeylScal4.m
+++ b/m/WeylScal4.m
@@ -1,11 +1,3 @@
-$Path = Join[$Path, Map[ToString, ReadList[StringToStream[Environment["MATHPATH"]], Word, WordSeparators->{":"}]]];
-
-$RecursionLimit = 1000;
-
-Get["KrancThorn`"];
-
-(*SetDebugLevel[InfoFull];*)
-
SetEnhancedTimes[False];
SetSourceLanguage["C"];
diff --git a/m/runmath.sh b/m/runmath.sh
index ab94b62..3c7615b 100755
--- a/m/runmath.sh
+++ b/m/runmath.sh
@@ -2,10 +2,6 @@
# Abort on errors
set -e
-# null-expand non-matching globs
-set -u
-
-MATHEMATICA="math"
script=$1
@@ -15,64 +11,13 @@ if test -z "$script"; then
exit 2
fi
-KRANCPATH="${KRANCPATH:+$KRANCPATH}"
-if [ -z "$KRANCPATH" ] ; then
- KRANCPATHS=(. ../../../../arrangements/../repos ../../../arrangements/../repos $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
-
-echo "MATHPATH = $MATHPATH"
-
error=$(basename $script .m).err
output=$(basename $script .m).out
rm -f $output
-# Run Mathematica to regenerate the code
-< $script "$MATHEMATICA" | tee $error
-
-if grep 'KrancError' $error; then
- echo
- echo "There was an error when running Kranc on $script."
- echo "The file $error contains details."
- echo
- echo "*** The Cactus thorns have NOT been updated. ***"
- echo
- exit 1
-fi
+# Run Kranc to regenerate the code
+../../../../repos/Kranc/Bin/kranc $script | tee $error
+[ $PIPESTATUS -eq 0 ] || exit $PIPESTATUS
mv $error $output