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