-
Notifications
You must be signed in to change notification settings - Fork 31
Expand file tree
/
Copy pathci_ascend_script.sh
More file actions
56 lines (50 loc) · 1.25 KB
/
ci_ascend_script.sh
File metadata and controls
56 lines (50 loc) · 1.25 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
# !/bin/bash
set -eo pipefail
echo "pwd: $(pwd)"
function build_diopi_lib() {
cd third_party/DIOPI/impl
sh scripts/build_impl.sh clean
sh scripts/build_impl.sh ascend || exit -1
cd -
}
function config_dipu_ascend_cmake() {
mkdir -p build && cd ./build
cmake_args="-DCMAKE_BUILD_TYPE=Release -DDEVICE=ascend -DWITH_DIOPI_LIBRARY=DISABLE"
cmake ../ $cmake_args
cd ../
}
function config_all_ascend_cmake() {
mkdir -p build && cd ./build
cmake_args="-DCMAKE_BUILD_TYPE=Release -DDEVICE=ascend -DENABLE_COVERAGE=${USE_COVERAGE} -DWITH_DIOPI=INTERNAL"
cmake ../ $cmake_args
cd ../
}
function build_dipu_without_diopi() {
echo "building dipu_lib without diopi:$(pwd)"
config_dipu_ascend_cmake 2>&1 | tee ./build1.log
cd build && make -j8 2>&1 | tee ./build1.log && cd ..
}
function build_all() {
echo "building dipu_lib:$(pwd)"
echo "DIOPI_ROOT:${DIOPI_ROOT}"
config_all_ascend_cmake 2>&1 | tee ./build1.log
cd build && make -j8 2>&1 | tee ./build1.log && cd ..
}
case $1 in
build_dipu)
(
build_all
) ||
exit -1
;;
build_dipu_without_diopi)
(
build_dipu_without_diopi
) ||
exit -1
;;
*)
echo -e "[ERROR] Incorrect option:" $1
;;
esac
exit 0