1、配置参数,点击configure
2、 点击generate
3、在终端输入make
出现的错误:1
Scanning dependencies of target ncnn
[ 29%] Building CXX object src/CMakeFiles/ncnn.dir/allocator.cpp.obj
arm-linux-gnueabihf-g++: error: unrecognized command line option ‘-msse2’
arm-linux-gnueabihf-g++: error: unrecognized command line option ‘-msse’; did you mean ‘-fdse’?
src/CMakeFiles/ncnn.dir/build.make:334: recipe for target 'src/CMakeFiles/ncnn.dir/allocator.cpp.obj' failed
make[2]: *** [src/CMakeFiles/ncnn.dir/allocator.cpp.obj] Error 1
CMakeFiles/Makefile2:86: recipe for target 'src/CMakeFiles/ncnn.dir/all' failed
make[1]: *** [src/CMakeFiles/ncnn.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
解决办法:
在CMakeLists.txt中
option(NCNN_SSE2 "optimize x86 platform with sse2" ON)
替换为
option(NCNN_SSE2 "optimize x86 platform with sse2" OFF)
出现的错误:2
[ 12%] Building CXX object src/CMakeFiles/ncnn.dir/layer/x86/batchnorm_x86_avx2.cpp.obj
arm-linux-gnueabihf-g++: error: unrecognized command line option ‘-mfma’
arm-linux-gnueabihf-g++: error: unrecognized command line option ‘-mf16c’
arm-linux-gnueabihf-g++: error: unrecognized command line option ‘-mavx2’
src/CMakeFiles/ncnn.dir/build.make:982: recipe for target 'src/CMakeFiles/ncnn.dir/layer/x86/batchnorm_x86_avx2.cpp.obj' failed
make[2]: *** [src/CMakeFiles/ncnn.dir/layer/x86/batchnorm_x86_avx2.cpp.obj] Error 1
CMakeFiles/Makefile2:86: recipe for target 'src/CMakeFiles/ncnn.dir/all' failed
make[1]: *** [src/CMakeFiles/ncnn.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2
解决办法:
在CMakeLists.txt中
option(NCNN_AVX2 "optimize x86 platform with avx2" ON)
替换为
option(NCNN_AVX2 "optimize x86 platform with avx2" OFF)