Skip to content

Tutorial for Linux

Takuya Takeuchi edited this page Oct 19, 2019 · 22 revisions

Requirements

  • dlib
  • CMake
    • 3.0 or higher
    • If you do not want to add CMake path to environment variable, you must type fullpath of CMake when build library.
  • .NET Core 2.0

How to build dlib

DlibDotNet.Native requires libdlib.a. You can refer official page

Preparations

git clone https://github.com/takuya-takeuchi/DlibDotNet
cd DlibDotNet
./Initialize.sh

RHEL/Fedora/CentOS

sudo yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
sudo yum install libX11-devel openblas-devel

Ubuntu/debian

sudo apt-get install libx11-dev libopenblas-dev

How to build DlibDotNet.Native

Build

  1. Open DlibDotNet/src/DlibDotNet.Native in console
  2. Type the following code in a console:
mkdir build
cd build
cmake ..
  1. Type the following code in a console:
cmake --build . --config Release

Or

cmake --build . --config Debug
  1. libDlibDotNetNative.so will be in build

How to build DlibDotNet.Native.Dnn

Build

  1. Open DlibDotNet/src/DlibDotNet.Native.Dnn in console
  2. Type the following code in a console:
mkdir build
cd build
cmake ..
  1. Type the following code in a console:
cmake --build . --config Release

Or

cmake --build . --config Debug
  1. libDlibDotNetNativeDnn.so will be in build

How to build DlibDotNet

Preparations

  1. Install .NET Core 2.0 by following the official page

Build

  1. Open DlibDotNet/src/DlibDotNet.Native in console
  2. Type the following code in a console:
dotnet build -c Release

Or

dotnet build -c Debug

How to use DlibDotNet?

For now dotnet command does NOT support specify any executable directory. So please refer the following code in a console:

dotnet restore
dotnet msbuild /p:Configuration=Release
mkdir -p bin/Release/netcoreapp2.0
mv bin/ReleaseLinux/netcoreapp2.0/* bin/Release/netcoreapp2.0
cp ../../src/DlibDotNet.Native/build/libDlibDotNet.Native.so bin/Release/netcoreapp2.0/
dotnet run --configuration Release --no-build

Clone this wiki locally