- 
                Notifications
    
You must be signed in to change notification settings  - Fork 1.4k
 
Building
If a developer would like to build FoundationDB from source, the following steps are required to FoundationDB.
The following need to be installed:
- cmake
 - mono
 - Boost 1.67 (Optional, FDB will download this as a build step)
 - LibreSSL if you want to support ssl
 - JDK (FoundationDB currently builds with Java 8) Java Download link
 
$ brew install mono cmake LibreSSL
- Create a build directory (you can have the build directory anywhere you like): 
mkdir build cd buildcmake <PATH_TO_FOUNDATIONDB_DIRECTORY>
If you want to use LibreSSL it is recommended to pass the LibreSSL path as an argument:
cmake -DLibreSSL_ROOT=<PATH_TO_LIBRE_SSL> <PATH_TO_FOUNDATIONDB_DIRECTORY>
Improving build times with ccache
FoundationDB can take a while to build, using ccache will improve the build performance. To use ccache, make sure it is installed brew install ccache on macOS. Then add it as a parameter to the cmake command:
cmake -DUSE_CCACHE=ON -DLibreSSL_ROOT=<PATH_TO_LIBRE_SSL>  <PATH_TO_FOUNDATIONDB_DIRECTORY>
Finally to build the source code run make. It is possible to build individual parts of FoundationDB by running make <FDB_PROJECT> e.g make fdbcli
To generate an installable package, you have to call CMake with the corresponding arguments for the operating system package nd then use cpack to generate the package.
For macOS you need to do -DINSTALL_LAYOUT=OSX and for a Debian package -DINSTALL_LAYOUT=deb
cmake -DINSTALL_LAYOUT=<OS_CHOICE>  <FDB_SOURCE_DIR>
make
cpackUnder Windows, the build instructions are very similar, with the main difference that Visual Studio is used to compile.
- Install Visual Studio 2017 (Community Edition is tested)
 - Install cmake Version 3.12 or higher CMake
 - Download version 1.67 of Boost.
 - Unpack boost (you don't need to compile it)
 - Install Mono.
 - Install a JDK. FoundationDB currently builds with Java 8.
 - Set 
JAVA_HOMEto the unpacked location and JAVA_COMPILE to$JAVA_HOME/bin/javac. - Install Python if it is not already installed by Visual Studio.
 - (Optional) Install WIX. Without it Visual Studio won't build the Windows installer.
 - Create a build directory (you can have the build directory anywhere you
like): 
mkdir build cd buildcmake -G "Visual Studio 15 2017 Win64" -DBOOST_ROOT=<PATH_TO_BOOST> <PATH_TO_FOUNDATIONDB_DIRECTORY>- This should succeed. In which case you can build using msbuild:
msbuild /p:Configuration=Release foundationdb.sln. You can also open the resulting solution in Visual Studio and compile from there. However, be aware that using Visual Studio for development is currently not supported as Visual Studio will only know about the generated files.msbuildis located atc:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exefor Visual Studio 15. 
If you want TLS support to be enabled under Windows you currently have to build and install LibreSSL yourself as the newer LibreSSL versions are not provided for download from the LibreSSL homepage. To build LibreSSL:
- Download and unpack libressl (>= 2.8.2)
 cd libressl-2.8.2mkdir buildcd buildcmake -G "Visual Studio 15 2017 Win64" ..- Open the generated 
LibreSSL.slnin Visual Studio as administrator (this is necessary for the install) - Build the 
INSTALLproject inReleasemode 
This will install LibreSSL under C:\Program Files\LibreSSL. After that cmake will automatically find it and build with TLS support.
If you installed WIX before running cmake you should find the
FDBInstaller.msi in your build directory under packaging/msi.
The language bindings that are supported by cmake will have a corresponding
README.md file in the corresponding bindings/lang directory.
cmake will build all language bindings for which it can find all necessary dependencies. After each successful cmake run, cmake will tell you which language bindings it is going to build.