-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbuild.sh
67 lines (56 loc) · 1.22 KB
/
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
59
60
61
62
63
64
65
66
67
#!/bin/bash
# The build file is build on the mac , if you want to build on the linux,
# it's better to change the build result dylib to .so
# build gflags
function build_gflags()
{
local source_dir
local build_dir
cd third-party/gflags
if [ -e "gflags" ] && [ -e "gflags/build" ];then
echo "gflags has been builded."
return
fi
source_dir=$(pwd)
build_dir=$source_dir/c_build
mkdir -p "$build_dir"/ \
&& cd "$build_dir" \
&& cmake .. -DCMAKE_INSTALL_PREFIX="$build_dir" -DBUILD_SHARED_LIBS=1 -DBUILD_STATIC_LIBS=1 \
&& make \
&& make install \
&& cd ../../../
}
# build tbb
function build_tbb()
{
local source_dir
local build_dir
cd third-party/oneTBB
if [ -e "oneTBB" ] && [ -e "gflags/build" ];then
echo "gflags has been builded."
return
fi
source_dir=$(pwd)
build_dir=$source_dir/build
mkdir -p "$build_dir"/ \
&& cd "$build_dir" \
&& cmake .. -DCMAKE_BUILD_TYPE=Release \
&& make -j5 \
&& cd ../../../
}
# build threadpool
function build_threadpool()
{
cd third-party/threadpool
make clean
make all
cd ../../
}
current_path=$(pwd)
build_gflags
cd $current_path
build_tbb
cd $current_path
build_threadpool
cd $current_path
make cache_bench