summaryrefslogtreecommitdiff
path: root/infra/packaging/preset/20230907
blob: 44bc4e00fac808039604a2a032c1d69974f3967c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/bin/bash

# NOTE purpose of this file is static analysis only
#      new official preset will be added when new programs are ready

PRESET="20230907"

function preset_configure()
{
  REQUIRED_UNITS=()
  # Common Libraries
  REQUIRED_UNITS+=("angkor" "cwrap" "pepper-str" "pepper-strcast" "pp")
  REQUIRED_UNITS+=("oops" "pepper-assert" "pepper-csv2vec" "foder" "crew")
  REQUIRED_UNITS+=("souschef")
  REQUIRED_UNITS+=("safemain")
  REQUIRED_UNITS+=("arser")
  REQUIRED_UNITS+=("vconone")
  # Hermes Logging Framework
  REQUIRED_UNITS+=("hermes" "hermes-std")
  # loco IR and related utilities
  REQUIRED_UNITS+=("loco" "locop" "locomotiv" "logo-core" "logo")
  # Flatbuffer I/O
  REQUIRED_UNITS+=("mio-tflite2121" "mio-circle06")
  # Data I/O
  REQUIRED_UNITS+=("dio-hdf5")
  # Compute
  REQUIRED_UNITS+=("luci-compute")
  # Circle compiler library (.circle -> .circle)
  REQUIRED_UNITS+=("luci")
  # Python interface for circle schema
  REQUIRED_UNITS+=("pics")
  # Tools
  REQUIRED_UNITS+=("tflite2circle" "circle2circle" "tflchef")
  REQUIRED_UNITS+=("circle-tensordump" "circledump")
  REQUIRED_UNITS+=("tf2tfliteV2" "luci-interpreter")
  REQUIRED_UNITS+=("luci-eval-driver")
  REQUIRED_UNITS+=("record-minmax" "circle-quantizer" "rawdata2hdf5" "circle-mpqsolver")
  REQUIRED_UNITS+=("circle-eval-diff" "circle-interpreter")
  REQUIRED_UNITS+=("circle-partitioner" "circle-operator")
  REQUIRED_UNITS+=("one-cmds")
  REQUIRED_UNITS+=("bcq-tools")
  REQUIRED_UNITS+=("dalgona")
  REQUIRED_UNITS+=("visq")
  REQUIRED_UNITS+=("circle-opselector")

  # Dependent modules needed for build
  REQUIRED_UNITS+=("circlechef")
  REQUIRED_UNITS+=("circle-verify")

  NPROC=${NPROC:-$(cat /proc/cpuinfo | grep -c processor)}

  # TODO Use "nncc configure" and "nncc build"
  cmake \
    -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 tf2nnpkg
  install -T -m 755 -D "${SCRIPT_PATH}/res/tf2nnpkg.${PRESET}" "${NNAS_INSTALL_PREFIX}/bin/tf2nnpkg"
}