The following guide will step you through the process of downloading, building, and installing the current release of the Libbson.
Libbson currently supports the following operating systems and CPU architectures.
|
|
|
The following instructions are for UNIX-like systems such as GNU/Linux, FreeBSD, and Solaris. To build on Windows, see the instructions for Building on Windows.
The most recent release of the libbson is 1.1.1 and can be downloaded here. The following snippet will download and extract the current release of the driver.
Minimal dependencies are needed to build Libbson. On UNIX-like systems, pthreads (the POSIX threading library) is required.
Make sure you have access to a supported toolchain such as GCC, Clang, SolarisStudio, or MinGW. Optionally, pkg-config
can be used if your system supports it to simplify locating proper compiler and linker arguments when compiling your program.
The following will configure for a typical 64-bit Linux system such as RedHat Enterprise Linux 6 or CentOS 6. Note that not all systems place 64-bit libraries in /usr/lib64
. Check your system to see what the convention is if you are building 64-bit versions of the library.
If configure
completed successfully, you'll see something like the following describing your build configuration.
We can now build libbson with the venerable make
program.
You can optionally build code objects in parallel using the -j
option to GNU make. Some implementations of make
do not support this option, such as Sun's make on Solaris 10. To build in parallel on an 8 core machine, you might use:
To install the driver, we use make
with the install
target.
On systems that do not support the sudo
command, we can use su -c 'make install'
.
Building on Windows requires Windows Vista or newer and Visual Studio 2010 or newer. Additionally, cmake
is required to generate Visual Studio project files.
Let's start by generating Visual Studio project files for libbson. The following assumes we are compiling for 64-bit Windows using Visual Studio 2010 Express which can be freely downloaded from Microsoft.
You should now see libbson installed in C:\libbson