-
Notifications
You must be signed in to change notification settings - Fork 64
/
batch_build_linux.sh
102 lines (81 loc) · 4.02 KB
/
batch_build_linux.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
#!/bin/bash
echo "Automatic build script of radarsimcpp/radarsimpy for Linux"
echo ""
echo "----------"
echo "RadarSimPy - A Radar Simulator Built with Python"
echo "Copyright (C) 2018 - PRESENT radarsimx.com"
echo "E-mail: [email protected]"
echo "Website: https://radarsimx.com"
echo ""
echo "██████╗ █████╗ ██████╗ █████╗ ██████╗ ███████╗██╗███╗ ███╗██╗ ██╗"
echo "██╔══██╗██╔══██╗██╔══██╗██╔══██╗██╔══██╗██╔════╝██║████╗ ████║╚██╗██╔╝"
echo "██████╔╝███████║██║ ██║███████║██████╔╝███████╗██║██╔████╔██║ ╚███╔╝ "
echo "██╔══██╗██╔══██║██║ ██║██╔══██║██╔══██╗╚════██║██║██║╚██╔╝██║ ██╔██╗ "
echo "██║ ██║██║ ██║██████╔╝██║ ██║██║ ██║███████║██║██║ ╚═╝ ██║██╔╝ ██╗"
echo "╚═╝ ╚═╝╚═╝ ╚═╝╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝╚═╝ ╚═╝╚═╝ ╚═╝"
workpath=$(pwd)
echo "## Clean old build files ##"
rm -rf ./src/radarsimcpp/build
rm -rf ./radarsimpy
echo "## Building libradarsimcpp.so with CPU ##"
mkdir ./src/radarsimcpp/build
cd ./src/radarsimcpp/build
cmake -DCMAKE_BUILD_TYPE=Release -DGTEST=ON ..
cmake --build .
echo "## Building radarsimpy with Cython ##"
cd $workpath
conda run -n py312 python setup.py build_ext -b ./ --tier free --arch cpu
conda run -n py311 python setup.py build_ext -b ./ --tier free --arch cpu
conda run -n py310 python setup.py build_ext -b ./ --tier free --arch cpu
conda run -n py39 python setup.py build_ext -b ./ --tier free --arch cpu
echo "## Copying lib files to ./radarsimpy ##"
# mkdir ./radarsimpy
cp ./src/radarsimpy/*.py ./radarsimpy
cp ./src/radarsimpy/lib/__init__.py ./radarsimpy/lib
cp ./src/radarsimcpp/build/*.so ./radarsimpy
echo "## Cleaning radarsimpy builds ##"
rm -rf build
rm -f ./src/radarsimpy/*.c
rm -f ./src/radarsimpy/*.cpp
rm -f ./src/radarsimpy/*.html
rm -f ./src/radarsimpy/raytracing/*.c
rm -f ./src/radarsimpy/raytracing/*.cpp
rm -f ./src/radarsimpy/raytracing/*.html
rm -f ./src/radarsimpy/lib/*.cpp
rm -f ./src/radarsimpy/lib/*.html
rm -f ./src/*.cpp
rm -f ./src/*.html
echo "## Copying lib files to freetier release folder ##"
rm -rf ./Linux_x86_64_CPU_FreeTier
mkdir ./Linux_x86_64_CPU_FreeTier
mkdir ./Linux_x86_64_CPU_FreeTier/radarsimpy
cp -rf ./radarsimpy/* ./Linux_x86_64_CPU_FreeTier/radarsimpy
rm -rf ./radarsimpy
conda run -n py312 python setup.py build_ext -b ./ --tier standard --arch cpu
conda run -n py311 python setup.py build_ext -b ./ --tier standard --arch cpu
conda run -n py310 python setup.py build_ext -b ./ --tier standard --arch cpu
conda run -n py39 python setup.py build_ext -b ./ --tier standard --arch cpu
echo "## Copying lib files to ./radarsimpy ##"
cp ./src/radarsimpy/*.py ./radarsimpy
cp ./src/radarsimpy/lib/__init__.py ./radarsimpy/lib
cp ./src/radarsimcpp/build/*.so ./radarsimpy
echo "## Cleaning radarsimpy builds ##"
rm -rf build
rm -f ./src/radarsimpy/*.c
rm -f ./src/radarsimpy/*.cpp
rm -f ./src/radarsimpy/*.html
rm -f ./src/radarsimpy/raytracing/*.c
rm -f ./src/radarsimpy/raytracing/*.cpp
rm -f ./src/radarsimpy/raytracing/*.html
rm -f ./src/radarsimpy/lib/*.cpp
rm -f ./src/radarsimpy/lib/*.html
rm -f ./src/*.cpp
rm -f ./src/*.html
echo "## Copying lib files to standard release folder ##"
rm -rf ./Linux_x86_64_CPU
mkdir ./Linux_x86_64_CPU
mkdir ./Linux_x86_64_CPU/radarsimpy
cp -rf ./radarsimpy/* ./Linux_x86_64_CPU/radarsimpy
echo "## Build completed ##"
echo "## Run Google test ##"
./src/radarsimcpp/build/radarsimcpp_test