Compiling Edge Impulse Locally

Local or Cloud Installation

I was wondering what prerequisites people are finding work well together for local installations of Edge Impulse on Linux either Ubuntu or Debian?


Someone, probably @janjongboom has done a lot of work showing how to run Edge Impulse locally on Windows, Mac and Linux. See the docs at

I am always trying to simplify coding for my students. I never know if I am doing things the best way. I just try lots of things and see what works best for me! So far, I am having limited results using these:

For the Arduino Client

  1. This worked
 curl -fsSL | sh     


  1. This worked
python3 -m pip install mbed-cli

For Zephr and Nordic.

Looks like you need a complete package that works well together. Info here and here

  1. not tried yet but it says for nrf-connect try (info above). Not sure if this is nrf-connect or a prerequisite for it
sudo dpkg -i device-tree-compiler_1.4.7-1_amd64.deb
  1. For West this works, one time it did not like the second command
pip3 install --user west    
west init -l  
  1. not tried yet but this looks useful for a full prerequisite install
sudo apt-get install --no-install-recommends git cmake ninja-build gperf \
  ccache dfu-util device-tree-compiler wget \
  python3-pip python3-setuptools python3-tk python3-wheel xz-utils file \
  make gcc gcc-multilib

  1. Segger Dev tools (I will not need these for work in the cloud) link here

For HiMax

  1. (You need a license, so not going there) info here

For SiliconLabs Thunderboard Sense 2

  1. You need simplicity studio link here This installs really nicely on windows so probably wont install this on the cloud.

For C and C++ and other boards

From the docs here . “You need * GNU Make - to build the application. make should be in your PATH. A modern C++ compiler. The default LLVM version on macOS works, but on Linux upgrade to LLVM 9 (installation instructions).”

For GNU, there are so many installations I am not sure which is best for Edge Impulse.

  1. for Just Make and GCC
sudo apt-get install --no-install-recommends make gcc gcc-multilib

  1. but this also seems to install make and gcc :worried:
sudo apt-get install --no-install-recommends  build-essential
  1. For LLVM I tried but without success
curl -o /var/lib/apt/dazzle-marks/llvm.gpg -fsSL

Wondering if anyone has all the main prerequisites but not lots of other installs that work well together for use with Edge Impulse local or cloud installation on Linux? Perhaps @aurel ?

@Rocksetta This should work on Linux:

$ sudo apt install -y build-essential
$ bash -c "$(wget -O -"
$ cd example-standalone-inferencing
$ CC=clang CXX=clang++ make -j

The latter line could be just make -j depending on whether there already was a working gcc/g++ on the system.

1 Like

So here is what I am working on, the repository is at

and a live Gitpod will be generated using this url (You need a Github login to use Gitpod, and best to use a new browser window as it will sleep when you move between tabs)

I could not get @janjongboom suggestions above working, but by trial and error got something working. Here is the main part of my Docker

RUN apt-get update \
    && DEBIAN_FRONTEND=noninteractive  apt-get install -y --no-install-recommends build-essential gcc-arm-none-eabi make \
    && bash -c "$(wget -O -" \
        && install-packages \
        clang \
        clangd \
        clang-format \
        clang-tidy \
        gdb \
        lld  \
    && apt-get update 

and here is the main install part of the .gitpod.yml file. The homebrew is just a location already on the Environment PATH.

              cd /home/linuxbrew/.linuxbrew                                                                                 &&
              curl -fsSL | sh                       &&
              python3 -m pip install mbed-cli  west                                                                         &&
              ./                                                                                            &&

What was really helpful is Edge Impulse’s arduino-cli installation script installs the correct arm-none-eabi-gcc compiler.

So you can test the install with: (Note weird Arduino syntax no “–”)

arduino-cli version
west --version
mbed-cli --version
make --version
arm-none-eabi-gcc --version

Looks like I installed arm-none-eabi-gcc twice since PATHS are confusing using Gitpod, but as long as things work.

I will probably be breaking things for the next few weeks as I make changes. But it auto loads most of the Local build structures, so the concept is:

  1. upload the Edge Impulse to the correct compile folder and unzip it
  2. build (see bash files typically labelled “” for help on how to build)
  3. download the .bin file typically in the generated “build” folder to your flash to your board.

I will make a video when it works better. (Eta Compute presently not working)
Today, trying to add Simplicity studio command line. (I will probably break it. :grin:)

Here is an image of the important file structure

If anyone sees anything that could be improved, specifically in the Docker file that would be appreciated. For security reasons “sudo” can not be used in the live webpage, so all “sudo” installs happen in the Docker file.


With the release of the Sony Spresense Edge Impulse Github at

and my own issues getting Edge-Impulse-cli installed on my school computers (and at home) wondering if anyone else has the experience and understands the benefit of cloud dev sites like

Be interesting to get the Spresense working but I might need a bit of help.

The github is here

and loading the gitpod (needs a github login, and takes about 10 minutes to fully load, so right click and open in a new window so it can do it’s thing) link is

I already have most of the other boards loaded, with varying success. A gitpod could do all the compiling of local builds. You would still need to figure out how to install the final .bin file, so back to my issues with the edge-impulse-cli.

This post went full circle, LOL.

Anyone joining this topic, is fairly easy to understand. Since you can’t do sudo admin stuff all sudo commands are in the .gitpod.dockerfile

Mine doesn’t really do much link here

FROM gitpod/workspace-full:latest

USER root

RUN apt-get update \
    && DEBIAN_FRONTEND=noninteractive  apt-get install -y --no-install-recommends build-essential gcc-arm-none-eabi make  \
    && bash -c "$(wget -O -" \
        && install-packages \
        clang \
        clangd \
        clang-format \
        clang-tidy \
        gdb \
        lld  \
    && apt-get update 

USER gitpod
RUN mkdir -p /home/gitpod/logs                                                                            \ 
    && touch /home/gitpod/logs/myDockerlog.txt                                                            \
    && echo "Installation start, made some folders in /home/gitpod" >> /home/gitpod/logs/myDockerlog.txt  \
    && echo "Installation end"                                      >> /home/gitpod/logs/myDockerlog.txt  

# Give back control
USER root

# Cleaning
RUN apt-get clean  && rm -rf /var/cache/apt/* && rm -rf /var/lib/apt/lists/* && rm -rf /tmp/*

The magic comes from the .gitpod.yml link here It does all your pip style installs: Here is mine

  file: .gitpod.dockerfile

- port: 8080

- init:       mkdir /workspace/my-gitpod-of-edge-impulse/logs                                                                    &&
              touch /workspace/my-gitpod-of-edge-impulse/logs/gitpod-install-log.txt                                             &&

              echo "Starting .gitpod.yml installation" &>>  /workspace/my-gitpod-of-edge-impulse/logs/gitpod-install-log.txt     &&
              cd /workspace/my-gitpod-of-edge-impulse/edge-impulse/local-build-firmware/portenta                             &&
              git clone                                          &&
              chmod +x                                                                               &&
              chmod +x                                                                                       &&
              chmod +x                                                                          &&
              chmod +x                                                                                      &&
              chmod +x                                                                             &&
              cp /home/linuxbrew/.linuxbrew/                                                &&            
              cd /home/linuxbrew/.linuxbrew                                                                                 &&
              curl -fsSL | sh                       &&
              python3 -m pip install mbed-cli  west  pyserial==3.4 inquirer==2.7.0                                          &&         
              cd /workspace/my-gitpod-of-edge-impulse/edge-impulse/local-build-firmware/c++                                  &&
              git clone                                    &&
              chmod +x                                                                                            &&
              cd /workspace/my-gitpod-of-edge-impulse/edge-impulse/local-build-firmware/c                                    &&
              git clone                                  &&
              chmod +x                                                                                              &&
              cd /workspace/my-gitpod-of-edge-impulse/edge-impulse/local-build-firmware/nano33bleSense                       &&
              chmod +x                                                                                           &&
              chmod +x                                                                               &&

              cd /workspace/my-gitpod-of-edge-impulse/edge-impulse/local-build-firmware/etaCompute                           &&
              git clone    eta-compile             &&         
              mv eta-compile/                                                                               &&        
              mv eta-compile/                                                                              &&         
              cd eta-compile                                                                                                 &&          
              chmod +x                                                                                      &&        
              chmod +x                                                                                     &&   
              cd /workspace/my-gitpod-of-edge-impulse/edge-impulse/local-build-firmware/siliconLabs                                   &&
              git clone   silicon-labs-compile    &&     
              mv   silicon-labs-compile/                                                                           &&
              cd silicon-labs-compile                                                                                                 &&
              mkdir ei-workspace                                                                                                      &&
              chmod +x                                                                                             &&
              cd /workspace/my-gitpod-of-edge-impulse                                                                       &&
              cd /workspace/my-gitpod-of-edge-impulse/edge-impulse/local-build-firmware/nordic                              &&
              git clone   nordic-compile                           &&     
              mv   nordic-compile/                                                                    &&
              mv   nordic-compile/                                                                    &&
              cd nordic-compile                                                                                             &&
              chmod +x                                                                                &&
              chmod +x                                                                                &&
              cd /workspace/my-gitpod-of-edge-impulse/edge-impulse/local-build-firmware/mbed                                  &&
              mbed import                                  &&
              mv   example-standalone-inferencing-mbed/                                                     &&
              cd example-standalone-inferencing-mbed                                                                          &&
              chmod +x                                                                                      &&

              cd /workspace/my-gitpod-of-edge-impulse/edge-impulse/local-build-firmware/sony-spresense                        &&
              git clone                           &&
              mv   example-standalone-inferencing-spresense/                                                 &&
              cd example-standalone-inferencing-spresense                                                                     &&
              chmod +x                                                                                       &&

              cd /workspace/my-gitpod-of-edge-impulse                                                                         && 
              ./edge-impulse/local-build-firmware/portenta/                                          &&
              git clone                                                             &&
              mkdir z-ARDUINO-LIBRARIES                                                                                       &&
              ln -s /home/gitpod/Arduino/libraries z-ARDUINO-LIBRARIES                                                        &&
              mkdir z-ARDUINO-CORES                                                                                           &&
              ln -s /home/gitpod/.arduino15/packages/arduino/hardware   z-ARDUINO-CORES                                       &&             
             arduino-cli version                                                                                              &&
             west --version                                                                                                   &&
             mbed-cli --version                                                                                               &&
             make --version                                                                                                   &&
             arm-none-eabi-gcc --version                                                                                      &&

             echo "Ending .gitpod.yml installation"  &>>   /workspace/my-gitpod-of-edge-impulse/logs/gitpod-install-log.txt
  command:   echo "Starting this docker"             &>>   /workspace/my-gitpod-of-edge-impulse/logs/gitpod-install-log.txt    &&
             cd /home/linuxbrew/.linuxbrew                                                                                     &&
             curl -fsSL | sh                           &&  
             cd /workspace/my-gitpod-of-edge-impulse                                                                           && 
             ./edge-impulse/local-build-firmware/portenta/                                            &&  
             arduino-cli version                                                                                               &&
             west --version                                                                                                    &&
             mbed-cli --version                                                                                                &&
             make --version                                                                                                    &&
             arm-none-eabi-gcc --version                                                                                       &&
             echo "Ending this docker implementation"  &>>   /workspace/my-gitpod-of-edge-impulse/logs/gitpod-install-log.txt

Just like a bash script running everything you need. The nice thing is all your students or people on a zoom meeting are then running the exact same setup and should have the exact same issues. This by far outweighs the problems with designing the

I am just stuck on the final steps of getting all these C++ programs working on all these different environments. Would be great if someone who knows, could give me some hints.

The github link is

The Gitpod active link is

It is not very userfriendly yet as I don’t know how to run the C++ code.

1 Like