Contents


    Prerequisites
        Linux Host System Compilation Tools
        Windows Host System Compilation Tools
        MacOS Host System Compilation Tools
        Android Target System Cross-Compilation Tools
        Linux-AArch64 Target System Cross-Compilation Tools
        iOS Target System Cross-Compilation Tools
        Tools
    Download and Build Bolt
    Common install problem

Prerequisites


Linux Host System Compilation Tools

Windows Host System Compilation Tools

MacOS Host System Compilation Tools

  • Xcode

    Download and install Xcode.

Android Target System Cross-Compilation Tools

Linux-AArch64 Target System Cross-Compilation Tools

iOS Target System Cross-Compilation Tools

  • Cross compiler for Linux

    Here is an tutorial for building toolchains.

  • Cross compiler for MacOS

    You can use MacOS's clang to build. Only need to set shell environment IOS_SDK_ROOT to iPhoneOS.sdk.

      export IOS_SDK_ROOT=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk
    

Tools

  • Android adb

    Refer to the ADB installation example to install ADB tool helping you transfer the executables to android mobile phones.

    export PATH=/data/opt/platform-tools:$PATH
    
  • Android dx

    If you want to directly run jar file on Android device, you can use Android dx tool. Install Android v28.0.3 build tools and set shell environment PATH.

  • JDK

    If you want to use Java API without Android NDK, you need to install JDK.

    Download and install OpenJDK and set shell environment PATH and JNI_ROOT.

    export JNI_ROOT=/data/opt/openjdk-16_windows-x64_bin
    export PATH=${JNI_ROOT}/bin:$PATH
    

Download and Build Bolt


A simple shell script install.sh is provided to build and install the Bolt library, and you should modify it according to your scenario and environment. --target option is requireed to set target deployment platform. Use help message to find more useful information. There are some commn used build command.

We will install Bolt to install_[target] directory. These subdirectories will be found in it:

  • include
  • lib
    • libBoltModel.so: build for Java application
    • libbolt.so: build for C/C++ application
    • libflow.so: flow sub project library, when using --flow option
    • libengine.so: inference sub project library
    • libtensor.so: tensor computing sub project library
    • libimage.so: image sub project library
    • libblas_enhance.so: blas_enhance sub project library
    • libmodel_tools*.so: model_tools sub project library
    • libmodel_spec.so: model_spec sub project library
    • libuni.so: uni sub project library
  • tools
    • X2bolt for generally converting deep learning(caffe/onnx/tflite/tensorflow) model to bolt model
    • post_training_quantization for generating bolt int8 inference model
    • tensorflow2caffe for converting tensorflow model to caffe model
    • pytorch2caffe for converting pytorch model to caffe model
  • tests
    • operator unit test
  • examples

    • benchmark for measuring inference performance of bolt model

      These examples will be build when using --example option

    • classification for imagenet classification task,c_image_classifification is a simplified C API version
    • u2net for object detection
    • ultra_face for face detection
    • tinybert and tinybert_onnx for tinybert intention identification
    • nmt for machine translation
    • asr_rnnt for automatic speech recognition task (RNNT model)
    • asr_convolution_transformer for automatic speech recognition task (Convolution+Transformer model)
    • vad for ASR pinyin to chinese
    • tts for text to speech
    • c_input_method for input method

Common install problem


results matching ""

    No results matching ""