summaryrefslogtreecommitdiff
path: root/contrib/get-cryptominisat4
blob: c96bbe03d046c2b935d3358ac68a3931d9e8cae5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/bin/bash
#
set -e

version="4.2.0"

cd "$(dirname "$0")/.."

if ! [ -e src/parser/cvc/Cvc.g ]; then
  echo "$(basename $0): I expect to be in the contrib/ of a CVC4 source tree," >&2
  echo "but apparently:" >&2
  echo >&2
  echo "  $(pwd)" >&2
  echo >&2
  echo "is not a CVC4 source tree ?!" >&2
  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
}

if [ -e cryptominisat4 ]; then
  echo 'error: file or directory "cryptominisat4" exists; please move it out of the way.' >&2
  exit 1
fi

mkdir cryptominisat4
cd cryptominisat4
CRYPTOMINISAT_PATH=`pwd`

webget https://github.com/msoos/cryptominisat/archive/$version.tar.gz cryptominisat-$version.tar.gz
gunzip -f cryptominisat-$version.tar.gz
tar xfv cryptominisat-$version.tar
cd cryptominisat-$version

patch -p0 < ../../contrib/cryptominisat-4.2.0.patch
patch -p0 < ../../contrib/cryptominisat-4.2.0.second.patch 

mkdir ../build
cd ../build

cmake -DCMAKE_INSTALL_PREFIX:PATH=$CRYPTOMINISAT_PATH/install -DSTATICCOMPILE="ON" -DNOM4RI="ON"  ../cryptominisat-$version
make install -j2

cd ../

echo
echo ===================== Now configure CVC4 with =====================
echo ./configure --with-cryptominisat --with-cryptominisat-dir=`pwd`
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback