Build OpenWeave

The primary supported toolchain for building OpenWeave is GNU Autotools.

System requirements

All major OS platforms support building and cross-compilation of OpenWeave. Listed toolchains have been officially tested by Nest.

Linux

Requirements: Ubuntu 14.04 (Trusty) is officially supported, but any similar Linux-based system should work.
C/C++, Java, Python bindings
Toolchains gcc 4.6.3
Targets i386-unknown-linux-gnu
x86_64-unknown-linux-gnu
C/C++, Java bindings
Toolchains gcc 4.6
Targets arm-unknown-linux-android
armv7-unknown-linux-android
i386-unknown-linux-android

Mac OS X

Requirements: XQuartz for cloning one directory subtree to another with symbolic links.
C/C++, Cocoa bindings
Targets armv7-apple-darwin-ios
armv7s-apple-darwin-ios
i386-apple-darwin-ios
C/C++, Python bindings
Toolchains LLVM/clang 3.5 (6.0)
Targets i386-apple-darwin-macosx
x86_64-apple-darwin-macosx

Windows

Requirements: Cygwin for Linux command line support.
C/C++ bindings
Toolchains gcc 4.8.3
Targets i686-pc-cygwin

Embedded

C/C++ bindings
Toolchains gcc 4.4.1
LLVM/clang 3.1
LLVM/clang 3.3
Targets arm*-unknown-linux*
arm*-unknown-freertos-lwip

Prerequisites

In addition to a supported toolchain, we recommend installing the following packages and tools before building OpenWeave.

Packages

Linux:

sudo apt-get install python-pip python-setuptools bridge-utils /
               libglib2.0-dev libdbus-1-dev libudev-dev /
               libical-dev libreadline-dev

Linux and Mac OS X:

pip install --user grpc
pip install --user google-cloud
pip install --user protobuf
sudo cpan -i Text::Template

Happy

To run the test scripts included in OpenWeave, or to use Weave in simulated topologies, install Happy on your Linux machine. See Happy setup for more information.

Standalone application

Use the default OpenWeave Standalone application for a desktop or server development host.

  1. Clone the OpenWeave repository:
    git clone https://github.com/openweave/openweave-core.git
  2. Build the OpenWeave Standalone application:
    cd openweave-core
    make -f Makefile-Standalone

Use the help flag with Makefile-Standalone to learn what build switches are available for build customization.

make -f Makefile-Standalone help

For example, to enable Weave debug code and logging:

make -f Makefile-Standalone DEBUG=1

Project linking

  1. Clone the OpenWeave repository:
    git clone https://github.com/openweave/openweave-core.git
  2. Configure the build environment for GNU Autotools:
    cd openweave-core
    ./configure
  3. Build OpenWeave:
    make all
  4. Stage the output to a separate location for project linking:
    mkdir <openweave-output>
    make DESTDIR=<openweave-output> install

After staging, use the directories under <openweave-output> for project linking:

  • /include — public headers
  • /<target-tuple>/lib — libraries

Android and iOS

To build libraries for Android and iOS project linking, use the platform-specific Makefiles:

make -f Makefile-Android
make -f Makefile-iOS

Use the help flag with Makefile-<platform> to learn what build switches are available for build customization. For example:

make -f Makefile-Android help
make -f Makefile-iOS help

Configuration

OpenWeave builds may be customized using configuration scripts and headers.

Scripts

Use the --help flag with the included configuration script to learn more about configurable options.

./configure --help

For example, to configure OpenWeave without BlueZ support:

./configure --without-bluez

Headers

The included Makefiles use two header files that define constants at compile-time:

Project-specific configuration headers may also be provided. Place these files in your project directory—do not place them within the OpenWeave repository. Use the appropriate configuration option to specify each file's location during configuration:

Header file Configuration option
InetProjectConfig.h --with-weave-inet-project-includes=<directory>
WeaveProjectConfig.h --with-weave-project-includes=<directory>

For example, to configure OpenWeave to use a project-specific WeaveProjectConfig.h file located in ~/my-project/headers:

./configure --with-weave-project-includes=~/my-project/headers