3 function preset_configure()
7 REQUIRED_UNITS+=("angkor" "cwrap" "foder" "oops" "pepper-assert")
8 REQUIRED_UNITS+=("pepper-str" "pepper-strcast" "pp" "safemain" "stdex")
9 # Hermes Logging Framework
10 REQUIRED_UNITS+=("hermes" "hermes-std")
11 # loco IR and related utilities
12 REQUIRED_UNITS+=("loco" "locop" "locomotiv" "logo-core" "logo")
13 # TensorFlow GraphDef I/O
14 REQUIRED_UNITS+=("mio-tflite" "mio-circle")
15 # Circle compiler library (.circle -> .circle)
16 REQUIRED_UNITS+=("luci")
18 REQUIRED_UNITS+=("circlechef" "circle2circle" "circle-verify")
19 REQUIRED_UNITS+=("luci-interpreter" "record-minmax" "tflchef")
20 REQUIRED_UNITS+=("tflite2circle" "tf2tfliteV2")
22 NPROC=$(cat /proc/cpuinfo | grep -c processor)
24 # TODO Use "nncc configure" and "nncc build"
27 -DTF2NNPKG_FOR_WINDOWS=ON \
28 -DUSE_PROTOBUF_LEGACY_IMPORT=ON \
29 -DCMAKE_EXE_LINKER_FLAGS="-Wl,--allow-multiple-definition" \
30 -DCMAKE_SHARED_LINKER_FLAGS="-Wl,--allow-multiple-definition" \
32 -DDOWNLOAD_GTEST=OFF \
34 -DCMAKE_C_COMPILER=gcc \
35 -DCMAKE_CXX_COMPILER=g++ \
36 -DCMAKE_INSTALL_PREFIX="${NNCC_INSTALL_PREFIX}" \
37 -DCMAKE_BUILD_TYPE=release \
38 -DBUILD_WHITELIST=$(join_by ";" "${REQUIRED_UNITS[@]}") \
39 -DEXTERNALS_BUILD_THREADS=$((NPROC/2)) \
41 "${NNAS_PROJECT_PATH}/infra/nncc"
44 function preset_install()
46 # Install libraries to bin/ for Windows release
47 mv ${NNCC_INSTALL_PREFIX}/lib/*.dll ${NNCC_INSTALL_PREFIX}/bin
48 rm -rf ${NNCC_INSTALL_PREFIX}/lib
50 install -t "${NNPKG_INSTALL_PREFIX}/bin" -D \
51 "${NNAS_PROJECT_PATH}/tools/nnpackage_tool/model2nnpkg/model2nnpkg.sh"
54 install -T -m 755 -D "${SCRIPT_PATH}/res/tf2nnpkg.${PRESET}" "${NNAS_INSTALL_PREFIX}/bin/tf2nnpkg"
56 # Though you have to install tensorflow to run 'tf2tfliteV2',
57 # tensorflow can't be installed in mingw. First, You can install tensorflow
58 # from Window native CMD(run as administrator) with python virtual environment.
59 # And, you must copy it to "${NNAS_INSTALL_PREFIX}/bin/venv"