-
Notifications
You must be signed in to change notification settings - Fork 7
/
setup-mongocxx
executable file
·35 lines (29 loc) · 976 Bytes
/
setup-mongocxx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/bash
# i found the below steps from:
# https://developer.mongodb.com/community/forums/t/problems-trying-to-compile-mongocxx/2084
function install_mongocxx_dependencies() {
TOP_DIR=$(pwd)
sudo apt-get install cmake libmongoc-1.0-0 libbson-1.0 cmake libssl-dev libsasl2-dev zlib1g-dev
wget https://github.com/mongodb/mongo-c-driver/releases/download/1.23.2/mongo-c-driver-1.23.2.tar.gz
tar xzf mongo-c-driver-1.23.2.tar.gz
cd mongo-c-driver-1.23.2
mkdir cmake-build
cd cmake-build
cmake -DENABLE_AUTOMATIC_INIT_AND_CLEANUP=OFF ..
sudo make install
git clone https://github.com/mongodb/mongo-cxx-driver.git \
--branch releases/stable --depth 1
cd mongo-cxx-driver/build
sudo cmake .. \
-DCMAKE_BUILD_TYPE=Release \
-DBSONCXX_POLY_USE_MNMLSTC=1 \
-DCMAKE_INSTALL_PREFIX=/usr/local
sudo make
sudo make install
cd $TOP_DIR
rm -rf mongo-c-driver-1.23.2*
}
function main() {
install_mongocxx_dependencies
}
main