Imported Upstream version 1.7.0
[platform/core/ml/nnfw.git] / infra / packaging / preset / 20200630
1 #!/bin/bash
2
3 # NOTE purpose of this file is static analysis only
4 #      new official preset will be added when new programs are ready
5
6 PRESET="20200630"
7
8 function preset_configure()
9 {
10   REQUIRED_UNITS=()
11   # Common Libraries
12   REQUIRED_UNITS+=("angkor" "cwrap" "pepper-str" "pepper-strcast" "pp" "stdex")
13   REQUIRED_UNITS+=("oops" "pepper-assert" "foder")
14   REQUIRED_UNITS+=("souschef")
15   REQUIRED_UNITS+=("safemain")
16   REQUIRED_UNITS+=("arser")
17   # Hermes Logging Framework
18   REQUIRED_UNITS+=("hermes" "hermes-std")
19   # loco IR and related utilities
20   REQUIRED_UNITS+=("loco" "locop" "locomotiv" "logo-core" "logo")
21   # Flatbuffer I/O
22   REQUIRED_UNITS+=("mio-tflite" "mio-circle")
23   # Circle compiler library (.circle -> .circle)
24   REQUIRED_UNITS+=("luci")
25   # Tools
26   REQUIRED_UNITS+=("tflite2circle" "circle2circle" "tflchef" "circlechef")
27   REQUIRED_UNITS+=("tf2tfliteV2" "luci-interpreter" "circle-verify")
28   REQUIRED_UNITS+=("record-minmax" "circle-quantizer")
29   REQUIRED_UNITS+=("one-cmds")
30
31   # TODO Use "nncc configure" and "nncc build"
32   cmake \
33     -DCMAKE_INSTALL_PREFIX="${NNCC_INSTALL_PREFIX}" \
34     -DCMAKE_BUILD_TYPE=release \
35     -DBUILD_WHITELIST=$(join_by ";" "${REQUIRED_UNITS[@]}") \
36     ${EXTRA_OPTIONS[@]} \
37     "${NNAS_PROJECT_PATH}/infra/nncc"
38 }
39
40 function preset_install()
41 {
42   install -t "${NNPKG_INSTALL_PREFIX}/bin" -D \
43     "${NNAS_PROJECT_PATH}/tools/nnpackage_tool/model2nnpkg/model2nnpkg.sh"
44
45   # Install tf2nnpkg
46   install -T -m 755 -D "${SCRIPT_PATH}/res/tf2nnpkg.${PRESET}" "${NNAS_INSTALL_PREFIX}/bin/tf2nnpkg"
47
48   # Create python virtual enviornment
49   python3 -m venv "${NNAS_INSTALL_PREFIX}/bin/venv"
50
51   # Install tensorflow
52   source "${NNAS_INSTALL_PREFIX}/bin/venv/bin/activate"
53   python -m pip --default-timeout=1000 --trusted-host pypi.org --trusted-host files.pythonhost.org \
54     install -U pip setuptools
55   python -m pip --default-timeout=1000 --trusted-host pypi.org --trusted-host files.pythonhost.org \
56     install tensorflow-cpu==2.3.0rc0
57 }