-
Notifications
You must be signed in to change notification settings - Fork 15
/
build-default.sh
executable file
·55 lines (48 loc) · 1.8 KB
/
build-default.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
#!/usr/bin/env bash
sysOS=$(uname -s)
NUM_THREADS=1
if [ $sysOS == "Darwin" ]; then
#echo "I'm MacOS"
NUM_THREADS=$(sysctl -n hw.nCPU)
elif [ $sysOS == "Linux" ]; then
#echo "I'm Linux"
NUM_THREADS=$(grep ^processor /proc/cpuinfo | wc -l)
else
echo "Other OS: $sysOS"
fi
mkdir -p ${sysOS}-BIN-CPU
pushd ${sysOS}-BIN-CPU
cmake -DCMAKE_INSTALL_PREFIX=install -DCMAKE_BUILD_TYPE=Release -DOCR_OUTPUT="BIN" -DOCR_VULKAN="CPU" ..
cmake --build . --config Release -j $NUM_THREADS
cmake --build . --config Release --target install
popd
mkdir -p ${sysOS}-BIN-GPU
pushd ${sysOS}-BIN-GPU
cmake -DCMAKE_INSTALL_PREFIX=install -DCMAKE_BUILD_TYPE=Release -DOCR_OUTPUT="BIN" -DOCR_VULKAN="GPU" ..
cmake --build . --config Release -j $NUM_THREADS
cmake --build . --config Release --target install
popd
mkdir -p ${sysOS}-JNI-CPU
pushd ${sysOS}-JNI-CPU
cmake -DCMAKE_INSTALL_PREFIX=install -DCMAKE_BUILD_TYPE=Release -DOCR_OUTPUT="JNI" -DOCR_VULKAN="CPU" ..
cmake --build . --config Release -j $NUM_THREADS
cmake --build . --config Release --target install
popd
mkdir -p ${sysOS}-JNI-GPU
pushd ${sysOS}-JNI-GPU
cmake -DCMAKE_INSTALL_PREFIX=install -DCMAKE_BUILD_TYPE=Release -DOCR_OUTPUT="JNI" -DOCR_VULKAN="GPU" ..
cmake --build . --config Release -j $NUM_THREADS
cmake --build . --config Release --target install
popd
mkdir -p ${sysOS}-CLIB-CPU
pushd ${sysOS}-CLIB-CPU
cmake -DCMAKE_INSTALL_PREFIX=install -DCMAKE_BUILD_TYPE=Release -DOCR_OUTPUT="CLIB" -DOCR_VULKAN="CPU" ..
cmake --build . --config Release -j $NUM_THREADS
cmake --build . --config Release --target install
popd
mkdir -p ${sysOS}-CLIB-GPU
pushd ${sysOS}-CLIB-GPU
cmake -DCMAKE_INSTALL_PREFIX=install -DCMAKE_BUILD_TYPE=Release -DOCR_OUTPUT="CLIB" -DOCR_VULKAN="GPU" ..
cmake --build . --config Release -j $NUM_THREADS
cmake --build . --config Release --target install
popd