Skip to content

Tutorial for MacOS

Takuya Takeuchi edited this page Jun 1, 2019 · 7 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

Preparations

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

Install X11

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.dylib will be in build

How to build DlibDotNet.Native.Dnn

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. libDlibDotNetNativeDnn.dylib 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/ReleaseMac/netcoreapp2.0/* bin/Release/netcoreapp2.0
cp ../../src/DlibDotNet.Native/build/libDlibDotNet.Native.dylib bin/Release/netcoreapp2.0/
dotnet run --configuration Release --no-build