aboutsummaryrefslogtreecommitdiff
path: root/README_WINDOWS.md
blob: d453cd9d54dd8ac65b7fef7760ffc5a10bb54bbb (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
# Building on Windows Systems
Linux is the main development environment recommended ("Windows Subsystem for
Linux" can be used for a full Linux Bash environment under Windows), especially
with regards to building the TensorFlow Lite for Microcontrollers (TFLu)
library, which depends on GNU Make and are using a number of Bash shell scripts.
However, there are a number of possibilities for building on a Windows system.

## Requirements
- **CMake**. E.g. Windows native CMake, MSYS CMake, Cygwin CMake, or MinGW
  CMake. (Note: Supported generators may differ).
- **make tool**. E.g. GNU Make, NMAKE, Jom, mingw32-make, GNU Make under MSYS or
  Cygwin.
- **ARM toolchain**.
  [Arm Clang](https://developer.arm.com/tools-and-software/embedded/arm-compiler)
  or
  [GNU Arm Embedded Toolchain](https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm)

### Building with TensorFlow Lite for Microcontrollers
- **Shell**. E.g. "MSYS shell", "GIT Bash", or "Cygwin Terminal"
- **GNU Make**. (NOTE: required when building TFLu even if another generator is
  used in CMake).
- **GNU Wget**.

### Using a prebuilt TensorFlow Lite for Microcontrollers library
A prebuilt TFLu library can be supplied via the variable
 `TFLU_PREBUILT_LIBRARY_PATH`. The project can then be built without the
requirements under
[Building with TensorFlow Lite for Microcontrollers](#Building-with-TensorFlow-Lite-for-Microcontrollers)
(apart from the initially build of the library).

## Troubleshooting
There are many options for tools and environment to build in, and the behaviour
in each specific development environment might differ slightly.

* Cross drive locations might not work. If this is the case mount to a usable
  path in the shell used.
* There might be issues with NSYS/CMake and some toolchain paths, i.e. 'Program
  Files (x86)'. Can be solved by mounting in MSYS to a usable path, or the
  native Windows CMake can be called from the MSYS shell.
* GNU Wget is needed for downloads in TFLu.
* There might be issues rebuilding with CMake 3.20, with erroneous dependency
  make files generated. Update to CMake 3.20.1, or downgrade to an earlier CMake
  version.
* May need to unset TMPDIR environmental variable to get FlatBuffers download in
  TFLu to work.
* When using Cygwin Terminal there might be error messages concerning '\r' in
  the TFLu Bash scripts. In this case run dos2unix on these scripts.