Regarding issue facing while try to build fdbdoc binary in macOS

Hi,
I am trying to build the fdbdoc binary using GitHub source code in macOS. But I am facing issue while building the binary.
I have followed the below steps :
clone the source code from GitHub
cd /fdb document layer source code directory/
mkdir build && cd build
cmake -DBOOST_ROOT=/tmp/boost_1_67_0/ …
make
The issue I faced “tls.h” file not found
then I make below changes in makefile which it is in the foundationdb source directory.
CFLAGS + = -I/path-to-libressl/include
then “tls.h” file issue is solved.
but after that, I am facing issue showed below in image:

Is there any specific way to build the fdbdoc binary in macOS? Or is it possible to build using docker like linux? Please let me know

This is a dependency inherited from FoundationDB code, and there’s a small bit about LibreSSL on MacOS in the README there, that covers how to install LibreSSL and set -DLibreSSL_ROOT to tell CMake how to find it. Does that get you building?

@alexmiller Thanks for reply,
I tried that steps which you refer
cmake -DBOOST_ROOT=/tmp/boost_1_67_0/ -DLibreSSL_ROOT=/usr/local/Cellar/libressl/2.9.2/ …

but it show Cmake warning like this

please tell how to resolve this issue
Thanks in advance

I am not very familiar with the fdb document layer, but it looks like the document layer doesn’t use cmake to build FoundationDB (instead it relies on make). This is probably why this cmake variable doesn’t have an effect for you.

If I were you I would take the short path:

  1. For now you can build without TLS - if you set the environment variable TLS_DISABLED to something while cmake is running, it will fix your issue.
  2. You then probably want to create an issue on the github project (the document layer project, not foundationdb). The make-based build system will probably go away soon so this will need to be fixed anyways.

Without TLS you should at least be able to use the document layer for local development and testing. If you need TLS support, it will probably be slightly harder to get it working. If you are familiar enough with cmake you could probably fix it yourself and make a PR.

I am not familiar enough with the make-based build system that FDB uses. I took a quick look and couldn’t find a proper way to tell it where to find LibreSSL. If you do, you could change the following lines in cmake/FlowConfig.cmake:

if(NOT TLS_DISABLED)
    message(STATUS Building FDB with TLS bits)
    set(FDB_BUILD_COMMAND BOOSTDIR=${Boost_INCLUDE_DIRS} $(MAKE) flow fdb_flow fdb_c fdbmonitor FDBLibTLS fdbrpc)
    set(FDB_SERVER_BUILD_COMMAND $(MAKE) fdbserver fdbcli)
else()
    set(FDB_BUILD_COMMAND BOOSTDIR=${Boost_INCLUDE_DIRS} $(MAKE) flow fdb_flow fdb_c fdbmonitor TLS_DISABLED=1)
    set(FDB_SERVER_BUILD_COMMAND $(MAKE) fdbserver fdbcli TLS_DISABLED=1)
endif()

Maybe @mbhaskar knows a better work-around (or maybe there’s already a proper way of doing this that I am not aware of)?

The TLS_DISABLED lines in the document layer are

And the Makefile build system handles setting libressl location via TLS_LIBDIR

Thanks @alexmiller @markus.pilman,
Able to build fdbdoc binary, after setting environment variable TLS_DISABLED=ON.

1 Like