Imported Upstream version 1.25.0
[platform/core/ml/nnfw.git] / infra / packaging / preset / 20230907
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="20230907"
7
8 function preset_configure()
9 {
10   REQUIRED_UNITS=()
11   # Common Libraries
12   REQUIRED_UNITS+=("angkor" "cwrap" "pepper-str" "pepper-strcast" "pp")
13   REQUIRED_UNITS+=("oops" "pepper-assert" "pepper-csv2vec" "foder" "crew")
14   REQUIRED_UNITS+=("souschef")
15   REQUIRED_UNITS+=("safemain")
16   REQUIRED_UNITS+=("arser")
17   REQUIRED_UNITS+=("vconone")
18   # Hermes Logging Framework
19   REQUIRED_UNITS+=("hermes" "hermes-std")
20   # loco IR and related utilities
21   REQUIRED_UNITS+=("loco" "locop" "locomotiv" "logo-core" "logo")
22   # Flatbuffer I/O
23   REQUIRED_UNITS+=("mio-tflite2121" "mio-circle06")
24   # Data I/O
25   REQUIRED_UNITS+=("dio-hdf5")
26   # Compute
27   REQUIRED_UNITS+=("luci-compute")
28   # Circle compiler library (.circle -> .circle)
29   REQUIRED_UNITS+=("luci")
30   # Python interface for circle schema
31   REQUIRED_UNITS+=("pics")
32   # Tools
33   REQUIRED_UNITS+=("tflite2circle" "circle2circle" "tflchef")
34   REQUIRED_UNITS+=("circle-tensordump" "circledump")
35   REQUIRED_UNITS+=("tf2tfliteV2" "luci-interpreter")
36   REQUIRED_UNITS+=("luci-eval-driver")
37   REQUIRED_UNITS+=("record-minmax" "circle-quantizer" "rawdata2hdf5" "circle-mpqsolver")
38   REQUIRED_UNITS+=("circle-eval-diff" "circle-interpreter")
39   REQUIRED_UNITS+=("circle-partitioner" "circle-operator")
40   REQUIRED_UNITS+=("one-cmds")
41   REQUIRED_UNITS+=("bcq-tools")
42   REQUIRED_UNITS+=("dalgona")
43   REQUIRED_UNITS+=("visq")
44   REQUIRED_UNITS+=("circle-opselector")
45
46   # Dependent modules needed for build
47   REQUIRED_UNITS+=("circlechef")
48   REQUIRED_UNITS+=("circle-verify")
49
50   NPROC=${NPROC:-$(cat /proc/cpuinfo | grep -c processor)}
51
52   # TODO Use "nncc configure" and "nncc build"
53   cmake \
54     -DCMAKE_INSTALL_PREFIX="${NNCC_INSTALL_PREFIX}" \
55     -DCMAKE_BUILD_TYPE=release \
56     -DBUILD_WHITELIST=$(join_by ";" "${REQUIRED_UNITS[@]}") \
57     -DEXTERNALS_BUILD_THREADS=$((NPROC/2)) \
58     ${EXTRA_OPTIONS[@]} \
59     "${NNAS_PROJECT_PATH}/infra/nncc"
60 }
61
62 function preset_install()
63 {
64   # Install tf2nnpkg
65   install -T -m 755 -D "${SCRIPT_PATH}/res/tf2nnpkg.${PRESET}" "${NNAS_INSTALL_PREFIX}/bin/tf2nnpkg"
66 }