docs/how-to-use-and-FAQ/build-minimal-library.md
For some reason, if you're not happy with the binary size of the ncnn library, then here is the cheatsheet that helps you to build a minimal ncnn :P
cmake -DNCNN_DISABLE_RTTI=ON -DNCNN_DISABLE_EXCEPTION=ON ..
cmake -DNCNN_VULKAN=OFF ..
cmake -DNCNN_STDIO=OFF ..
Cannot load model from files, but can load model from memory or by Android Assets.
Read more here.
cmake -DNCNN_STRING=OFF ..
Cannot load human-readable param files with visible strings, but can load binary param.bin files.
Read more here
Cannot identify blobs by string name when calling Extractor::input / extract, but can identify them by enum value in id.h.
Read more here.
cmake -DNCNN_BF16=OFF ..
cmake -DNCNN_INT8=OFF ..
cmake -DNCNN_PIXEL_DRAWING=OFF ..
ncnn::draw_rectangle_xx / ncnn::draw_circle_xx / ncnn::draw_text_xx, but functions like Mat::from_pixels / from_pixels_resize are still available.cmake -DNCNN_PIXEL_ROTATE=OFF -DNCNN_PIXEL_AFFINE=OFF ..
ncnn::kanna_rotate_xx / ncnn::warpaffine_bilinear_xx, but functions like Mat::from_pixels / from_pixels_resize are still available.cmake -DNCNN_PIXEL=OFF ..
Mat::from_pixels / from_pixels_resize / to_pixels / to_pixels_resize, and need create a Mat and fill in data by hand.cmake -DNCNN_OPENMP=OFF ..
cmake -DNCNN_AVX2=OFF -DNCNN_ARM82=OFF ..
cmake -DNCNN_RUNTIME_CPU=OFF ..
-DNCNN_AVX2=ON / -DNCNN_ARM82=ON by hand and then sse2 / arm8 version kernels will not be compiled.cmake -DWITH_LAYER_absval=OFF -DWITH_LAYER_bnll=OFF ..
cmake -DNCNN_SIMPLESTL=ON ..
simplestl provided by ncnn as a replacement. Users also can only use simplestl when ncnn functions are called.-nodefaultlibs -fno-builtin -nostdinc++ -lccmake -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK/build/cmake/android.toolchain.cmake -DANDROID_STL=system to avoid STL conflict when compiling to Android.ncnn/src/layer/arm/ to delete unnecessary optimized kernels or replace them with empty functions.-DWITH_LAYER_absval=OFF as mentioned above.ncnn/src/layer/binaryop.cpp unaryop.cpp and ncnn/src/layer/arm/binaryop.cpp unaryop_arm.cpp by hand to delete unnecessary operators.