forked from LiXizhi/NPLRuntime
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build_linux.sh
executable file
·56 lines (48 loc) · 1.57 KB
/
build_linux.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
56
#!/bin/bash
# author: [email protected]
# date: 2016.2.26
# desc: to install dependencies, please see `.travis.yml`
# For boost: Download boost 1.55 or above and build with `./b2 link=static`
# run cmake in ./NPLRuntime folder and make
pushd .
mkdir -p ./bin/linux
cd bin/linux/
# to build in parallel with 3 threads, use make -j3 or `./build_linux.sh 3`
if [ $# -gt 0 ]; then
JOBS="${1:-1}"
fi
echo "parallel build with ${JOBS:-1} jobs, you can set JOBS=6 or ./build_linux.sh 6"
cmake -DCMAKE_BUILD_TYPE=${2:-Release} ../../NPLRuntime/ && make --jobs=${JOBS:-1}
result=$?
popd
if [ $result == 0 ]; then
echo "build success! Output file is at ./ParaWorld/bin64/"
pushd ParaWorld/bin64/
ls -l
npl_exe_path=/usr/local/bin/npl
nplc_exe_path=/usr/local/bin/nplc
echo "install executable to $npl_exe_path"
if [ -f ./ParaEngineServer ]; then
if [ ! -e $npl_exe_path ] && [ ! -L $npl_exe_path ]; then
ln -s $(pwd)/ParaEngineServer $npl_exe_path
else
echo "NPL runtime already exist at $npl_exe_path"
fi
ls -l $npl_exe_path
fi
if [ ! -f ./nplc.sh ]; then
cp -f ../../npl_packages/main/script/ide/System/nplcmd/nplc.sh nplc.sh
chmod +x nplc.sh
ln -s $(pwd)/nplc.sh $nplc_exe_path
fi
ls -l $nplc_exe_path
if [ -f ./libluajit21.so ]; then
echo "Force using LJ_GC64 in 64bits system"
cp liblua.so libluajit20.so
cp -f libluajit21.so liblua.so
fi
popd
# run all NPL tests
echo "you can test npl runtime by typing: npl NPLRuntime/tests/helloworld.lua"
fi
exit $result