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
Download and install Cmake from https://cmake.org/download/. Set shell environment variable PATH.
Download and install make from https://ftp.gnu.org/gnu/make/. Set shell environment variable PATH.
Download and install Wget from https://www.gnu.org/software/wget/. Set shell environment variable PATH.
Download and install Git Shell from https://gitforwindows.org/. Set system environment variable PATH.
Download and install Cmake from https://cmake.org/download/. Set system environment variable PATH.
Download and install Wget from https://eternallybored.org/misc/wget/. Set system environment variable PATH.
Download and install Mingw32-w64 from https://udomain.dl.sourceforge.net/project/mingw-w64/Toolchains%20targetting%20Win64/Personal%20Builds/mingw-builds/6.4.0/threads-posix/seh/x86_64-6.4.0-release-posix-seh-rt_v5-rev0.7z. Set system environment variable PATH.
Download and install Xcode.
Refer to the NDK installation example to install android-ndk-r22b and set shell environment variable ANDROID_NDK_ROOT.
export ANDROID_NDK_ROOT=/data/opt/android-ndk-r22b
Install gcc-arm-8.3-2019.03-x86_64-aarch64-linux-gnu and set shell environment PATH.
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
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
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.
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
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
tools
tests
examples
These examples will be build when using --example option
Use wget to download file. If you use proxy to access the network, you may be reminded to add --no-check-certificate flag when using wget.
You can download these files and save to a specified directory, Bolt will automatically use it.
Third party library protobuf use some POSIX standard system library. If you don't use POSIX version mingw, you may encounter these errors.
You can download this link to download POSIX version mingw. https://udomain.dl.sourceforge.net/project/mingw-w64/Toolchains%20targetting%20Win64/Personal%20Builds/mingw-builds/6.4.0/threads-posix/seh/x86_64-6.4.0-release-posix-seh-rt_v5-rev0.7z
error: 'mutex' in namespace 'std' does not name a type
std::mutex mu_;
error: 'once_flag' in namespace 'std' does not name a type
using once_flag = std::once_flag;
error: 'call_once' is not a member of 'std'
std::call_once(std::forward<Args>(args)...);
error: 'strtoll' was not declared in this scope
return strtoll(nptr, endptr, base);
error: 'thread' is not a member of 'std'
static std::atomic<std::thread::id> runner;
Third party library are used in model conversion tools. If you don't want to use it, you can close it by using --converter=OFF option. This will not build third party library.
You can implement it by modifying install.sh. for example, there are some cmake options, such as -DUSE_CAFFE=ON for Caffe.
You can implement it by change --fp32, --fp16 and --int8 option setting.
You may encounter various compilation problem, this maybe caused by compiler or others. Here is an example.
mingw64\bin\ar.exe: unable to rename 'CMakeFiles\test_softmax.dir/objects.a'; reason: File exists
You can enter build directory build_[target] and continuously run make install. This may complete all compilation step by step.
Bolt use -t option to set use parallel build, and default value is 8. If you encounter unknown error, you can try to set -t 1 to use serial build.
Dear OpenI User
Thank you for your continuous support to the Openl Qizhi Community AI Collaboration Platform. In order to protect your usage rights and ensure network security, we updated the Openl Qizhi Community AI Collaboration Platform Usage Agreement in January 2024. The updated agreement specifies that users are prohibited from using intranet penetration tools. After you click "Agree and continue", you can continue to use our services. Thank you for your cooperation and understanding.
For more agreement content, please refer to the《Openl Qizhi Community AI Collaboration Platform Usage Agreement》