Also add a "mac-build" script that sets up prerequisites for Mac.
configure-in-place \
depgraph \
get-antlr-3.4 \
+ mac-build \
run-script-smtcomp2012 \
theoryskel/kinds \
theoryskel/Makefile \
exit 1
fi
+function webget {
+ if which wget &>/dev/null; then
+ wget -c -O "$2" "$1"
+ elif which curl &>/dev/null; then
+ curl "$1" >"$2"
+ else
+ echo "Can't figure out how to download from web. Please install wget or curl." >&2
+ exit 1
+ fi
+}
+
set -x
mkdir -p antlr-3.4/share/java
mkdir -p antlr-3.4/bin
mkdir -p antlr-3.4/src
cd antlr-3.4
-wget -c -O share/java/antlr-3.4-complete.jar http://antlr.org/download/antlr-3.4-complete.jar
-wget -c -O src/libantlr3c-3.4.tar.gz http://antlr.org/download/C/libantlr3c-3.4.tar.gz
+webget http://antlr.org/download/antlr-3.4-complete.jar share/java/antlr-3.4-complete.jar
+webget http://antlr.org/download/C/libantlr3c-3.4.tar.gz src/libantlr3c-3.4.tar.gz
tee bin/antlr3 <<EOF
#!/bin/sh
export CLASSPATH=/usr/share/java/stringtemplate.jar:`pwd`/share/java/antlr-3.4-complete.jar:\$CLASSPATH
cd libantlr3c-3.4
./configure --enable-64bit --prefix=`pwd`/../..
cp Makefile Makefile.orig
-sed 's,^CFLAGS = .*,\0 -fexceptions,' Makefile.orig > Makefile
+sed 's,^\(CFLAGS = .*\),\1 -fexceptions,' Makefile.orig > Makefile
make
make install
set +x
function webget {
if which wget &>/dev/null; then
- tmpfile="$(mktemp)"
+ tmpfile="$(mktemp get_bug_attach.$$.XXXXXXXX)"
filename="$(wget -qS -O "$tmpfile" "$1" 2>&1 | grep 'Content-disposition: attachment' | sed 's,.*filename="\(.*\)".*,\1,')"
ext="$(echo "$filename" | sed 's,.*\.\(.*\),\1,')"
if [ -e "$2.$ext" ] && ! diff -q "$tmpfile" "$2.$ext" &>/dev/null; then
echo "$2.$ext"
fi
elif which curl &>/dev/null; then
- mkdir -p "$(dirname "$2")"
- curl "$1" >"$2"
+ tmpfile="$(mktemp get_bug_attach.$$.XXXXXXXX)"
+ filename="$(curl --head "$1" 2>&1 | grep 'Content-disposition: attachment' | sed 's,.*filename="\(.*\)".*,\1,')"
+ curl "$1" >"$tmpfile" 2>/dev/null
+ ext="$(echo "$filename" | sed 's,.*\.\(.*\),\1,')"
+ if [ -e "$2.$ext" ] && ! diff -q "$tmpfile" "$2.$ext" &>/dev/null; then
+ c=a
+ while [ -e "$2$c.$ext" ] && ! diff -q "$tmpfile" "$2$c.$ext" &>/dev/null; do
+ c=$(echo $c | tr a-y b-z)
+ done
+ mkdir -p "$(dirname "$2")"
+ mv "$tmpfile" "$2$c.$ext"
+ echo "$2$c.$ext"
+ else
+ mkdir -p "$(dirname "$2")"
+ mv "$tmpfile" "$2.$ext"
+ echo "$2.$ext"
+ fi
else
echo "Please install wget or curl." >&2;
exit 1
| sort -nu); do
let count++
- echo -n "Downloading attachment $attachment..."
+ printf "%-30s " "Downloading attachment $attachment..."
webget "http://church.cims.nyu.edu/bugs/attachment.cgi?id=$attachment" "test/regress/regress0/bug$bugid"
done
if [ $count -eq 0 ]; then
- echo "There are no bug testcase attachments for bug #$bugid."
+ echo "There are no bug attachments for bug #$bugid."
else
- echo "Downloaded $count bug testcases for bug #$bugid."
+ s=s
+ [ $count -eq 1 ] && s=
+ echo "Downloaded $count bug attachment$s for bug #$bugid."
fi
done
--- /dev/null
+#!/bin/bash
+#
+# mac-build script
+# Morgan Deters <mdeters@cs.nyu.edu>
+# Tue, 25 Sep 2012 15:44:27 -0400
+#
+
+macports_prereq="boost gmp gtime readline"
+
+export PATH="/opt/local/bin:$PATH"
+
+if [ $# -ne 0 ]; then
+ echo "usage: `basename $0`" >&2
+ echo >&2
+ echo "This script attempts to set up the build requirements for CVC4 for Mac OS X." >&2
+ echo "MacPorts must be installed (but this script installs prerequisite port" >&2
+ echo "packages for CVC4). If this script is successful, it prints a configure" >&2
+ echo "line that you can use to configure CVC4." >&2
+fi
+
+function reporterror {
+ echo
+ echo =============================================================================
+ echo
+ echo "There was an error setting up the prerequisites. Look above for details."
+ echo
+ exit 1
+}
+
+echo =============================================================================
+echo
+echo "running: sudo port install $macports_prereq"
+if which port &>/dev/null; then
+ echo "You may be asked for your password to install these packages."
+ echo
+ sudo port install $macports_prereq || reporterror
+else
+ echo
+ echo "ERROR: You must have MacPorts installed for Mac builds of CVC4."
+ echo "ERROR: See http://www.macports.org/"
+ reporterror
+fi
+echo
+echo =============================================================================
+echo
+contrib/get-antlr-3.4 | grep -v 'Now configure CVC4 with' | grep -v '\./configure --with-antlr-dir='
+[ ${PIPESTATUS[0]} -eq 0 ] || reporterror
+echo
+echo =============================================================================
+echo
+echo 'Now just run:'
+echo ' ./configure LDFLAGS=-L/opt/local/lib CPPFLAGS=-I/opt/local/include --with-antlr-dir=`pwd`/antlr-3.4 ANTLR=`pwd`/antlr-3.4/bin/antlr3'
+echo ' make'
+echo
+echo =============================================================================
env->FindClass("java/lang/Object"),
NULL);
- for (int i = 0; i < v.size(); ++i) {
+ for (size_t i = 0; i < v.size(); ++i) {
env->SetObjectArrayElement(jarray, i, embed_copy<T>(env, v[i]));
}
env->FindClass("java/lang/Object"),
NULL);
- for (int i = 0; i < v.size(); ++i) {
+ for (size_t i = 0; i < v.size(); ++i) {
env->SetObjectArrayElement(jarray, i, embed_const_ref<T>(env, &v[i]));
}
{
jobjectArray jarray = (jobjectArray) env->NewObjectArray(v.size(),
env->FindClass("[Ljava/lang/Object;"), NULL);
- for (int i = 0; i < v.size(); ++i)
+ for (size_t i = 0; i < v.size(); ++i)
{
env->SetObjectArrayElement(jarray, i, toJavaVConstRef(env, v[i]));
}
}
DebugAssert(false, "JniUtils::toJava(QueryResult): unreachable");
+ return toJava(env, ""); // to avoid compiler warning
}
jstring toJava(JNIEnv* env, CVC3::FormulaValue result) {
DEFINITION: Java_cvc3_ValidityChecker_jniGetStatistics
jobject m ValidityChecker vc
-return embed_mut_ref(env, &vc->getStatistics());
+return embed_copy(env, vc->getStatistics());
DEFINITION: Java_cvc3_ValidityChecker_jniPrintStatistics
void m ValidityChecker vc
friend class StatisticsBase;
public:
+ iterator() : d_it() { }
+ iterator(const iterator& it) : d_it(it.d_it) { }
value_type operator*() const;
iterator& operator++() { ++d_it; return *this; }
iterator operator++(int) { iterator old = *this; ++d_it; return old; }