Skip to content

Instantly share code, notes, and snippets.

@dmcyk
Last active April 27, 2017 18:58
Show Gist options
  • Save dmcyk/13d6888970c1cb0c470ca6f3107a8740 to your computer and use it in GitHub Desktop.
Save dmcyk/13d6888970c1cb0c470ca6f3107a8740 to your computer and use it in GitHub Desktop.
MSIwG_setup
#!/bin/bash
errLogPath=".err.log"
exec 3>&1
exec > /dev/null 2> $errLogPath
echo "" > $errLogPath
function echoStd {
while (( "$#" )); do
echo $1 >&3
shift
done
}
function close {
exec 3>&-
}
function checkExit {
if [[ $? != 0 ]]; then
echoStd "installation error"
exit $?;
fi
}
wget -O - http://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
checkExit
export DEBIAN_FRONTEND=noninteractive
echoStd "Installing dependencies, this might take a while..."
sudo apt-get update
sudo apt-get -y install vim git
runDir=$PWD
echoStd "Instaliing at $runDir"
git clone https://github.com/BP6-14-15/MSIwG MSIwG
checkExit
cd MSIwG/engine
./clangSetup.sh $runDir >&3
checkExit
cd example
echo "CXX=clang++-4.0 cmake ./ -DLIBCXXPATH=$runDir" > buildScript.sh
echo "make" >> buildScript.sh
chmod +x buildScript.sh
cp buildScript.sh ../source/
cd ..
echoStd "Installing engine dependencies..."
./engineDependencies.sh
echoStd "Generating conf files..."
cd source
echo "#!/bin/bash" > run.sh
echo "export LD_LIBRARY_PATH=\"$runDir/LLVM/build/lib\"
./GameEngine
#./GameEngine --fpLibPath=../example/libclientA.so --fpFcnName=updatePlayer
" >> run.sh
chmod +x run.sh
echoStd "Done"
close
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment