5.10. Archive file

5.10.1. Generation

After you generate your project from your protocol buffer, you can pack binaries into an archive for each platform that the program is going to work on. The compile command would be like below.

make build ARCH={x86, x86_avx, aarch64, arm, fpga} TYPE=static

Example:

make build ARCH=x86 TYPE=static

These commands will generate the following files:

  • libdlk_x86.a

  • libdlk_x86_avx.a

  • libdlk_aarch64.a

  • libdlk_arm.a

  • libdlk_fpga.a

After you generate one of above arhive files, you can compile it with your own source codes. The defined functions are same than those of the shared libraries (.so).

5.10.2. Usage

Here we show the example that generates binary behaves same than lm_x86 for classificatoin.

5.10.2.1. Generate Project (common process)

python blueoil/converter/generate_project.py -i examples/classification/lmnet_quantize_cifar10/minimal_graph_with_shape.pb -o ./ -p cls -hq
cd cls.prj

5.10.2.2. Compile for x86

make clean
make build ARCH=x86 TYPE=static -j8
g++ -std=c++14 mains/main.cpp libdlk_x86.a -I./include -o lm_x86.elf

5.10.2.3. Compile for x86_avx

make clean
make build ARCH=x86_avx TYPE=static -j8
g++ -std=c++14 mains/main.cpp libdlk_x86_avx.a -I./include -o lm_x86_avx.elf -fopenmp

5.10.2.4. Compile for aarch64

make clean
make build ARCH=aarch64 TYPE=static -j8
aarch64-linux-gnu-g++ -std=c++14 mains/main.cpp libdlk_aarch64.a -I./include -o lm_aarch64.elf -fopenmp

5.10.2.5. Compile for arm

make clean
make build ARCH=arm TYPE=static -j8 
arm-linux-gnueabihf-g++ -std=c++14 mains/main.cpp libdlk_arm.a -I./include -o lm_arm.elf -fopenmp

5.10.2.6. Compile for fpga

make clean
make build ARCH=fpga TYPE=static -j8
arm-linux-gnueabihf-g++ -std=c++14 mains/main.cpp libdlk_fpga.a -I./include -o lm_fpga.elf -fopenmp