#!/bin/bash function preset_configure() { REQUIRED_UNITS=() # Common Libraries REQUIRED_UNITS+=("angkor" "cwrap" "foder" "oops" "pepper-assert") REQUIRED_UNITS+=("pepper-str" "pepper-strcast" "pp" "safemain" "stdex") # Hermes Logging Framework REQUIRED_UNITS+=("hermes" "hermes-std") # loco IR and related utilities REQUIRED_UNITS+=("loco" "locop" "locomotiv" "logo-core" "logo") # TensorFlow GraphDef I/O REQUIRED_UNITS+=("mio-tflite" "mio-circle") # Circle compiler library (.circle -> .circle) REQUIRED_UNITS+=("luci") # Tools REQUIRED_UNITS+=("circlechef" "circle2circle" "circle-verify") REQUIRED_UNITS+=("luci-interpreter" "record-minmax" "tflchef") REQUIRED_UNITS+=("tflite2circle" "tf2tfliteV2") NPROC=$(cat /proc/cpuinfo | grep -c processor) # TODO Use "nncc configure" and "nncc build" cmake \ -G "MSYS Makefiles" \ -DTF2NNPKG_FOR_WINDOWS=ON \ -DUSE_PROTOBUF_LEGACY_IMPORT=ON \ -DCMAKE_EXE_LINKER_FLAGS="-Wl,--allow-multiple-definition" \ -DCMAKE_SHARED_LINKER_FLAGS="-Wl,--allow-multiple-definition" \ -DENABLE_TEST=OFF \ -DDOWNLOAD_GTEST=OFF \ -DBUILD_GTEST=OFF \ -DCMAKE_C_COMPILER=gcc \ -DCMAKE_CXX_COMPILER=g++ \ -DCMAKE_INSTALL_PREFIX="${NNCC_INSTALL_PREFIX}" \ -DCMAKE_BUILD_TYPE=release \ -DBUILD_WHITELIST=$(join_by ";" "${REQUIRED_UNITS[@]}") \ -DEXTERNALS_BUILD_THREADS=$((NPROC/2)) \ ${EXTRA_OPTIONS[@]} \ "${NNAS_PROJECT_PATH}/infra/nncc" } function preset_install() { # Install libraries to bin/ for Windows release mv ${NNCC_INSTALL_PREFIX}/lib/*.dll ${NNCC_INSTALL_PREFIX}/bin rm -rf ${NNCC_INSTALL_PREFIX}/lib install -t "${NNPKG_INSTALL_PREFIX}/bin" -D \ "${NNAS_PROJECT_PATH}/tools/nnpackage_tool/model2nnpkg/model2nnpkg.sh" # Install tf2nnpkg install -T -m 755 -D "${SCRIPT_PATH}/res/tf2nnpkg.${PRESET}" "${NNAS_INSTALL_PREFIX}/bin/tf2nnpkg" # Though you have to install tensorflow to run 'tf2tfliteV2', # tensorflow can't be installed in mingw. First, You can install tensorflow # from Window native CMD(run as administrator) with python virtual environment. # And, you must copy it to "${NNAS_INSTALL_PREFIX}/bin/venv" }