<commit_before>---
layout: default
title: yotta
section: yotta/index
---

<div class="page-header">
  <h1>yotta Documentation</h1>
</div>

# <a href="#introduction" name="introduction">#</a> Introduction
yotta is a tool that we're building at [mbed](https://mbed.org) to help
ourselves and others build better software for C-family languages by making it
easier to share and re-use software modules. It's a command line tool `yotta`,
but also a culture of building software components that do one thing well,
declare a clear interface, and can be re-used.

Get started by [installing yotta](#installing), and following [the
tutorial](/../tutorial/tutorial.html). yotta is still early in development, so
if you have questions/feedback or issues, please report them on our github
[issue tracker](https://github.com/ARMmbed/yotta/issues).


<br>
# <a href="#installing" name="installing">#</a> Installation
yotta is written in [python](https://www.python.org/download/releases/2.7/),
and distributed using
[pip](http://pip.readthedocs.org/en/latest/installing.html), the python package
manager. You will need a working installation of both python and pip to install
yotta, as well as a working development environment for compiling software, including:

 * **[CMake](http://www.cmake.org)**, the build system that yotta uses.
 * a **compiler**, to actually compile the code into working programs.

yotta supports compiling with different compilers by specifying different
[targets](../tutorial/targets.html) for the compilation, and a compilation
target may have its own specific requirements.

To install yotta, please follow the detailed installation instructions for your
operating system below:

 * [Windows](#installing-on-windows)
 * [Mac](#installing-on-osx)
 * [Linux](#installing-on-linux)

If you have a complex python setup on your system, you may want to consider
installing yotta in a [virtualenv](#virtualenv-install), in order to separate
its dependencies from other python programs on your system.

To upgrade an existing installation to a new version, see
[upgrading](#upgrading) (the same for all systems).

If you have a restrictive firewall setup, then for yotta to be fully
functional you may also need to ensure that it can access
the [required domains](/reference/registry.html#network-access).

<br>
<br>
## <a href="#installing-on-osx" name="installing-on-osx">#</a> Installing On OS X
To install yotta on OS X you can either use the packaged [yotta.app](https://github.com/ARMmbed/yotta_osx_installer/releases/latest) or install yotta and its dependencies yourself.
### <a href="#osx-yotta-app" name="osx-yotta-app">#</a> Using yotta.app
Download the latest [**OS X yotta.app**](https://github.com/ARMmbed/yotta_osx_installer/releases/latest), and drag yotta.app from the disk image into your applications folder.

When you run yotta.app, a terminal will open where you can use yotta commands.

### <a href="#osx-manual-install" name="osx-manual-install">#</a> Manual Installation
First install [homebrew](http://brew.sh), a package manager for OS X that we'll use to
install all of yotta's dependencies.

Next, tap the ARMmbed [brew
formulae](https://github.com/armmbed/homebrew-formulae), which lets brew
install packages from the mbed team:

```sh
brew tap ARMmbed/homebrew-formulae
```

Now we can install everything that yotta needs:

```sh
brew install python cmake ninja arm-none-eabi-gcc
```

And install yotta itself:

```sh
pip install yotta
```

### <a href="#osx-cross-compile" name="osx-cross-compile">#</a> Cross-compiling from OS X
To cross-compile, you need the `arm-none-eabi-gcc` cross-compiler. You can
install this using homebrew, after tapping the ARMmbed homebrew [package
repository](https://github.com/armmbed/homebrew-formulae).

```sh
brew install arm-none-eabi-gcc
```

To use this compiler, you'll need to select a supported cross-compilation
target, such as
[frdm-k64f-gcc](https://github.com/ARMmbed/target-frdm-k64f-gcc), by running
`yotta target frdm-k64f-gcc` before building.


### <a href="#osx-native-compile" name="osx-native-compile">#</a> Using Xcode's compiler to build natively for OS X
To compile things natively you need to have the Xcode command line tools
installed. Install [Xcode](https://developer.apple.com/xcode/downloads/) from
the Mac app store, then run:

```sh
xcode-select --install
```

To use this compiler to build a module, you should run `yotta target
x86-osx-native` before building. This selects the yotta target description for
the native compiler.


### <a href="#solve-osx-problems" name="solve-osx-problems">#</a> Solving Common OS X installation problems
On OS X, if you get an unknown argument error when running `pip install yotta`, it means some of yotta's dependencies have not yet been updated to support Xcode 5.1.
To fix this, install yotta by running:

```sh
ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future pip install yotta
```


<br>
<br>
## <a href="#installing-on-linux" name="installing-on-linux">#</a> Installing On Linux
### <a href="#dependencies-linux" name="dependencies-linux">#</a> Installing Dependencies
First install yotta's dependencies using your system's package manager. Use
whatever 2.7.* python version is provided by your distribution (python 3
support is currently experimental).

**on Debian and Ubuntu:**

```sh
sudo apt-get update && sudo apt-get install python-setuptools  cmake build-essential ninja-build python-dev libffi-dev libssl-dev && sudo easy_install pip
```

**and on Fedora Linux (tested on FC21):**

```sh
# install development tool dependencies
sudo yum install python-pip cmake ninja-build python-devel libffi-devel openssl-devel clang
sudo yum groupinstall "Development Tools" "Development Libraries"

# update pip to latest release
sudo yum remove python-pip
curl -o get-pip.py https://bootstrap.pypa.io/get-pip.py
sudo python get-pip.py
```

**or under cygwin (on windows)**, which presents a linux-like environment to yotta:

 * install the [windows dependencies](#installing-on-windows)
 * install the libffi-developer and openssl-developer cygwin modules as both
   binary and source
 * install python and pip in cygwin


### <a href="#yotta-itself-linux" name="yotta-itself-linux">#</a> Install yotta Itself 

After installing the dependencies, install yotta itself using pip (you may need
to use `sudo` for this, depending on your configuration):

```sh
pip install yotta
```

If you experience problems with a systemwide yotta installation on linux, you
can try installing yotta in a [virtualenv](https://virtualenv.pypa.io) by
following [these instructions](#virtualenv-install).

You can use the following commands to allow the current user to override module
dependencies using [`yotta link`](/reference/commands.html#yotta-link) without
sudo:

```bash
sudo mkdir -p /usr/local/lib/yotta_modules
sudo chown $USER /usr/local/lib/yotta_modules
chmod 755 /usr/local/lib/yotta_modules
```

### <a href="#linux-cross-compile" name="linux-cross-compile">#</a> Cross-compiling from Linux
To cross-compile yotta modules for embedded targets, you first need install the
[`arm-none-eabi-gcc` compiler](https://launchpad.net/gcc-arm-embedded).

On most Linux distributiosn, this can be done by running:<commit_msg>fix typo<commit_after>---
layout: default
title: yotta
section: yotta/index
---

<div class="page-header">
  <h1>yotta Documentation</h1>
</div>

# <a href="#introduction" name="introduction">#</a> Introduction
yotta is a tool that we're building at [mbed](https://mbed.org) to help
ourselves and others build better software for C-family languages by making it
easier to share and re-use software modules. It's a command line tool `yotta`,
but also a culture of building software components that do one thing well,
declare a clear interface, and can be re-used.

Get started by [installing yotta](#installing), and following [the
tutorial](/../tutorial/tutorial.html). yotta is still early in development, so
if you have questions/feedback or issues, please report them on our github
[issue tracker](https://github.com/ARMmbed/yotta/issues).


<br>
# <a href="#installing" name="installing">#</a> Installation
yotta is written in [python](https://www.python.org/download/releases/2.7/),
and distributed using
[pip](http://pip.readthedocs.org/en/latest/installing.html), the python package
manager. You will need a working installation of both python and pip to install
yotta, as well as a working development environment for compiling software, including:

 * **[CMake](http://www.cmake.org)**, the build system that yotta uses.
 * a **compiler**, to actually compile the code into working programs.

yotta supports compiling with different compilers by specifying different
[targets](../tutorial/targets.html) for the compilation, and a compilation
target may have its own specific requirements.

To install yotta, please follow the detailed installation instructions for your
operating system below:

 * [Windows](#installing-on-windows)
 * [Mac](#installing-on-osx)
 * [Linux](#installing-on-linux)

If you have a complex python setup on your system, you may want to consider
installing yotta in a [virtualenv](#virtualenv-install), in order to separate
its dependencies from other python programs on your system.

To upgrade an existing installation to a new version, see
[upgrading](#upgrading) (the same for all systems).

If you have a restrictive firewall setup, then for yotta to be fully
functional you may also need to ensure that it can access
the [required domains](/reference/registry.html#network-access).

<br>
<br>
## <a href="#installing-on-osx" name="installing-on-osx">#</a> Installing On OS X
To install yotta on OS X you can either use the packaged [yotta.app](https://github.com/ARMmbed/yotta_osx_installer/releases/latest) or install yotta and its dependencies yourself.
### <a href="#osx-yotta-app" name="osx-yotta-app">#</a> Using yotta.app
Download the latest [**OS X yotta.app**](https://github.com/ARMmbed/yotta_osx_installer/releases/latest), and drag yotta.app from the disk image into your applications folder.

When you run yotta.app, a terminal will open where you can use yotta commands.

### <a href="#osx-manual-install" name="osx-manual-install">#</a> Manual Installation
First install [homebrew](http://brew.sh), a package manager for OS X that we'll use to
install all of yotta's dependencies.

Next, tap the ARMmbed [brew
formulae](https://github.com/armmbed/homebrew-formulae), which lets brew
install packages from the mbed team:

```sh
brew tap ARMmbed/homebrew-formulae
```

Now we can install everything that yotta needs:

```sh
brew install python cmake ninja arm-none-eabi-gcc
```

And install yotta itself:

```sh
pip install yotta
```

### <a href="#osx-cross-compile" name="osx-cross-compile">#</a> Cross-compiling from OS X
To cross-compile, you need the `arm-none-eabi-gcc` cross-compiler. You can
install this using homebrew, after tapping the ARMmbed homebrew [package
repository](https://github.com/armmbed/homebrew-formulae).

```sh
brew install arm-none-eabi-gcc
```

To use this compiler, you'll need to select a supported cross-compilation
target, such as
[frdm-k64f-gcc](https://github.com/ARMmbed/target-frdm-k64f-gcc), by running
`yotta target frdm-k64f-gcc` before building.


### <a href="#osx-native-compile" name="osx-native-compile">#</a> Using Xcode's compiler to build natively for OS X
To compile things natively you need to have the Xcode command line tools
installed. Install [Xcode](https://developer.apple.com/xcode/downloads/) from
the Mac app store, then run:

```sh
xcode-select --install
```

To use this compiler to build a module, you should run `yotta target
x86-osx-native` before building. This selects the yotta target description for
the native compiler.


### <a href="#solve-osx-problems" name="solve-osx-problems">#</a> Solving Common OS X installation problems
On OS X, if you get an unknown argument error when running `pip install yotta`, it means some of yotta's dependencies have not yet been updated to support Xcode 5.1.
To fix this, install yotta by running:

```sh
ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future pip install yotta
```


<br>
<br>
## <a href="#installing-on-linux" name="installing-on-linux">#</a> Installing On Linux
### <a href="#dependencies-linux" name="dependencies-linux">#</a> Installing Dependencies
First install yotta's dependencies using your system's package manager. Use
whatever 2.7.* python version is provided by your distribution (python 3
support is currently experimental).

**on Debian and Ubuntu:**

```sh
sudo apt-get update && sudo apt-get install python-setuptools  cmake build-essential ninja-build python-dev libffi-dev libssl-dev && sudo easy_install pip
```

**and on Fedora Linux (tested on FC21):**

```sh
# install development tool dependencies
sudo yum install python-pip cmake ninja-build python-devel libffi-devel openssl-devel clang
sudo yum groupinstall "Development Tools" "Development Libraries"

# update pip to latest release
sudo yum remove python-pip
curl -o get-pip.py https://bootstrap.pypa.io/get-pip.py
sudo python get-pip.py
```

**or under cygwin (on windows)**, which presents a linux-like environment to yotta:

 * install the [windows dependencies](#installing-on-windows)
 * install the libffi-developer and openssl-developer cygwin modules as both
   binary and source
 * install python and pip in cygwin


### <a href="#yotta-itself-linux" name="yotta-itself-linux">#</a> Install yotta Itself 

After installing the dependencies, install yotta itself using pip (you may need
to use `sudo` for this, depending on your configuration):

```sh
pip install yotta
```

If you experience problems with a systemwide yotta installation on linux, you
can try installing yotta in a [virtualenv](https://virtualenv.pypa.io) by
following [these instructions](#virtualenv-install).

You can use the following commands to allow the current user to override module
dependencies using [`yotta link`](/reference/commands.html#yotta-link) without
sudo:

```bash
sudo mkdir -p /usr/local/lib/yotta_modules
sudo chown $USER /usr/local/lib/yotta_modules
chmod 755 /usr/local/lib/yotta_modules
```

### <a href="#linux-cross-compile" name="linux-cross-compile">#</a> Cross-compiling from Linux
To cross-compile yotta modules for embedded targets, you first need install the
[`arm-none-eabi-gcc` compiler](https://launchpad.net/gcc-arm-embedded).

On most Linux distributions, this can be done by running:
{'fraction_non_alphanumeric': 0.11188234485602364, 'fraction_numerical': 0.003023847158270909, 'mean_word_length': 4.959049959049959, 'pattern_counts': {'":': 0, '<': 69, '<?xml version=': 0, '>': 69, 'https://': 24, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 10, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '598979', 'n_tokens_mistral': 4553, 'n_tokens_neox': 4238, 'n_words': 1662}