Bond is a cross-platform framework for working with schematized data. It supports cross-language de/serialization and powerful generic mechanisms for efficiently manipulating data. Bond is broadly used at Microsoft in high scale services.
Перейти к файлу
Christopher Warrington 897fa02091 Build gbc without optimization inside Travis
We've been seeing timeouts building gbc on the Travis infrastructure.
Building without optimizations reduces the build time significantly and
shouldn't affect build or test results.

Closes https://github.com/Microsoft/bond/issues/176, "ghc 7.8.4 OS X
Travis CI builds are failing"

Closes https://github.com/Microsoft/bond/pull/195, "Build gbc without
optimization inside Travis"
2016-07-06 11:49:20 -07:00
cmake Group CMake targets into folders 2015-10-28 22:30:41 -07:00
compiler Build gbc without optimization inside Travis 2016-07-06 11:49:20 -07:00
cpp [c++] generate `noexcept` move constructors 2016-07-01 13:58:17 -07:00
cs Parameterize Transport. 2016-06-30 16:32:44 -07:00
doc Add field default checking to GBC 2016-06-22 13:10:58 -07:00
examples Merge pull request #189 from chwarr/chwarr/example-simplify 2016-07-05 15:46:51 -07:00
python Fix extra ref count on blob to PyBytes conversion 2015-11-23 06:56:09 -08:00
test/compat Add nullable/blob info to runtime SchemaDef 2016-06-14 11:26:01 -07:00
thirdparty Initial commit 2015-01-09 11:21:05 -08:00
tools/syntax Tabs to spaces 2016-01-20 12:10:56 -08:00
.gitattributes Add .gitattributes to help with newline issues 2016-04-18 16:11:57 -07:00
.gitignore Update .gitignore to exclude CMake & Emacs files 2016-01-19 20:14:37 -08:00
.gitmodules Initial commit 2015-01-09 11:21:05 -08:00
.travis.yml Work around the old wget version in Travis CI 2015-11-05 15:28:10 -08:00
CHANGELOG.md [c++] generate `noexcept` move constructors 2016-07-01 13:58:17 -07:00
CMakeLists.txt Group CMake targets into folders 2015-10-28 22:30:41 -07:00
CONTRIBUTING.md Add Code of Conduct info to CONTRIBUTING.md 2016-06-21 12:41:34 -07:00
LICENSE Initial commit 2015-01-09 11:21:05 -08:00
README.md Add Code of Conduct info to CONTRIBUTING.md 2016-06-21 12:41:34 -07:00
appveyor.yml Disable Comm unit tests in AppVeyor build 2016-06-01 19:37:48 -07:00

README.md

Build Status Bond.CSharp NuGet package

Bond

Bond is an open source, cross-platform framework for working with schematized data. It supports cross-language serialization/deserialization and powerful generic mechanisms for efficiently manipulating data. Bond is broadly used at Microsoft in high scale services.

We are also introducing the Bond Communications framework--known as Bond Comm--which allows for remote process communication. Currently, we are making the C# version of this framework available; the C++ version will be released in the coming weeks. This framework is based on is the successor to an internal framework that is used by several large services inside Microsoft. Bond Comm is undergoing active evolution at this time and so we are marking the initial release as version 0.5. Consult the C# manual for more details on Bond Comm's usage and capabilities.

Bond is published on GitHub at https://github.com/Microsoft/bond/.

For details, see the User's Manuals for C++, C# and Python, and the documentation of the compiler tool and library.

For a discussion how Bond compares to similar frameworks see Why Bond.

Dependencies

The Bond repository uses Git submodules and should be cloned with the --recursive flag:

git clone --recursive https://github.com/Microsoft/bond.git

In order to build Bond you will need CMake (2.8.12+), Haskell (ghc 7.4+ and cabal-install 1.18+) and Boost (1.54+). The core Bond C++ library can be used with C++03 compilers, although Python support, unit tests and various examples require some C++11 features.

Following are specific instructions for building on various platforms.

Linux

Bond can be built with Clang (3.4+) or GNU C++ (4.7+). We recommend the latest version of Clang as it's much faster with template-heavy code like Bond.

Run the following commands to install the minimal set of packages needed to build the core Bond library on Ubuntu 14.04:

sudo apt-get install \
    clang \
    cmake \
    zlib1g-dev \
    ghc \
    cabal-install \
    libboost-dev \
    libboost-thread-dev

cabal update
cabal install cabal-install

In the root bond directory run:

mkdir build
cd build
cmake ..
make
sudo make install

The build directory is just an example. Any directory can be used as the build destination.

In order to build all the C++ and Python tests and examples, a few more packages are needed:

sudo apt-get install \
    python2.7-dev \
    libboost-date-time-dev \
    libboost-test-dev \
    libboost-python-dev

cabal install happy

Running the following command in the build directory will build and execute all the tests and examples:

make --jobs 8 check

(The unit tests are large so you may want to run 4-8 build jobs in parallel, assuming you have enough memory.)

OS X

Install Xcode and then run the following command to install the required packages using Homebrew (http://brew.sh/):

brew install \
    cmake \
    ghc \
    cabal-install \
    boost \
    boost-python

(boost-python is optional and only needed for Python support.)

Update the cabal package database and install happy (only needed for tests):

cabal update
cabal install happy

Bond can be built on OS X using either standard *nix makefiles or Xcode. In order to generate and build from makefiles, in the root bond directory run:

mkdir build
cd build
cmake ..
make
sudo make install

Alternatively, you can generate Xcode projects by passing the -G Xcode option to cmake:

cmake -G Xcode ..

You can build and run unit tests by building the check target in Xcode or by running make in the build directory:

make --jobs 8 check

Note that if you are using Homebrew's Python, you'll need to build boost-python from source:

brew install --build-from-source boost-python

and tell cmake the location of Homebrew's libpython by setting the PYTHON_LIBRARY variable, e.g.:

cmake .. \
    -DPYTHON_LIBRARY=/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/libpython2.7.dylib

Windows

Build Status

Install the following tools:

If you are building on a network behind a proxy, set the environment variable HTTP_PROXY, e.g.:

set HTTP_PROXY=http://your-proxy-name:80

Update the cabal package database:

cabal update

Now you are ready to build the C# version of Bond. Open the solution file cs\cs.sln in Visual Studio and build as usual. The C# unit tests can also be run from within the solution.

The C++ and Python versions of Bond additionally require:

You may need to set the environment variables BOOST_ROOT and BOOST_LIBRARYDIR to specify where Boost and its pre-built libraries for your environment can be found, e.g.:

set BOOST_ROOT=D:\boost_1_57_0
set BOOST_LIBRARYDIR=D:\boost_1_57_0\lib64-msvc-12.0

The core Bond library and most examples only require Boost headers. The pre-built libraries are only needed for unit tests and Python support. If Boost or Python libraries are not found on the system, then some tests and examples will not be built.

In order to generate a solution to build the C++ and Python versions with Visual Studio 2013 run the following commands from the root bond directory:

mkdir build
cd build
cmake -G "Visual Studio 12 2013 Win64" ..

Instead of cmake you can also use cmake-gui and specify configuration settings in the UI. This configuration step has to be performed only once. From then on you can use the generated solution build\bond.sln from Visual Studio or build from command line using cmake:

set PreferredToolArchitecture=x64
cmake --build . --target
cmake --build . --target INSTALL

In order to build and execute the unit tests and examples run:

cmake --build . --target check -- /maxcpucount:8

Setting PreferredToolArchitecture=x64 selects the 64-bit toolchain which dramatically improves build speed. (The Bond unit tests are too big to build with 32-bit tools.) This variable works for Visual Studio 2013 or 2015. For Visual Studio 2012 set the following environment variable instead:

set _IsNativeEnvironment=true

Contributing

Interested in contributing to Bond? Take a look at our contribution guidelines to get started.