oneAPI Deep Neural Network Library (oneDNN)
Performance library for Deep Learning
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
Build from Source

Download the Source Code

Download oneDNN source code or clone the repository.

git clone

Build the Library

Ensure that all software dependencies are in place and have at least the minimal supported version.

The oneDNN build system is based on CMake. Use

  • CMAKE_INSTALL_PREFIX to control the library installation location,
  • CMAKE_BUILD_TYPE to select between build type (Release, Debug, RelWithDebInfo).

See Build Options for detailed description of build-time configuration options.


Prepare the Build Space

mkdir -p build && cd build

Generate makefile

  • Native compilation:
    cmake .. <extra build options>
  • Cross compilation (AArch64 target on Intel 64 host)
export CC=aarch64-linux-gnu-gcc
export CXX=aarch64-linux-gnu-g++
cmake .. \
-DCMAKE_LIBRARY_PATH=/usr/aarch64-linux-gnu/lib \
<extra build options>
  • Compile with Arm Compute Library (AArch64 only)
export ACL_ROOT_DIR=<path/to/Compute Library>
cmake .. \
<extra build options>

Build and Install the Library

  • Build the library:
    make -j
  • Build the documentation:
    make doc
  • Install the library, headers, and documentation:
    make install


  • Generate a Microsoft Visual Studio solution:
    mkdir build && cd build && cmake -G "Visual Studio 15 2017 Win64" ..
    For the solution to use the Intel C++ Compiler, select the corresponding toolchain using the cmake -T switch:
    cmake -G "Visual Studio 15 2017 Win64" -T "Intel C++ Compiler 19.0" ..
  • Build the library:
    cmake --build .
    You can also use the msbuild command-line tool directly (here /p:Configuration selects the build configuration which can be different from the one specified in CMAKE_BUILD_TYPE, and /m enables a parallel build):
    msbuild "oneDNN.sln" /p:Configuration=Release /m
  • Build the documentation
    cmake --build . --target DOC
  • Install the library, headers, and documentation:
    cmake --build . --target INSTALL

Validate the Build

If the library is built for the host system, you can run unit tests using: