<commit_before>---
title: Compiling Heron
---

Heron is currently available for Mac OS X 10.10, Ubuntu 12.04, and CentOS 5.

Heron can be built either [in it's entirety]({{< ref "#building-all-components" >}}), as
[individual components]({{< ref "#building-specific-components" >}}), or as a [release
package]({{< ref "#building-a-full-release-package" >}}).

Instructions on running unit tests for Heron can also be found in [Testing Heron](../../../contributors/testing).

## Requirements

You must have the following installed to compile Heron:

* [Bazel](http://bazel.io/docs/install.html) = {{% bazelVersion %}}. Later versions
  might work but have not been tested. See [Installing Bazel]({{< ref "#installing-bazel" >}}).
* [Java
  8](http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html)
  is required by Bazel but Heron does not use Java 8 features;
  [topologies](../../../concepts/topologies) can be written in Java 7 or above and all
  Heron jars are compatible with Java 7.
* [Autoconf](http://www.gnu.org/software/autoconf/autoconf.html) >=
  2.6.3
* [Automake](https://www.gnu.org/software/automake/) >= 1.11.1
* [GNU Make](https://www.gnu.org/software/make/) >= 3.81
* [GNU Libtool](http://www.gnu.org/software/libtool/) >= 2.4.6
* [gcc/g++](https://gcc.gnu.org/) >= 4.8.2 (Linux platforms)
* [CMake](https://cmake.org/) >= 2.6-patch 4
* [Python](https://www.python.org/) >= 2.7 (not including Python 3.x)
* [Perl](https://www.perl.org/) >= 5.8.8

Export CC and CXX variables with path specific to your machine:

```bash
$ export CC=/your-path-to/bin/clang
$ export CXX=/your-path-to/bin/clang++
$ echo $CC $CXX
```

Example path for Mac OS X:
```bash
$ export CC=/usr/bin/clang
$ export CXX=/usr/bin/clang++
$ echo $CC $CXX
```

## Installing Bazel

Heron uses the [Bazel](http://bazel.io) build tool. Bazel releases can be found
[here](https://github.com/bazelbuild/bazel/releases/tag/{{% bazelVersion %}})
and installation instructions can be found [here](http://bazel.io/docs/install.html).

To ensure that Bazel has been installed, run `bazel version` and check the
version (listed next to `Build label` in the script's output) to ensure that you
have Bazel {{% bazelVersion %}}.

## Configuring Bazel

There is a Python script that you can run to configure Bazel on supported
platforms:

```bash
$ cd /path/to/heron
$ ./bazel_configure.py
```

## Building

### Bazel OS Environments

Bazel builds are specific to a given OS. When building you must specify an
OS-specific configuration using the `--config` flag. The following OS values
are supported:

* `darwin` (Mac OS X)
* `ubuntu` (Ubuntu 12.04)
* `centos5` (CentOS 5)

Here's an example build command:

```bash
$ bazel build --config=darwin heron/...
```

### Building All Components

The bazel build process can produce either executable install scripts, or
bundled tars. To build executables or tars for all Heron components at once,
use the following `bazel build` commands, respectively.

```bash
$ bazel build --config=darwin scripts/packages:binpkgs
$ bazel build --config=darwin scripts/packages:tarpkgs
```

Resulting artifacts can be found in subdirectories below the `bazel-bin`
directory. The `heron-tracker` executable, for example, can be found at
`bazel-bin/heron/tracker/src/python/heron-tracker`.

### Building Specific Components<commit_msg>clean up<commit_after>---
title: Compiling Heron
---

Heron is currently available for Mac OS X 10.10, Ubuntu 12.04, and CentOS 5.

Heron can be built either [in it's entirety]({{< ref "#building-all-components" >}}), as
[individual components]({{< ref "#building-specific-components" >}}), or as a [release
package]({{< ref "#building-a-full-release-package" >}}).

Instructions on running unit tests for Heron can also be found in [Testing Heron](../../../contributors/testing).

## Requirements

You must have the following installed to compile Heron:

* [Bazel](http://bazel.io/docs/install.html) = {{% bazelVersion %}}. Later versions
  might work but have not been tested. See [Installing Bazel]({{< ref "#installing-bazel" >}}).
* [Java
  8](http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html)
  is required by Bazel but Heron does not use Java 8 features;
  [topologies](../../../concepts/topologies) can be written in Java 7 or above and all
  Heron jars are compatible with Java 7.
* [Autoconf](http://www.gnu.org/software/autoconf/autoconf.html) >=
  2.6.3
* [Automake](https://www.gnu.org/software/automake/) >= 1.11.1
* [GNU Make](https://www.gnu.org/software/make/) >= 3.81
* [GNU Libtool](http://www.gnu.org/software/libtool/) >= 2.4.6
* [gcc/g++](https://gcc.gnu.org/) >= 4.8.2 (Linux platforms)
* [CMake](https://cmake.org/) >= 2.6-patch 4
* [Python](https://www.python.org/) >= 2.7 (not including Python 3.x)
* [Perl](https://www.perl.org/) >= 5.8.8

Export CC and CXX variables with path specific to your machine:

```bash
$ export CC=/your-path-to/bin/clang
$ export CXX=/your-path-to/bin/clang++
$ echo $CC $CXX
```

Example path for Mac OS X:
```bash
$ export CC=/usr/bin/clang
$ export CXX=/usr/bin/clang++
$ echo $CC $CXX
```

## Installing Bazel

Heron uses the [Bazel](http://bazel.io) build tool. Bazel releases can be found
[here](https://github.com/bazelbuild/bazel/releases/tag/{{% bazelVersion %}})
and installation instructions can be found [here](http://bazel.io/docs/install.html).

To ensure that Bazel has been installed, run `bazel version` and check the
version (listed next to `Build label` in the script's output) to ensure that you
have Bazel {{% bazelVersion %}}.

## Configuring Bazel

There is a Python script that you can run to configure Bazel on supported
platforms:

```bash
$ cd /path/to/heron
$ ./bazel_configure.py
```

## Building

### Bazel OS Environments

Bazel builds are specific to a given OS. When building you must specify an
OS-specific configuration using the `--config` flag. The following OS values
are supported:

* `darwin` (Mac OS X)
* `ubuntu` (Ubuntu 12.04)
* `centos5` (CentOS 5)

For example the following command will build all packages:

```bash
$ bazel build --config=darwin heron/...
```

### Building All Components

The bazel build process can produce either executable install scripts, or
bundled tars. To build executables or tars for all Heron components at once,
use the following `bazel build` commands, respectively.

```bash
$ bazel build --config=darwin scripts/packages:binpkgs
$ bazel build --config=darwin scripts/packages:tarpkgs
```

Resulting artifacts can be found in subdirectories below the `bazel-bin`
directory. The `heron-tracker` executable, for example, can be found at
`bazel-bin/heron/tracker/src/python/heron-tracker`.

### Building Specific Components
{'fraction_non_alphanumeric': 0.14941507478157856, 'fraction_numerical': 0.015400562712868354, 'mean_word_length': 4.163608562691132, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 27, 'https://': 14, 'lorem ipsum': 0, 'www.': 14, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3518004', 'n_tokens_mistral': 2420, 'n_tokens_neox': 2214, 'n_words': 724}