#/bin/bash

#JVM to execute the compilation process with
JVM=~/bin/ibm-java2-x86_64-50/bin/java

#JRE with which the benchmarks are linked
JRELIB=~/bin/sun-jdk1.4.2_12/jre/lib

ABC=../abc-complete.jar
DEPS=./dacapo/benchmarks/apps/$1-deps.jar:./dacapo/benchmarks/apps/batik.jar
ABC_RT=../abc-runtime.jar
RT=${JRELIB}/rt.jar:${JRELIB}/jsse.jar:${JRELIB}/jce.jar

#=====

#STARTTIME=`date +%Y%m%d`

DIR=../compiled-noopt

mkdir -p ${DIR}

echo Compiling $1/$2 with out optimizations.
echo Generating output in ${DIR}/$1-$2-noopt.{jar,log}

${JVM} -Xmx1024m -Xss2048k -cp ${ABC} \
abc.main.Main -debug abcTimer -ext abc.tm \
  -cp ${ABC_RT}:${RT}:${DEPS} \
  -injars ./dacapo/benchmarks/apps/$1.jar \
  -outjar ${DIR}/$1-$2-noopt.jar \
-debug dontCheckExceptions \
-debug doValidate \
../tracematches/$2.java \
>${DIR}/$1-$2-noopt.log 2>&1
