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 google-cloud googleapis-common-protos grpc protobuf pycryptodomex
sudo cpan -i Text::Template

GNU Autotools

OpenWeave depends on GNU Autotools for its build system. A version of GNU Autotools must be available to successfully build OpenWeave. To use the system-provided version of autotools on Linux:

sudo apt-get install libtool autoconf automake

For systems where the GNU Autotools are not readily available or installable (for example, Mac OS) or on systems where the system-provided version does not provide a solid out-of-box build generation, Nest Labs has created a customized, turnkey build system framework, based on GNU Autotools. The system pins the set of programs used in build generation to a known good version. Pinning the tools to a particular version also ensures relatively low churn in the output of autotools thus leading to predictable developer and support experience. The Nest Labs build of GNU Autotools is recommended for use with OpenWeave.

To build Nest Labs GNU Autotools:

git clone https://github.com/openweave/openweave-core.git
cd openweave-core
make -C third_party/nlbuild-autotools/repo/ tools

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
    ./bootstrap
    ./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:

  • /usr/local/include — public headers
  • /usr/local/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

Before configuring OpenWeave with various scripts and headers, use the autotools to bootstrap the relevant build files:

./bootstrap

This step needs to be performed once, after a tree checkout, and subsequently on any changes to configure.ac or Makefile.am. It does not need to be repeated when simply changing build configurations or targets.

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