HowTo (Mac) - Build
This page assumes that you have successfully completed the Install
The notes below are based on the
from the Nerves Project
's Getting Started
In this variation, we'll do the build on
(a MacBook Air),
using a Raspberry Pi
2B as the target.
Our goal, in this step, is to build a system image
for the target,
including copies of Linux, Erlang, Elixir, Nerves, and the application code.
We start by asking Mix
to create a new Nerves project:
$ mix nerves.new hello_nerves_spot --target rpi2
* creating hello_nerves_spot/config/config.exs
After entering the directory,
we ask Mix to ensure that we have local copies of our dependencies.
Note that these will include some that are specific to the target.
$ cd hello_nerves_spot
$ mix local.hex
* creating /Users/rdm/.mix/archives/hex-0.12.1
$ mix deps.get
Now, we bring in a copy of Rebar3
, "an Erlang
tool that makes it easy
to create, develop, and release Erlang libraries, applications, and systems in a repeatable manner".
$ mix local.rebar
Finally (whew!), we can try to compile the project.
When doing this, I encountered several warnings.
The one about
isn't a Nerves issue,
so I filed it with the appropriate folks.
The other bugs (I am told) will disappear Real Soon Now:
$ mix compile
Compiling 1 file (.ex)
Generated hello_nerves_spot app
As a sanity check, let's examine the results of the build:
$ NERVES_DEBUG=1 mix compile
Nerves Env loaded
Looks good; let's create a system image for the target's firmware:
$ mix firmware
Building release with MIX_ENV=dev.
We now have an system image; our next step is to Upload
This wiki page is maintained by Rich Morin
an independent consultant specializing in software design, development, and documentation.
Please feel free to email
comments, inquiries, suggestions, etc!