You are here:
(16 Jul 2016,
<noautolink> ---+!! HowTo (Mac) - Install %TOC% ---++ Introduction The [[%NP%][Nerves]] build environment relies on a number of other components. For best results, these should be installed in layers, e.g: * [[%WP_OSX%][Mac OS X]] - operating system * [[%WP_XC%][Xcode]] - development tools * [[http://brew.sh][Homebrew]] - package management * [[%Erlang%][Erlang]] - programming language, VM * [[%ELO%][Elixir]] - programming language * [[%GH_FWUP%][fwup]] - firmware uploader * miscellany - =coreutils=, =squashfs= * [[%NP%][Nerves]] - build environment * your Nerves application(s) For best results, be sure that you have at least the following versions installed: * Elixir 1.3.2 * Erlang 19.0.2 * Xcode 7.2.1 *Note:* Much of this material is adapted from the [[%NP%][Nerves Project]]'s [[%NI%][Installation]] page. ---++ Xcode Xcode provides a [[%WP_GUI%][GUI]]-based [[%WP_IDE%][IDE]] which has no particular relevance to Nerves. However, it also provides assorted command-line utilities and libraries which you will need. If you are running a current version of OSX, you should probably install Xcode from the [[%MAS%][Mac App Store]]. If not, things get a bit trickier. I haven't used the [[%XI%][xcode-install]] gem, but it looks quite promising. Alternatively, after becoming a member in the [[%DAC_P%][Apple Developer Program]] (the free level is fine), you can get Xcode from the [[%DAC_DM%][Downloads / More]] page. For example, I'm using Xcode 7.2.1 on Yosemite (OSX 10.10.5). ---++ Homebrew <blockquote> What Does Homebrew Do? Homebrew installs the stuff you need that Apple didn’t. -- [[http://brew.sh][Homebrew]] </blockquote> Homebrew (aka brew) is a package management tool for Mac OS X. We'll be using it to install most of the basic infrastructure that Nerves requires (e.g., Erlang, Elixir). First, we need to make sure that we have the latest version of Homebrew and its database of package version information: <verbatim> $ brew update Updated Homebrew from bd4e24a to b512834. ... </verbatim> ---++ Erlang Install the latest versions of Erlang and Elixir, create symbolic links to the executables, etc: <verbatim> $ brew unlink erlang elixir $ brew install erlang elixir $ brew link erlang elixir ... </verbatim> Confirm that the current versions are found and executed. <verbatim> $ elixir --version Erlang/OTP 19 [erts-8.0.1] ... Elixir 1.3.2 </verbatim> ---++ Miscellany The [[%GH_FWUP%][fwup]] utility is a configurable, image-based, firmware update utility for embedded Linux-based systems. When finalizing firmware and creating a root filesystem for your target, Nerves utilizes scripts and utilities which have dependencies on =coreutils= and =squashfs=. <verbatim> $ brew unlink fwup coreutils squashfs $ brew install fwup coreutils squashfs $ brew link fwup coreutils squashfs ... </verbatim> ---++ Bootstrap Add the =nerves_bootstrap.ez= archive to your [[%Mix%][Mix]] environment. This allows [[%NP%][Nerves]] to bootstrap the environment, ensuring that your code uses the right cross-compiler for the target. <verbatim> nb_ez=https://github.com/nerves-project/archives/raw/master/nerves_bootstrap.ez $ mix archive.install $nb_ez ... * creating /Users/rdm/.mix/archives/nerves_bootstrap </verbatim> We have now installed everything we need to build a Nerves system image. So, let's move on to the [[H2MB][Build]] step. <!-- * Set DAC = https://developer.apple.com * Set DAC_DM = %DAC%/download/more * Set DAC_P = %DAC%/programs * Set ELO = http://elixir-lang.org * Set Erlang = https://www.erlang.org * Set GH = https://github.com * Set GH_FWUP = %GH%/fhunleth/fwup#installing * Set GH_HV = %GH%/Homebrew/homebrew-versions#homebrew-versions * Set MAS = https://itunes.apple.com/us/app/xcode/id497799835?mt=12 * Set Mix = %ELO%/getting-started/mix-otp/introduction-to-mix.html * Set NI = https://hexdocs.pm/nerves/installation.html * Set NP = http://nerves-project.org * Set WP_GUI = %WP%/Graphical_user_interface * Set WP_IDE = %WP%/Integrated_development_environment * Set WP_OSX = %WP%/OS_X * Set WP_XC = %WP%/Xcode * Set XI = https://rubygems.org/gems/xcode-install --> %ZB%
ore topic actions
Topic revision: r8 - 16 Jul 2016,
Copyright © by the contributing authors. All material on this wiki is the property of the contributing authors.
, Plugin API version
Ideas, requests, problems regarding CFCL Wiki?
Send us email