#!/bin/sh
CURRENT_DIR=$PWD

sudo zypper in tbb-devel cmake llvm-devel llvm-clang-devel git bison re2c scons unzip gcc-c++ libgtest0 googletest-devel boost-devel libxml2-devel

#       COCO
mkdir /opt/coco-cpp/
cd /opt/coco-cpp/
if [ ! -f ./CocoSourcesCPP.zip ]; then
    wget http://www.ssw.uni-linz.ac.at/Coco/CPP/CocoSourcesCPP.zip
    unzip ./CocoSourcesCPP.zip
fi

g++ *.cpp -o Coco -g -Wall

#       POTASSCO
mkdir /opt/potassco/
cd /opt/potassco/
git clone https://github.com/potassco/clingo.git
cd clingo
sed -i "s/CXXFLAGS = \[\(.*\)\]/CXXFLAGS = \['-fPIC', \1\]/" build/debug.py
scons --build-dir=debug

sed -i "s/CXXFLAGS = \[\(.*\)\]/CXXFLAGS = \['-fPIC', \1\]/" build/release.py
scons --build-dir=release


cd $CURRENT_DIR
mkdir ./build/xreate-tests-debug
cd ./build/xreate-tests-debug
cmake -DBUILD_XREATE_TESTS=1 -build ../../cpp

make -j2






