.\" 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_THE_MONGODB_C_DRIVER" "3" "2016\(hy10\(hy12" "MongoDB C Driver" .SH NAME Installing_the_MongoDB_C_Driver \- None .SH "SUPPORTED PLATFORMS" The MongoDB C Driver is .B continuously tested on variety of platforms including: .TP .B .LP .TP .B .IP \[bu] 2 GNU/Linux .IP \[bu] 2 Solaris .IP \[bu] 2 Mac OS X .IP \[bu] 2 Microsoft Windows .IP \[bu] 2 x86 and x86_64 .IP \[bu] 2 ARM .IP \[bu] 2 PPC .IP \[bu] 2 SPARC .IP \[bu] 2 aarch64 .IP \[bu] 2 s390x .IP \[bu] 2 ppc64le .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 The driver is also known to work on FreeBSD, and should work on any POSIX compatible platform with a working c89 (or later) compiler. .SH "INSTALL WITH A PACKAGE MANAGER" The libmongoc package is available on recent versions of Debian and Ubuntu. .B $ .B apt-get install libmongoc-1.0-0 For RedHat\(hylike systems, use Remi Collet's well\(hymaintained RPMs. Commands to enable Remi's repository and install libmongoc 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 mongo-c-driver The .B Configuration Wizard for Remi's RPM Repository generates detailed instructions for your system. .SH "BUILDING ON UNIX" .SH "PREREQUISITES" OpenSSL is required for authentication or for SSL connections to MongoDB. Kerberos or LDAP support requires Cyrus SASL. To install all optional dependencies on RedHat / Fedora: On Debian / Ubuntu: On FreeBSD: .SH "BUILDING FROM A RELEASE TARBALL" Unless you intend on contributing to the mongo\(hyc\(hydriver, you will want to build from a release tarball. The most recent release of libmongoc is 1.4.2 and can be .B downloaded here . The following snippet will download and extract the driver, and configure it: If .B configure completed successfully, you'll see something like the following describing your build configuration. mongo\(hyc\(hydriver contains a copy of libbson, in case your system does not already have libbson installed. The configure script will detect if libbson is not installed and use the bundled libbson. .SH "BUILDING FROM GIT" To build an unreleased version of the driver from git requires additional dependencies. RedHat / Fedora: Debian / Ubuntu: FreeBSD: Once you have the dependencies installed, clone the repository and build the current master or a particular release tag: .SH "GENERATING THE DOCUMENTATION" Install the .B yelp-tools and .B yelp-xsl packages, then: .SH "BUILDING ON MAC OS X" .SH "PREREQUISITES" .SH "XCODE COMMAND LINE TOOLS" To install the XCode Command Line Tools, just type .B xcode-select --install in the Terminal and follow the instructions. .SH "OPENSSL SUPPORT ON EL CAPITAN" Beginning in OS X 10.11 El Capitan, OS X no longer includes the OpenSSL headers. To build the driver with SSL on El Capitan and later, first .B install Homebrew according to its instructions , then: .SH "NATIVE TLS SUPPORT ON MAC OS X / DARWIN (SECURE TRANSPORT)" The MongoDB C Driver supports the Darwin native TLS and crypto libraries. Using the native libraries there is no need to install OpenSSL. By default however, the driver will compile against OpenSSL if it detects it being available. If OpenSSL is not available, it will fallback on the native libraries. To compile against the Darwin native TLS and crypto libraries, even when OpenSSL is available, configure the driver like so: .SH "BUILDING ON OS X" Download the latest release tarball: Build and install the driver: .SH "GENERATING THE DOCUMENTATION ON OS X" Homebrew is required to generate the driver's HTML documentation and man pages: .SH "INSTALLING ON MAC OS X" To build the C Driver on a Mac, install the prerequisites in order to build it from source. It is recommended to use .B Homebrew : .B $ brew install automake autoconf libtool pkgconfig Additionally, .B XCode is required. The driver can then be installed by following the directions for .B building from source . .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, a dependency of the C driver. The following assumes we are compiling for 64\(hybit Windows using Visual Studio 2015 Express, which can be freely downloaded from Microsoft. (Run .B cmake -LH . for a list of other options.) Now that we have project files generated, we can either open the project in Visual Studio or compile from the command line. Let's build using the command line program .B msbuild.exe Now that libbson is compiled, let's install it using msbuild. It will be installed to the path specified by .B CMAKE_INSTALL_PREFIX . You should now see libbson installed in .B C:\mongo-c-driver . Now let's do the same for the MongoDB C driver. All of the MongoDB C Driver's components will now be found in .B C:\mongo-c-driver . .SH "NATIVE TLS SUPPORT ON WINDOWS (SECURE CHANNEL)" The MongoDB C Driver supports the Windows native TLS and crypto libraries. Using the native libraries there is no need to install OpenSSL. By default however, the driver will compile against OpenSSL if it detects it being available. If OpenSSL is not available, it will fallback on the native libraries. To compile against the Windows native TLS and crypto libraries, even when OpenSSL is available, configure the driver like so: .B .SH COLOPHON This page is part of MongoDB C Driver. Please report any bugs at https://jira.mongodb.org/browse/CDRIVER.