-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathbuild_potassco.sh
More file actions
executable file
·64 lines (57 loc) · 1.87 KB
/
build_potassco.sh
File metadata and controls
executable file
·64 lines (57 loc) · 1.87 KB
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
58
59
60
61
62
63
if test -e clasp; then
if test -d clasp; then
echo "clasp directory exists, assuming we have a configured clasp"
echo "(remove the directory and restart make if this not the case)"
else
echo "clasp exists but is no directory!";
exit -1;
fi
else
echo "unpacking clasp"
tar xzf ${TOP_SRCDIR}/clasp-3.1.4-source.tar.gz
mv clasp-3.1.4 clasp
echo "configuring clasp"
mkdir -p clasp/build/fpic
pushd clasp/build
ln -s fpic release
popd
(
cd clasp
./configure.sh --config=fpic CXX="$CXX -DNDEBUG -O3" CXXFLAGS=-fPIC ||
{ echo "configuring clasp failed!"; exit -1; }
)
fi
if test -e gringo; then
if test -d gringo; then
echo "gringo directory exists, assuming we have a configured gringo"
echo "(remove the directory and restart make if this not the case)"
else
echo "gringo exists but is no directory!";
exit -1;
fi
else
echo "unpacking gringo"
tar xzf ${TOP_SRCDIR}/gringo-4.5.4-source.tar.gz
mv gringo-4.5.4-source gringo
patch gringo/SConstruct <$TOP_SRCDIR/buildclaspgringo/SConstruct.patch ||
{ echo "gringo patching failed!"; exit -1; }
patch gringo/SConstruct <$TOP_SRCDIR/buildclaspgringo/SConstruct-lua.patch ||
{ echo "gringo patching failed!"; exit -1; }
patch gringo/SConstruct <$TOP_SRCDIR/buildclaspgringo/SConstruct-python.patch ||
{ echo "gringo patching failed!"; exit -1; }
patch gringo/app/gringo/main.cc <$TOP_SRCDIR/buildclaspgringo/main.cc.patch ||
{ echo "gringo patching failed!"; exit -1; }
patch gringo/libgringo/src/term.cc <$TOP_SRCDIR/buildclaspgringo/gringo-patch-include-math.patch ||
{ echo "gringo patching failed!"; exit -1; }
mkdir -p gringo/build/release
fi
echo "making clasp"
make -C clasp/build/release VERBOSE=1 ||
{ echo "building clasp failed!"; exit -1; }
echo "making gringo"
(
cd gringo
CXX=$CXX \
BOOST_ROOT=$BOOST_ROOT scons --build-dir=release gringo ||
{ echo "gringo cmake failed!"; exit -1; }
)