1,準備
1.1 android ndk
vim ~/.bashrc
# 新增android-ndk
export android_ndk=~/android-ndk-r21
source ~/.bashrc
1.2 vulkan
tar -xf vulkansdk-linux-x86_64-1.2.141.0.tar.gz
sudo apt install vulkan-utils
# setup vulkan env
export vulkan_sdk=$home/vulkansdk-linux-x86_64-1.2.141.0/x86_64
export path=$vulkan_sdk/bin:$path
export ld_library_path=$vulkan_sdk/lib:$ld_library_path
export library_path=$vulkan_sdk/lib:$library_path
export vk_layer_path=$vulkan_sdk/etc/vulkan/explicit_layer.d
1.3 protobuf > 3.0
1.4 cmake > 3.0
2,安裝
git clone
cd mnn
修改cmakelists.txt
# backend options
option(mnn_metal "enable metal" off)
option(mnn_opencl "enable opencl" on)
option(mnn_opengl "enable opengl" on)
option(mnn_vulkan "enable vulkan" on)
option(mnn_arm82 "enable arm82" on)
./schema/generate.sh
cd project/android
# 編譯armv7動態庫:mkdir build_32 && cd build_32 && ../build_32.sh
# 編譯armv8動態庫:mkdir build_64 && cd build_64 && ../build_64.sh
mkdir build_64
cd build_64
../build_64.sh
make -j4
3,測試
cd mnn/benchmark
./bench_android.sh
5,android stdio
5.1 android stdio -> android device
lsudb
sudo vim /etc/udev/rules.d/51-android.rules
subsystem=="usb", attr=="18d1", mode="4ee7"
sudo chmod 777 /etc/udev/rules.d/51-android.rules
adb kill-server
adb start-server
adb devices
選擇android device,啟動
5.2 android新增庫
// 建立session需要的配置
mnn::scheduleconfig config;
// 選擇backend
config.type = mnn_forward_cpu;
// 執行緒數
config.numthread = 2;
// 配置相應的backend
backendconfig backendconfig;
// 選擇低精度/一般配置計算
backendconfig.precision = backendconfig::precision_low;
// 或者
// backendconfig.precision = backendconfig::precision_normal;
config.backendconfig = &backendconfig;
6,inference 最近編譯tolua runtime安卓編譯錯誤
編譯時出現以下錯誤 in file included from lj ffrecord.c 859 0 lj recdef.h 224 1 error recff rawlen undeclared here not in a function recff rawlen,makefile 645 r...
安卓反編譯記錄
cmd到工作所在的目錄下 apktool.bat d f zhihu signed.apk o zhihu 說明 其中d是decode的意思,表示我們要對apk進行解碼。f 如果目標資料夾已存在,則強制刪除現有資料夾 預設如果目標資料夾已存在,則解碼失敗 o 指定解碼目標資料夾的名稱 預設使用apk...
安卓編譯mysql MySQL 原始碼編譯
1.自己記下筆記,每次翻官網,時間有些長了,給自己以後安裝省事mysql 5.1.45 configure prefix usr local mysql5 without debug without bench without docs without geometry without ndb de...