.\" Man page generated from reStructuredText. . .TH "BSON_INSTALLING" "3" "May 01, 2018" "1.9.5" "Libbson" .SH NAME bson_installing \- Installing libbson . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .sp The following guide will step you through the process of downloading, building, and installing the current release of libbson. .SH SUPPORTED PLATFORMS .sp The MongoDB C Driver is \fI\%continuously tested\fP on variety of platforms including: .INDENT 0.0 .IP \(bu 2 Archlinux .IP \(bu 2 Debian 8.1 .IP \(bu 2 macOS 10.10 .IP \(bu 2 Microsoft Windows Server 2008 .IP \(bu 2 RHEL 5.5, 6.2, 7.0, 7.1, 7.2 .IP \(bu 2 Ubuntu 12.04, 16.04 .IP \(bu 2 Clang 3.5, 3.7, 3.8 .IP \(bu 2 GCC 4.6, 4.8, 4.9, 5.3 .IP \(bu 2 MinGW\-W64 .IP \(bu 2 Visual Studio 2010, 2013, 2015 .IP \(bu 2 x86, x86_64, ARM (aarch64), Power8 (ppc64le), zSeries (s390x) .UNINDENT .SH INSTALL WITH A PACKAGE MANAGER .sp The libbson package is available on recent versions of Debian and Ubuntu. .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C $ apt\-get install libbson\-1.0 .ft P .fi .UNINDENT .UNINDENT .sp On Fedora, a libbson package is available in the default repositories and can be installed with: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C $ dnf install libbson .ft P .fi .UNINDENT .UNINDENT .sp On recent Red Hat systems, such as CentOS and RHEL 7, a libbson package is available in the \fI\%EPEL\fP repository. To check version available, see \fI\%https://apps.fedoraproject.org/packages/libbson\fP\&. The package can be installed with: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C $ yum install libbson .ft P .fi .UNINDENT .UNINDENT .SH BUILDING ON UNIX .SS Building from a release tarball .sp Unless you intend on contributing to libbson, you will want to build from a release tarball. .sp The most recent release of libbson is 1.9.5 and can be \fI\%downloaded here\fP\&. The following snippet will download and extract the current release of the driver. .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C $ wget \fI\%https://github.com/mongodb/libbson/releases/download/1.9.5/libbson\-1.9.5.tar.gz\fP $ tar \-xzf libbson\-1.9.5\&.tar.gz $ cd libbson\-1.9.5/ $ ./configure .ft P .fi .UNINDENT .UNINDENT .sp For a list of all configure options, run \fB\&./configure \-\-help\fP\&. .sp If \fBconfigure\fP completed successfully, you\(aqll see something like the following describing your build configuration. .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C libbson 1.9.5 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 Code coverage support : no Cross Compiling : no Big endian : no Link Time Optimization (experimental) : no Documentation: man : no HTML : no .ft P .fi .UNINDENT .UNINDENT .sp We can now build libbson with the venerable \fBmake\fP program. .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C $ make $ sudo make install .ft P .fi .UNINDENT .UNINDENT .SS Building from git .sp To build an unreleased version of libbson from git requires additional dependencies. .sp RedHat / Fedora: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C $ sudo yum install git gcc automake autoconf libtool .ft P .fi .UNINDENT .UNINDENT .sp Debian / Ubuntu: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C $ sudo apt\-get install git gcc automake autoconf libtool .ft P .fi .UNINDENT .UNINDENT .sp FreeBSD: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C $ su \-c \(aqpkg install git gcc automake autoconf libtool\(aq .ft P .fi .UNINDENT .UNINDENT .sp Once you have the dependencies installed, clone the repository and build the current master or a particular release tag: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C $ git clone https://github.com/mongodb/libbson.git $ cd libbson $ git checkout x.y.z # To build a particular release $ ./autogen.sh $ make $ sudo make install .ft P .fi .UNINDENT .UNINDENT .SS Generating the documentation .sp Install \fI\%Sphinx\fP, then: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C $ ./configure \-\-enable\-html\-docs \-\-enable\-man\-pages $ make man html .ft P .fi .UNINDENT .UNINDENT .SH BUILDING ON MAC OS X .sp Install the XCode Command Line Tools: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C $ xcode\-select \-\-install .ft P .fi .UNINDENT .UNINDENT .sp The \fBpkg\-config\fP utility is also required. First \fI\%install Homebrew according to its instructions\fP, then: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C $ brew install pkgconfig .ft P .fi .UNINDENT .UNINDENT .sp Download the latest release tarball .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C $ curl \-LO \fI\%https://github.com/mongodb/libbson/releases/download/1.9.5/libbson\-1.9.5.tar.gz\fP $ tar xzf libbson\-1.9.5\&.tar.gz $ cd libbson\-1.9.5 .ft P .fi .UNINDENT .UNINDENT .sp Build and install libbson: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C $ ./configure $ make $ sudo make install .ft P .fi .UNINDENT .UNINDENT .SH BUILDING ON WINDOWS .sp Building on Windows requires Windows Vista or newer and Visual Studio 2010 or newer. Additionally, \fBcmake\fP is required to generate Visual Studio project files. .sp Let\(aqs 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. .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C > cd libbson\-1.9.5 > cmake \-G "Visual Studio 14 2015 Win64" \e "\-DCMAKE_INSTALL_PREFIX=C:\elibbson" > msbuild.exe ALL_BUILD.vcxproj > msbuild.exe INSTALL.vcxproj .ft P .fi .UNINDENT .UNINDENT .sp You should now see libbson installed in \fBC:\elibbson\fP\&. By default, this will create a debug build of libbson. To enable release build additional argument needs to be provided to both cmake and msbuild.exe: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C > cd libbson\-1.9.5 > cmake \-G "Visual Studio 14 2015 Win64" \e "\-DCMAKE_INSTALL_PREFIX=C:\elibbson" \e "\-DCMAKE_BUILD_TYPE=Release" > msbuild.exe /p:Configuration=Release ALL_BUILD.vcxproj > msbuild.exe /p:Configuration=Release INSTALL.vcxproj .ft P .fi .UNINDENT .UNINDENT .sp You can disable building the tests with: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C > cmake \-G "Visual Studio 14 2015 Win64" \e "\-DCMAKE_INSTALL_PREFIX=C:\elibbson" \e "\-DENABLE_TESTS:BOOL=OFF" .ft P .fi .UNINDENT .UNINDENT .SH AUTHOR MongoDB, Inc .SH COPYRIGHT 2018, MongoDB, Inc .\" Generated by docutils manpage writer. .