Building Dependencies for fplog

Build Boost

Windows

First execute bootstrap.bat and then the following:
b2 --build-type=complete --toolset=msvc architecture=x86 address-model=32

Linux

g++-multilib: you need to install this package to do cross-compilation, building 32-bit executables on 64-bit machine.
Execute bootstrap.sh and then the following:

./b2 -j8 --build-type=complete --layout=versioned --toolset=gcc architecture=x86 address-model=32

-j8 switch here means that 8 parallel compilation threads will be used, rule of thumb should be number of CPU cores * 2. In my case I have four cores, each able to execute 2 threads in parallel, so my total is 8. Speeds-up compilation significantly.
Multi-core build, htop screenshot showing 100% load of all CPU cores.
After building for any platform please copy folders boost and stage inside your boost source tree into fplog/boost folder (you have to create this folder manually).

Building boost_python

Here is the build command:

./b2 -j8 --with-python --build-type=complete --layout=versioned --toolset=gcc architecture=x86 address-model=32

The output will give you boost_python libraries with your system default Python (most likely 2.7). In order to get boost_python3 libs you will have to make the following modification inside the project-config.jam file generated by Bootstrap.sh before executing the build (see the line with the cursor):

boost project-config.jam with python3 enabled screenshot

Build MongoDB legacy CXX driver

Prerequisite are SCons and Python 2.x.
Driver also depends on Boost, so Boost should be built before starting with MongoDB driver. Notice that I am telling scons to use Boost headers and libs that I built and put into fplog project.

Windows

scons install --32 --cpppath=c:\Users\kr0st\Source\fplog\boost --libpath=c:\Users\kr0st\Source\fplog\boost\stage\lib
scons install --32 --dbg=on --cpppath=c:\Users\kr0st\Source\fplog\boost --libpath=c:\Users\kr0st\Source\fplog\boost\stage\lib
scons install --32 --dynamic-windows --sharedclient --cpppath=c:\Users\kr0st\Source\fplog\boost --libpath=c:\Users\kr0st\Source\fplog\boost\stage\lib
scons install --32 --dynamic-windows --sharedclient --dbg=on --cpppath=c:\Users\kr0st\Source\fplog\boost --libpath=c:\Users\kr0st\Source\fplog\boost\stage\lib

Linux

scons install --32 --cpppath=/home/kr0st/source/fplog/boost --libpath=/home/kr0st/source/fplog/boost/stage/lib --boost-lib-search-suffixes=-gcc48-1_61,-gcc48-mt-1_61,-gcc48-mt-d-1_61,-gcc48-d-1_61,-gcc48-s-1_61,-gcc48-sd-1_61,-gcc48-mt-s-1_61,-gcc48-mt-sd-1_61

scons install –32 –sharedclient –cpppath=/home/kr0st/source/fplog/boost –libpath=/home/kr0st/source/fplog/boost/stage/lib –boost-lib-search-suffixes=-gcc48-1_61,-gcc48-mt-1_61,-gcc48-mt-d-1_61,-gcc48-d-1_61,-gcc48-s-1_61,-gcc48-sd-1_61,-gcc48-mt-s-1_61,-gcc48-mt-sd-1_61

scons install –32 –dbg=on –cpppath=/home/kr0st/source/fplog/boost –libpath=/home/kr0st/source/fplog/boost/stage/lib –boost-lib-search-suffixes=-gcc48-1_61,-gcc48-mt-1_61,-gcc48-mt-d-1_61,-gcc48-d-1_61,-gcc48-s-1_61,-gcc48-sd-1_61,-gcc48-mt-s-1_61,-gcc48-mt-sd-1_61

scons install –32 –sharedclient –dbg=on –cpppath=/home/kr0st/source/fplog/boost –libpath=/home/kr0st/source/fplog/boost/stage/lib –boost-lib-search-suffixes=-gcc48-1_61,-gcc48-mt-1_61,-gcc48-mt-d-1_61,-gcc48-d-1_61,-gcc48-s-1_61,-gcc48-sd-1_61,-gcc48-mt-s-1_61,-gcc48-mt-sd-1_61

Please note that because I am using versioned layout for building boost I have to use suffixes in order to compile mongo driver: –boost-lib-search-suffixes=-gcc48-1_61. Also take into consideration that suffixes depend on boost and gcc versions (here 1.61 and 4.8 accordingly).

Once build for any platform is done, copy build/install folder of MongoDB Legacy CXX driver source tree into fplog solution folder and then rename this install directory into mongo inside fplog.

You’re done!

NOTE: you have to use 64-bit version of MongoDB server, it is accessible from 32-bit application and does not have 2GB storage limitation.