Page MenuHomec4science

compile_revision.sh
No OneTemporary

File Metadata

Created
Sun, May 5, 21:38

compile_revision.sh

#!/usr/bin/bash
set -euo pipefail
akantu_src=$1
test_src=$2
revision=$3
usage() {
echo "$1 <akantu_src> <test_src> <revision>"
}
if [ ! -e ${akantu_src} -o -z ${akantu_src} ]; then
usage()
exit 1
fi
if [ ! -e ${test_src} -o -z ${test_src} ]; then
usage()
exit 2
fi
wd=${PWD}
prefix=$(mktemp --directory akantu.XXXXXXX --tmpdir)
git clone ${akantu_src} -b ${revision} --depth 1 ${prefix}/akantu
revision_date=$(git log -1 --format='%ct')
cd ${prefix}/akantu
mkdir build
cd build
echo "*** Configuring revision r${revision} ***"
cmake -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_CXX_COMPILE_FLAGS:STRING='-march=native' -DAKANTU_DEBUG:BOOL=OFF ${akantu_src} > ${wd}/configure-akantu-${revision}.log 2>&1
if [ ! $? -eq 0 ]; then
exit 100
fi
echo "*** Building revision r${revision} ***"
make > ${wd}/make-akantu-${revision} 2>&1
if [ ! $? -eq 0 ]; then
exit 200
fi
mkdir ${prefix}/build
cd ${prefix}/build
# 1413714847 epoch of tag v2.2
if [ $revision -lt 1413714847 ]; then
echo "MAJOR 1"
VERSION=1
else
echo "MAJOR 2"
VERSION=2
fi
echo "*** Configuring test for r${revision} ***"
cmake -DAKANTU_VERSION_MAJOR:STRING=$VERSION -DAkantu_DIR:PATH=${prefix}/akantu/build ${test_src} > ${wd}/configure-test-${revision} 2>&1
if [ ! $? -eq 0 ]; then
exit 300
fi
echo "*** Building test for r${revision} ***"
make > ${wd}/make-test-${revision} 2>&1
if [ ! $? -eq 0 ]; then
exit 400
fi

Event Timeline