Skip to content
This repository was archived by the owner on Jul 22, 2025. It is now read-only.

Commit 1579537

Browse files
zhang-shizhaoU1X6WK
authored andcommitted
Build script modificatioin (#44)
- modified zlib version to 1.2.13 in ./prebuild.sh because 1.2.12 is N/A - able to specify hardware platform when use build.sh - changed ENABLE_MSDK to ENABLE_SG1 in CMakeList - added option ENABLE_ATSM in CMakeList
1 parent 09e2f43 commit 1579537

File tree

3 files changed

+40
-8
lines changed

3 files changed

+40
-8
lines changed

src/CMakeLists.txt

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,11 @@ OPTION(USE_TRACE
77
"Use trace"
88
OFF)
99

10-
OPTION(ENABLE_MSDK
11-
"Enable MSDK"
10+
OPTION(ENABLE_SG1
11+
"Enable SG1"
12+
OFF)
13+
OPTION(ENABLE_ATSM
14+
"Enable ATSM"
1215
OFF)
1316

1417
OPTION(USE_SAFE_MEM_LIB
@@ -19,9 +22,12 @@ IF(USE_TRACE)
1922
ADD_DEFINITIONS("-D_USE_TRACE_")
2023
ENDIF()
2124

22-
IF(ENABLE_MSDK)
25+
IF(ENABLE_SG1)
2326
ADD_DEFINITIONS("-D_ENABLE_MSDK_")
2427
ENDIF()
28+
IF(ENABLE_ATSM)
29+
ADD_DEFINITIONS("-D_ENABLE_VPL_")
30+
ENDIF()
2531

2632
IF(USE_SAFE_MEM_LIB)
2733
SET(USE_SAFE_MEM true)

src/external/build.sh

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@
22

33
TARGET=$1
44
PREBUILD_FLAG=$2
5+
HARDWARE=$3
56
EX_PATH=${PWD}
67
SRC_PATH=${PWD}/..
78

89
parameters_usage(){
910
echo 'Usage: 1. <target>: [ server, client, test ]'
1011
echo ' 2. <prebuild_flag>: [ y, n ]'
12+
echo ' 3. <hardware>: [ SG1, ATSM ]'
1113
}
1214

1315
build_server(){
@@ -22,7 +24,13 @@ build_server(){
2224
thrift -r --gen cpp shared.thrift
2325
patch gen-cpp/shared_types.h Implement_operator_RegionInformation.patch
2426
cd -
25-
cmake -DCMAKE_BUILD_TYPE=Release -DTARGET=server -DDE_FLAG=true -DUSE_SAFE_MEM_LIB=OFF -DENABLE_MSDK=OFF ../..
27+
if [ -z "${HARDWARE}" ]; then
28+
cmake -DCMAKE_BUILD_TYPE=Release -DTARGET=server -DDE_FLAG=true -DUSE_SAFE_MEM_LIB=OFF ../..
29+
elif [ "${HARDWARE}" == "SG1" ]; then
30+
cmake -DCMAKE_BUILD_TYPE=Release -DTARGET=server -DDE_FLAG=true -DUSE_SAFE_MEM_LIB=OFF -DENABLE_SG1=ON ../..
31+
elif [ "${HARDWARE}" == "ATSM" ]; then
32+
cmake -DCMAKE_BUILD_TYPE=Release -DTARGET=server -DDE_FLAG=true -DUSE_SAFE_MEM_LIB=OFF -DENABLE_ATSM=ON ../..
33+
fi
2634
else
2735
sudo cp ../../ffmpeg/dependency/*.so /usr/local/lib/
2836
sudo cp ../../ffmpeg/dependency/*.pc /usr/local/lib/pkgconfig/
@@ -178,6 +186,24 @@ build_test(){
178186
fi
179187
}
180188

189+
if [ $# == 3 ] ; then
190+
if [ "${HARDWARE}" != "SG1" ] && [ "${HARDWARE}" != "ATSM" ] ; then
191+
echo "${HARDWARE} not supported! [SG1, ATSM] only."
192+
exit 1
193+
fi
194+
195+
if [ "${TARGET}" == "server" ] ; then
196+
if [ "${PREBUILD_FLAG}" != "y" ] && [ "${PREBUILD_FLAG}" != "n" ] ; then
197+
parameters_usage
198+
exit 1
199+
else
200+
build_server oss
201+
fi
202+
else
203+
echo "Hardware support is only for server"
204+
fi
205+
fi
206+
181207
if [ $# == 2 ] ; then
182208

183209
if [ "${TARGET}" == "server" ] ; then

src/external/prebuild.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,11 @@ install_tools() {
6969
fi
7070

7171
mkdir -p ../build/external && cd ../build/external
72-
if [ ! -f "./zlib-1.2.12.tar.gz" ];then
73-
wget http://zlib.net/zlib-1.2.12.tar.gz
72+
if [ ! -f "./zlib-1.2.13.tar.gz" ];then
73+
wget http://zlib.net/zlib-1.2.13.tar.gz
7474
fi
75-
tar xf zlib-1.2.12.tar.gz
76-
cd zlib-1.2.12 && ./configure && make -j $(nproc) && sudo make install && cd ..
75+
tar xf zlib-1.2.13.tar.gz
76+
cd zlib-1.2.13 && ./configure && make -j $(nproc) && sudo make install && cd ..
7777

7878
program_exists yasm
7979
if [ $? != 0 ];then

0 commit comments

Comments
 (0)