| 1 |
Installation instructions |
| 2 |
========================= |
| 3 |
|
| 4 |
The Avro library is written in ANSI C. It uses CMake [1] as its build |
| 5 |
manager. |
| 6 |
|
| 7 |
[1] http://www.cmake.org/ |
| 8 |
|
| 9 |
|
| 10 |
Prerequisites |
| 11 |
------------- |
| 12 |
|
| 13 |
Avro uses CMake [1] as its build manager. You must have this installed, |
| 14 |
along with a C compiler (such as gcc) to build the library. |
| 15 |
|
| 16 |
Avro depends on the Jansson JSON parser [2], version 2.3 or higher. On |
| 17 |
many operating systems this library is available through your package |
| 18 |
manager (for example, `apt-get install libjansson-dev` on Ubuntu/Debian, |
| 19 |
and `brew install jansson` on Mac OS). If not, please download and |
| 20 |
install it from source [2]. |
| 21 |
|
| 22 |
To build the documentation you need asciidoc [3] and source-highlight [4] |
| 23 |
installed. The build scripts will automatically detect whether these |
| 24 |
tools are installed, and will skip the documentation if they're not. |
| 25 |
|
| 26 |
[1] http://www.cmake.org/ |
| 27 |
[2] http://www.digip.org/jansson/ |
| 28 |
[3] http://www.methods.co.nz/asciidoc |
| 29 |
[4] http://www.gnu.org/software/src-highlite/ |
| 30 |
|
| 31 |
|
| 32 |
Building from source |
| 33 |
-------------------- |
| 34 |
|
| 35 |
The Avro C library uses CMake as its build manager. In most cases, you |
| 36 |
should be able to build the source code by running the following: |
| 37 |
|
| 38 |
$ mkdir build |
| 39 |
$ cd build |
| 40 |
$ cmake .. \ |
| 41 |
-DCMAKE_INSTALL_PREFIX=$PREFIX \ |
| 42 |
-DCMAKE_BUILD_TYPE=RelWithDebInfo |
| 43 |
$ make |
| 44 |
$ make test |
| 45 |
$ make install |
| 46 |
|
| 47 |
You might have to run the last command using sudo, if you need |
| 48 |
administrative privileges to write to the $PREFIX directory. |
| 49 |
|
| 50 |
The "RelWithDebInfo" build type will build an optimized copy of the |
| 51 |
library, including debugging symbols. Use the "Release" build type if |
| 52 |
you don't want debugging symbols. Use the "Debug" build type if you |
| 53 |
want a non-optimized library, with debugging symbols. |
| 54 |
|
| 55 |
On Mac OS X, you can build a universal binary by setting the |
| 56 |
CMAKE_OSX_ARCHITECTURES option when running cmake. Just add something |
| 57 |
like the following: |
| 58 |
|
| 59 |
-DCMAKE_OSX_ARCHITECTURES=i386;x86_64 |
| 60 |
|
| 61 |
to the cmake command given above. The set of architectures that you can |
| 62 |
choose from differs depending on which version of OS X you're running; |
| 63 |
common possibilities include "i386", "x86_64", "ppc", and "ppc64". |
| 64 |
|
| 65 |
On Unix, you can request thread-safe versions of the Avro library's |
| 66 |
global functions by defining the THREADSAFE cmake variable. Just add |
| 67 |
the following to your cmake invokation: |
| 68 |
|
| 69 |
-DTHREADSAFE=true |