Skip to content

Instantly share code, notes, and snippets.

@cyrusbehr
Created October 9, 2020 20:54
Show Gist options
  • Select an option

  • Save cyrusbehr/b7ac4477ced8c0ea5f8419604e2bc970 to your computer and use it in GitHub Desktop.

Select an option

Save cyrusbehr/b7ac4477ced8c0ea5f8419604e2bc970 to your computer and use it in GitHub Desktop.
Shell script for pulling ncnn source and compiling for several platforms
# Obtain release tag 20200916, set up build directories
test -e 20200916.zip || wget https://github.com/Tencent/ncnn/archive/20200916.zip
test -e ncnn-20200916 || unzip 20200916.zip
cd ncnn-20200916
test -e build_amd64 && rm -rf build_amd64
test -e build_arm32 && rm -rf build_arm32
test -e build_arm64 && rm -rf build_arm64
mkdir build_amd64
mkdir build_arm32
mkdir build_arm64
# Build for amd64
cd build_amd64
cmake -D NCNN_BUILD_TOOLS=OFF -D NCNN_VULKAN=OFF -D NCNN_AVX2=ON -D CMAKE_BUILD_TYPE=Release -D NCNN_BUILD_EXAMPLES=OFF ..
make -j$(nproc)
make install
cd ..
# Build for arm32
cd build_arm32
cmake -D NCNN_BUILD_TOOLS=OFF -D NCNN_VULKAN=OFF -D CMAKE_BUILD_TYPE=Release -D NCNN_DISABLE_RTTI=OFF \
-D CMAKE_TOOLCHAIN_FILE=../toolchains/arm-linux-gnueabihf.toolchain.cmake -D NCNN_BUILD_EXAMPLES=OFF ..
make -j$(nproc)
make install
cd ..
# Build for arm64
cd build_arm64
cmake -D NCNN_BUILD_TOOLS=OFF -D NCNN_VULKAN=OFF -D CMAKE_BUILD_TYPE=Release -D NCNN_DISABLE_RTTI=OFF \
-D CMAKE_TOOLCHAIN_FILE=../toolchains/aarch64-linux-gnu.toolchain.cmake -D NCNN_BUILD_EXAMPLES=OFF ..
make -j$(nproc)
make install
cd ..
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment