![]() $ cmake -DENABLE_AUTOMATIC_INIT_AND_CLEANUP=OFF -DENABLE_MONGOC=OFF. The configuration will detect if libbson is not installed and use the bundled libbson.Īdditionally, it is possible to build only libbson by setting the -DENABLE_MONGOC=OFF option: Mongo-c-driver contains a copy of libbson, in case your system does not already have libbson installed. If cmake concludes with anything different, then it is likely an error occurred. The final line of output should look something like this: - Build files have been written to: /home/user/mongo-c-driver-1.23.3/cmake-build If cmake completed successfully, you will see a considerable amount of output describing your build configuration. For a list of all configure options, run cmake -L. Another useful cmake option is -DCMAKE_BUILD_TYPE=Release for a release optimized build and -DCMAKE_BUILD_TYPE=Debug for a debug build. The -DENABLE_AUTOMATIC_INIT_AND_CLEANUP=OFF option is recommended, see Initialization and cleanup. $ cmake -DENABLE_AUTOMATIC_INIT_AND_CLEANUP=OFF. The following snippet will download and extract the driver, and configure it: $ wget ![]() See the subsequent sections for additional platform-specific instructions. While the $ prompt is used throughout, the instructions below will work on Linux, macOS, and Windows (assuming that CMake is in the user’s shell path in all cases). The instructions in this document utilize cmake’s out-of-source build feature to keep build artifacts separate from source files. The most recent release of libmongoc and libbson, both of which are included in mongo-c-driver, can be downloaded here. Preparing a build from a release tarball ¶ The steps to prepare the build depend on how you obtained the source code and the build platform. $ pacman -noconfirm -S mingw64/mingw-w64-x86_64-cyrus-saslīefore building libmongoc and/or libbson, it is necessary to configure, or prepare, the build. $ pacman -noconfirm -S mingw-w64-x86_64-extra-cmake-modules make tar The libmongoc package is available on recent versions of Debian and Ubuntu. If you choose to install libmongoc from distribution packages, use the package manager to confirm the version being installed is sufficient for your needs. One advantage of installing libmongoc with a package manager is that its dependencies (including libbson) will be installed automatically. Several Linux distributions provide packages for libmongoc and its dependencies. Install libmongoc with a Package Manager ¶ ![]() The MongoDB C Driver is continuously tested on a variety of platforms including: The following guide will step you through the process of downloading, building, and installing the current release of the MongoDB C Driver (libmongoc) and BSON library (libbson). Installing the MongoDB C Driver (libmongoc) and BSON library (libbson) ¶
0 Comments
Leave a Reply. |