-
Notifications
You must be signed in to change notification settings - Fork 0
/
linux_build.sh
58 lines (50 loc) · 1.56 KB
/
linux_build.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
57
58
# # 1. build paddle-lite linux x86
cd Paddle-Lite
bash ./lite/tools/build_linux.sh --arch=x86 --with_extra=ON
cd ..
# # 2. copy .h and .so
cp -r ./Paddle-Lite/build.lite.linux.x86.gcc/inference_lite_lib/cxx/ .
cp -r ./Paddle-Lite/build.lite.linux.x86.gcc/inference_lite_lib/third_party/mklml/ .
# 3. make this project
#!/bin/bash
set -e
set -x
WITH_METAL=OFF
function print_usage() {
echo "---------------------------------------------------------------------------------------------------------------------------------------- "
echo -e "| usage: |"
echo "---------------------------------------------------------------------------------------------------------------------------------------- "
echo -e "| ./build.sh help |"
echo "---------------------------------------------------------------------------------------------------------------------------------------- "
}
# parse command
function init() {
for i in "$@"; do
case $i in
--with_metal=*)
WITH_METAL="${i#*=}"
shift
;;
help)
print_usage
exit 0
;;
*)
# unknown option
print_usage
exit 1
;;
esac
done
}
init $@
rm -rf ./build
mkdir ./build
cd ./build
if [ "${WITH_METAL}" == "ON" ]; then
cmake .. -DMETAL=ON
else
cmake ..
fi
make
cd ..