I am trying to compile mongo-cxx-driver-r3.1.1 on Ubuntu14.4 . I have installed mongo-c-driver-1.6.3 from source as per instructions.
pkg-config --cflags --libs libmongoc-1.0 libbson-1.0 returns
-I/usr/local/include/libmongoc-1.0 -I/usr/local/include/libbson-1.0 -L/usr/local/lib -lmongoc-1.0 -lsasl2 -lssl -lcrypto -lrt -lbson-1.0
I have boost version 1.57. When I try to compile mongo-cxx-driver-r3.1.1 as per the instructions provided in https://mongodb.github.io/mongo-cxx-driver/mongocxx-v3/installation/ using cmake.
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local ..
I get the following logs :
-- Boost version: 1.57.0
-- Configuring done
-- Generating done
-- Build files have been written to: /user/home/mongo-c-driver-1.6.3/mongo-cxx-driver-r3.1.1/build
I have tried other options such as:
cmake -DBSONCXX_POLY_USE_MNMLSTC:Bool=OFF -DBSONCXX_POLY_USE_BOOST:Bool=ON -
DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_C_COMPILER="/usr/bin/gcc" -
DCMAKE_CXX_COMPILER="/usr/bin/g++-4.8" -DCMAKE_BUILD_TYPE=Release -
DCMAKE_INSTALL_PREFIX=/usr/local -DLIBMONGOC_DIR=/usr/local/lib -
DLIBBSON_DIR=/usr/local/lib ..
However, I dont see the mongocxx related libraries or header files. Following is the CMakeFiles/CMakeOutput.log output:
The system is: Linux - 3.13.0-32-generic - x86_64 Compiling the CXX
compiler identification source file "CMakeCXXCompilerId.cpp"
succeeded. Compiler: /usr/bin/g++-4.8 Build flags: Id flags:
The output was:
0
Compilation of the CXX compiler identification source "CMakeCXXCompilerId.cpp" produced "a.out"
The CXX compiler identification is GNU, found in "/home/cvaidyan/mongo-c-driver-1.6.3/mongo-cxx-driver-r3.1.1/build/CMakeFiles/3.2.2/CompilerIdCXX/a.out"
Determining if the CXX compiler works passed with the following output: Change Dir: /home/cvaidyan/mongo-c-driver-1.6.3/mongo-cxx-driver-r3.1.1/build/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make" "cmTryCompileExec1480695504/fast"
ake[1]: Entering directory /home/cvaidyan/mongo-c-driver-1.6.3/mongo-cxx-driver-r3.1.1/build/CMakeFiles/CMakeTmp'
/usr/bin/cmake -E cmake_progress_report /home/cvaidyan/mongo-c-driver-1.6.3/mongo-cxx-driver-r3.1.1/build/CMakeFiles/CMakeTmp/CMakeFiles 1
Building CXX object CMakeFiles/cmTryCompileExec1480695504.dir/testCXXCompiler.cxx.o
/usr/bin/g++-4.8 -o CMakeFiles/cmTryCompileExec1480695504.dir/testCXXCompiler.cxx.o -c /home/cvaidyan/mongo-c-driver-1.6.3/mongo-cxx-driver-r3.1.1/build/CMakeFiles/CMakeTmp/testCXXCompiler.cxx
Linking CXX executable cmTryCompileExec1480695504
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTryCompileExec1480695504.dir/link.txt --verbose=1
/usr/bin/g++-4.8 CMakeFiles/cmTryCompileExec1480695504.dir/testCXXCompiler.cxx.o -o cmTryCompileExec1480695504 -rdynamic
make[1]: Leaving directory
/home/cvaidyan/mongo-c-driver-1.6.3/mongo-cxx-driver-r3.1.1/build/CMakeFiles/CMakeTmp'
Detecting CXX compiler ABI info compiled with the following output: Change Dir: /home/cvaidyan/mongo-c-driver-1.6.3/mongo-cxx-driver-r3.1.1/build/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make" "cmTryCompileExec4079379117/fast" .............
...................
/home/cvaidyan/mongo-c-driver-1.6.3/mongo-cxx-driver-r3.1.1/build/CMakeFiles/CMakeTmp/src.cxx:2:25: warning: \u2018int somefunc()\u2019 is deprecated (declared at /home/cvaidyan/mongo-c-driver-1.6.3/mongo-cxx-driver-r3.1.1/build/CMakeFiles/CMakeTmp/src.cxx:1) [-Wdeprecated-declarations] int main() { return somefunc();} ^ /home/cvaidyan/mongo-c-driver-1.6.3/mongo-cxx-driver-r3.1.1/build/CMakeFiles/CMakeTmp/src.cxx:2:34: warning: \u2018int somefunc()\u2019 is deprecated (declared at /home/cvaidyan/mongo-c-driver-1.6.3/mongo-cxx-driver-r3.1.1/build/CMakeFiles/CMakeTmp/src.cxx:1) [-Wdeprecated-declarations] int main() { return somefunc();} ^ Linking CXX executable cmTryCompileExec1892014975 /usr/bin/cmake -E cmake_link_script CMakeFiles/cmTryCompileExec1892014975.dir/link.txt --verbose=1 /usr/bin/g++-4.8 -DCOMPILER_HAS_DEPRECATED_ATTR CMakeFiles/cmTryCompileExec1892014975.dir/src.cxx.o -o cmTryCompileExec1892014975 -rdynamic make[1]: Leaving directory `/home/cvaidyan/mongo-c-driver-1.6.3/mongo-cxx-driver-r3.1.1/build/CMakeFiles/CMakeTmp'
Source file was: attribute((deprecated)) int somefunc() { return 0; } int main() { return somefunc();}
I could post the entire cmake output if it is meaningful. I grep'ed for "error" or "fail" in the file , but wasn't able to find either strings.
It would be great if someone could point out, what I am missing here?