-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathhpxlua.sh
55 lines (51 loc) · 1.5 KB
/
hpxlua.sh
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
function prepare_hpxlua()
{
if [ ! -d $BASE_PATH/source/hpx_script ]
then
mkdir -p $BASE_PATH/source
cd $BASE_PATH/source
git clone --depth=1 https://github.com/STEllAR-GROUP/hpx_script.git
fi
cd $BASE_PATH/source/hpx_script
git stash &> /dev/null
git pull --rebase &> /dev/null
git stash pop &> /dev/null
cd $BASE_PATH
}
function hpxlua_cmake()
{
mkdir -p $BASE_PATH/packages/$PREFIX/hpxlua/$BUILD_TYPE
cd $BASE_PATH/packages/$PREFIX/hpxlua/$BUILD_TYPE
TMP_LOG=$BASE_PATH/packages/$PREFIX/hpxlua/$BUILD_TYPE/$$.log
HPX_BASE=$BASE_PATH/packages/$PREFIX/hpx/$BUILD_TYPE
if [ ! -f cmake_done ]
then
echo -n "Configuring HPX LUA ($BUILD_TYPE)..."
$HPX_BASE/bin/hpxcmake $BASE_PATH/source/hpx_script/lua \
-DHPX_DIR=$HPX_BASE/lib/cmake/HPX \
-DLUA_DIR=$BASE_PATH/packages/$PREFIX/lua &> $TMP_LOG
if [ $? != 0 ]
then
echo "failed"
tail -n 100 $TMP_LOG
exit 1
else
touch cmake_done
echo "done"
fi
fi
echo -n "Building HPX LUA ($BUILD_TYPE)..."
make -j8 &> $TMP_LOG
if [ $? != 0 ]
then
echo "failed"
tail -n 100 $TMP_LOG
exit 1
else
echo "done"
fi
ln -sf $BASE_PATH/packages/$PREFIX/hpxlua/$BUILD_TYPE/xlua \
$HPX_BASE/bin/xlua &> /dev/null
ln -sf $BASE_PATH/packages/$PREFIX/hpxlua/$BUILD_TYPE/hello \
$HPX_BASE/bin/xlua_hello &> /dev/null
}