.\" This manpage is Copyright (C) 2016 MongoDB, Inc. .\" .\" Permission is granted to copy, distribute and/or modify this document .\" under the terms of the GNU Free Documentation License, Version 1.3 .\" or any later version published by the Free Software Foundation; .\" with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. .\" A copy of the license is included in the section entitled "GNU .\" Free Documentation License". .\" .TH "INSTALLING_LIBBSON" "3" "2016\(hy10\(hy12" "libbson" .SH NAME Installing_Libbson \- None .SH "SUPPORTED PLATFORMS" Libbson is continuously tested on GNU/Linux, Windows 7, Mac OS X 10.10, and Solaris 11 (Intel and Sparc), with GCC, Clang, and Visual Studio 2010, 2013, and 2015. The library supports the following operating systems and CPU architectures: .TP .B .LP .TP .B .IP \[bu] 2 GNU/Linux .IP \[bu] 2 Solaris 11 .IP \[bu] 2 Mac OS X 10.6 and newer .IP \[bu] 2 Windows Vista, 7, and 8 .IP \[bu] 2 FreeBSD .IP \[bu] 2 x86 and x86_64 .IP \[bu] 2 ARM .IP \[bu] 2 PPC .IP \[bu] 2 SPARC .IP \[bu] 2 GCC 4.1 and newer .IP \[bu] 2 Clang 3.3 and newer .IP \[bu] 2 Microsoft Visual Studio 2010 and newer .IP \[bu] 2 .B Oracle Solaris Studio 12 .IP \[bu] 2 MinGW .LP .SH "INSTALL WITH A PACKAGE MANAGER" The libbson package is available on recent versions of Debian and Ubuntu. .B $ .B apt-get install libbson-1.0 For RedHat\(hylike systems, use Remi Collet's well\(hymaintained RPMs for libbson. Commands to enable Remi's repository and install libbson depend on your exact system. For example, on CentOS 6: .B $ .B yum install http://rpms.remirepo.net/enterprise/remi-release-6.rpm .B $ .B yum install yum-utils .B $ .B yum-config-manager --enable remi .B $ .B yum update .B $ .B yum install libbson The .B Configuration Wizard for Remi's RPM Repository generates detailed instructions for your system. .SH "INSTALLING FROM SOURCE" The following instructions are for UNIX\(hylike systems such as GNU/Linux, FreeBSD, and Solaris. To build on Windows, see the instructions for .B Building on Windows . The most recent release of libbson is 1.4.2 and can be .B downloaded here . The following snippet will download and extract the current release of the driver. .B $ .B wget https://github.com/mongodb/libbson/releases/download/1.4.2/libbson-1.4.2.tar.gz .B $ .B tar -xzf libbson-1.4.2.tar.gz .B $ .B cd libbson-1.4.2/ Minimal dependencies are needed to build Libbson. On UNIX\(hylike systems, pthreads (the POSIX threading library) is required. Make sure you have access to a .B supported toolchain such as GCC, Clang, SolarisStudio, or MinGW. Optionally, .B 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\(hybit Linux system such as RedHat Enterprise Linux 6 or CentOS 6. Note that not all systems place 64\(hybit libraries in .B /usr/lib64 . Check your system to see what the convention is if you are building 64\(hybit versions of the library. .B $ .B ./configure --prefix=/usr --libdir=/usr/lib64 If .B configure completed successfully, you'll see something like the following describing your build configuration. .nf libbson was configured with the following options: Build configuration: Enable debugging (slow) : no Enable extra alignment (required for 1.0 ABI) : no Compile with debug symbols (slow) : no Enable GCC build optimization : yes Enable automatic binary hardening : yes Code coverage support : no Cross Compiling : no Big endian : no Link Time Optimization (experimental) : no Documentation: man : yes HTML : no .fi We can now build libbson with the venerable .B make program. .B $ .B make .B NOTE .RS You can optionally build code objects in parallel using the .B -j option to GNU make. Some implementations of .B 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: .B $ .B gmake -j8 .RE To install the driver, we use .B make with the .B install target. .B $ .B sudo make install .B NOTE .RS On systems that do not support the .B sudo command, we can use .B su -c 'make install' . .RE .SH "BUILDING ON WINDOWS" Building on Windows requires Windows Vista or newer and Visual Studio 2010 or newer. Additionally, .B 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\(hybit Windows using Visual Studio 2010 Express which can be freely downloaded from Microsoft. .B > .B cd libbson-1.4.2 .B > .B cmake -G "Visual Studio 14 2015 Win64" "-DCMAKE_INSTALL_PREFIX=C:\libbson" .B > .B msbuild.exe ALL_BUILD.vcxproj .B > .B msbuild.exe INSTALL.vcxproj You should now see libbson installed in .B C:\libbson . You can disable building the tests with: . .B > .B cmake -G "Visual Studio 14 2015 Win64" "-DCMAKE_INSTALL_PREFIX=C:\libbson" "-DENABLE_TESTS:BOOL=OFF" .B .SH COLOPHON This page is part of libbson. Please report any bugs at https://jira.mongodb.org/browse/CDRIVER.