-
Notifications
You must be signed in to change notification settings - Fork 5
/
docker-entrypoint.generator.sh
executable file
·54 lines (41 loc) · 1.22 KB
/
docker-entrypoint.generator.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
#!/bin/sh
set -eux
exec 2>&1
cd /out
# build main
clang++ -g \
-I/halide/Halide-Runtime/include -I/halide/Halide-Runtime/share/Halide/tools \
-L/halide/Halide-Runtime/lib -lHalide `libpng-config --cflags --ldflags` -ljpeg -lpthread -ldl -std=c++17 \
/app/blurry.cpp \
/app/blurry_gen.cpp \
-o blurry.out
# generate
LD_LIBRARY_PATH=/halide/Halide-Runtime/lib ./blurry.out
# build runtime
clang++ -g \
-I/halide/Halide-Runtime/include -I/halide/Halide-Runtime/share/Halide/tools \
-L/halide/Halide-Runtime/lib -lHalide `libpng-config --cflags --ldflags` -ljpeg -lpthread -ldl -std=c++17 \
/app/generator.cpp /halide/Halide-Runtime/share/Halide/tools/GenGen.cpp \
-o generator.out
# generate
LD_LIBRARY_PATH=/halide/Halide-Runtime/lib ./generator.out -r halide_runtime_x86 -e object -o . target=host-x86-64
# wait sync docker to disk
sleep 1;
for h in lib*_linux.a; do
echo "ar ${h} halide_runtime";
ar q ${h} halide_runtime_x86.o
done
mkdir -p include
mkdir -p lib
for h in lib*.h; do
echo "move ${h} to include/"
mv ${h} ./include/
done
for h in lib*.a; do
echo "move ${h} to lib/"
mv ${h} ./lib/
done
echo "move halide_runtime_x86.o to lib/"
mv halide_runtime_x86.o ./lib/
rm blurry.out
rm generator.out