The egbbdll serves dual purpose, namely, for probing bitbases and neural networks. If you just want the former, the build processess is very easy.
First clone the repository
git clone https://github.com/dshawul/egbbdll.git
Then set the following variables to 0 in the Makefile
USE_TF = 0
USE_TRT = 0
Then
make
That is it.
To build egbbdll with neural network support is a lot more complicated. Neural network inference is done via tensorflow and/or TensorRT backends. This means you are limited to NVIDIA GPUs atleast until OpenCL support is complete in these libraries.
The easiest way on a Windows machines is to download the binaries I provide for both CPU and GPU (with CUDA + cuDNN libraries). Here are the links for convenience
Extract it in a directory where bitbases are located so it can serve its dual purpose. For the GPU version of egbbdll, we need to set the Path environment variable ( in the case of linux the LD_LIBRARY_PATH variable) so that the system can find cudnn.dll, nvinfer.dll and other dependencies.
For those who feel adventurous, here is how you build from sources. Egbbdll needs tensorflow for neural network inference on the CPU, however, on the GPU there is another option that is less complicated to build AND also significantly faster. That option is using TensorRT and UFF format network files. We need to install the followind dependencies for the TensorRT backend:
* cuDNN
* CUDA
* TensorRT
These can be download NVIDA developer page Make sure you download compatible versions (e.g. cuDNN 7.3 + CUDA 10.0 + TensorRT 5.0)
Clone the egbbdll repository
git clone https://github.com/dshawul/egbbdll.git
Then go into the Makefile and set the paths to the dependencies
#########################################
# USE_TF 0 = Don't use tensorflow
# 1 = tensorlow_cc
# 2 = manually built tensorflow
# USE_TRT 0 = Don't use TensorRT
# 1 = Use TensorRT
# USE_SHARED 0 = static linking if possible
# 1 = dynamic linking to TF/TRT
########################################
USE_TF = 0
USE_TRT = 1
USE_SHARED = 1
########################################
# Set directories to dependenies
########################################
ifeq ($(USE_TF),1)
TF_DIR=/usr/local
else ifeq ($(USE_TF),2)
TF_DIR=/home/daniel/tensorflow
endif
ifneq ($(USE_TRT),0)
TRT_DIR = /home/daniel/TensorRT-5.0.0.10
CUDA_DIR = /usr/local/cuda
endif
Then build egbbso64.so with
make
That is it.
To build egbbdll with libtensorflow_cc.so dependency, do one of the following.
The first option is to use tensorflow_cc (USE_TF = 1). Build the C++ tensorflow library following the steps given here.
It may be easier to use docker using the command below instead of building the shared library with bazel yourself.
docker run --runtime=nvidia -it floopcz/tensorflow_cc:ubuntu-shared-cuda /bin/bash
Once the build and install (or docker load) is complete, you should see the tensorflow and protobuf libraries
$ ls /usr/local/lib/tensorflow_cc/
libprotobuf.a libtensorflow_cc.so
The second option is to build tensorflow manually without using scripts (USE_TF = 2). This option also works on windows. Go into the tensorflow director and execute
bazel build --config=opt --config=monolithic //tensorflow:libtensorflow_cc.so
This will take hours to build so be patient. Once it completes, you will find the library in bazel-bin/tensorflow directory.
To compile egbbdll directly using bazel, put the egbbdll source directory in tensorflow/tenorflow/cc/ and then compile with
bazel build --config=opt --config=monolithic //tensorflow/cc/egbbdll:egbbdll64.dll
You will then find the egbbdll64.dll in bazel-bin/tensorflow/cc/egbbdll directory. This option currently doesn't work with the TensorRT backend.