-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathbuild.sh
More file actions
59 lines (40 loc) · 1.51 KB
/
build.sh
File metadata and controls
59 lines (40 loc) · 1.51 KB
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
#!/bin/bash
cd alphartc
echo "=> Building AlphaRTC"
output=$(gn --version 2>&1)
if [[ $output =~ ^[0-9]{3,} ]]; then
echo "=> Checking gn... It is correctly configured: $output"
else
echo "=> Checking gn... Required to configure gn, please wait..."
gclient sync && mv src/* .
fi
output_dir="out/Default"
target_dir="target"
target_lib_dir="${target_dir}/lib"
target_bin_dir="${target_dir}/bin"
target_pylib_dir="${target_dir}/pylib"
if [ -d "${output_dir}" ]; then
echo "=> Directory ${output_dir} exists. Deleting..."
rm -rf "${output_dir}"
fi
if [ -d "${target_dir}" ]; then
echo "=> Directory ${target_dir} exists. Deleting..."
rm -rf "${target_dir}"
fi
echo "=> Building peerconnection_serverless using ninja..."
gn gen "${output_dir}"
ninja -C "${output_dir}" peerconnection_serverless
echo "=> Creating target directories..."
mkdir -p "${target_lib_dir}"
mkdir -p "${target_bin_dir}"
mkdir -p "${target_pylib_dir}"
echo "=> Copying files and shared libraries..."
# cp -r ../share/input/* "${target_bin_dir}"
cp modules/third_party/onnxinfer/lib/*.so "${target_lib_dir}"
cp modules/third_party/onnxinfer/lib/*.so.* "${target_lib_dir}"
echo "=> Copying executables and Python scripts..."
cp "${output_dir}/peerconnection_serverless" "${target_bin_dir}/peerconnection_serverless.origin"
cp examples/peerconnection/serverless/peerconnection_serverless "${target_bin_dir}"
cp modules/third_party/cmdinfer/*.py "${target_pylib_dir}/"
echo "=> AlphaRTC build completed."
cd .. # get back to the root