-
Notifications
You must be signed in to change notification settings - Fork 105
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
127 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
############## | ||
Installing DLR | ||
############## | ||
|
||
.. contents:: Contents | ||
:local: | ||
:backlinks: none | ||
|
||
************************ | ||
Building DLR from source | ||
************************ | ||
|
||
Building DLR consists of two steps: | ||
|
||
1. Build the shared library from C++ code (``libdlr.so`` for Linux, ``libdlr.dylib`` for Mac OSX, and ``dlr.dll`` for Windows). | ||
2. Then install the Python package ``dlr``. | ||
|
||
.. note:: Use of Git submodules | ||
|
||
DLR uses Git submodules to manage dependencies. So when you clone the repo, remember to specify ``--recursive`` option: | ||
|
||
.. code-block:: bash | ||
git clone --recursive https://github.com/neo-ai/neo-ai-dlr | ||
Building on Linux | ||
================= | ||
|
||
Ensure that all necessary software packages are installed: GCC (or Clang), CMake, and Python. For example, in Ubuntu, you can run | ||
|
||
.. code-block:: bash | ||
sudo apt-get update | ||
sudo apt-get install -y python3 python3-pip gcc build-essential cmake | ||
To build, create a subdirectory ``build`` and invoke CMake: | ||
|
||
.. code-block:: bash | ||
mkdir build | ||
cd build | ||
cmake .. | ||
Once CMake is done generating a Makefile, run GNU Make to compile: | ||
|
||
.. code-block:: bash | ||
make -j4 # Use 4 cores to compile sources in parallel | ||
By default, DLR will be built with CPU support only. To enable support for NVIDIA GPUs, enable CUDA, CUDNN, and TensorRT by calling CMake with extra options: | ||
|
||
.. code-block:: bash | ||
cmake .. -DUSE_CUDA=ON -DUSE_TENSORRT=ON -DUSE_CUDNN=ON | ||
make -j4 | ||
You will need to install NVIDIA CUDA toolkits and drivers beforehand. | ||
|
||
Once the compilation is completed, install the Python package by running ``setup.py``: | ||
|
||
.. code-block:: bash | ||
cd python | ||
python3 setup.py install | ||
Building on Mac OS X | ||
==================== | ||
|
||
Install GCC and CMake from `Homebrew <https://brew.sh/>`_: | ||
|
||
.. code-block:: bash | ||
brew update | ||
brew install cmake gcc@8 | ||
To ensure that Homebrew GCC is used (instead of default Apple compiler), specify environment variables ``CC`` and ``CXX`` when invoking CMake: | ||
|
||
.. code-block:: bash | ||
mkbir build | ||
cd build | ||
CC=gcc-8 CXX=g++-8 cmake .. | ||
make -j4 | ||
NVIDIA GPUs are not supported for Mac OS X target. | ||
|
||
Once the compilation is completed, install the Python package by running ``setup.py``: | ||
|
||
.. code-block:: bash | ||
cd python | ||
python3 setup.py install | ||
Building on Windows | ||
=================== | ||
|
||
DLR requires `Visual Studio 2017 <https://visualstudio.microsoft.com/downloads/>`_ as well as `CMake <https://cmake.org/>`_. | ||
|
||
In the DLR directory, first run CMake to generate a Visual Studio project: | ||
|
||
.. code-block:: cmd | ||
mkdir build | ||
cd build | ||
cmake .. -G"Visual Studio 15 2017 Win64" | ||
If CMake run was successful, you should be able to find the solution file ``dlr.sln``. Open it with Visual Studio. To build, choose **Build Solution** on the **Build** menu. | ||
|
||
NVIDIA GPU is not yet supported for Windows target. | ||
|
||
Once the compilation is completed, install the Python package by running ``setup.py``: | ||
|
||
.. code-block:: bash | ||
cd python | ||
python3 setup.py install |