Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Build] Failure with OneDNN on Intel MacOS #18976

Open
matteosal opened this issue Jan 2, 2024 · 3 comments
Open

[Build] Failure with OneDNN on Intel MacOS #18976

matteosal opened this issue Jan 2, 2024 · 3 comments
Labels
build build issues; typically submitted using template ep:oneDNN questions/issues related to DNNL EP

Comments

@matteosal
Copy link

Describe the issue

I get errors trying to build with OneDNN onnxruntime_USE_DNNL=ON on an Intel MacOS machine.

Urgency

No response

Target platform

MacOSX-x86-64, Clang 13.1.6

Build script

cmake --compile-no-warning-as-error \
 `# GENERAL FLAGS` \
 -DCMAKE_INSTALL_PREFIX=$output_dir \
 -DCMAKE_BUILD_TYPE=Release \
 -DCMAKE_SKIP_BUILD_RPATH=ON \
 -DPYTHON_EXECUTABLE=$PYTHON3EXE \
 `# ONNXRUNTIME SPECIFIC` \
 -Donnxruntime_BUILD_SHARED_LIB=ON \
 -Donnxruntime_USE_DNNL=ON \
 -Donnxruntime_USE_TELEMETRY=OFF \
 -Donnxruntime_BUILD_UNIT_TESTS=OFF \
 -DProtobuf_USE_STATIC_LIBS=ON \
 $onnxruntime_dir/cmake

Error / output

I see this error during the CMake configuration phase:

CMake Error at onnxruntime_providers.cmake:629 (add_dependencies):
  The dependency target "onnxruntime_providers_shared" of target
  "onnxruntime_providers_dnnl" does not exist.

Followed by this error at build time:

onnxruntime/onnxruntime/core/providers/dnnl/dnnl_execution_provider.cc:14:10: fatal error: 'omp.h' file not found

Visual Studio Version

No response

GCC / Compiler Version

No response

@matteosal matteosal added the build build issues; typically submitted using template label Jan 2, 2024
@github-actions github-actions bot added the ep:oneDNN questions/issues related to DNNL EP label Jan 2, 2024
@wschin
Copy link
Contributor

wschin commented Jan 3, 2024

Looks like you need to install openmp. Try this:

brew install libomp

@matteosal
Copy link
Author

@wschin that would mean ONNXRuntime relies on an external installation of OpenMP in order to build with OneDNN, which doesn't sound quite right. There is no mention of this on the build instructions with the OneDNN provider here, and CMakeLists.txt doesn't expose any flag to set the OpenMP location, contrary to several other dependencies (e.g. onnxruntime_CUDA_HOME).

This looks more like ONNXRuntime is supposed to automatically take care of it but it's failing to do so for some reason, which is also supported by the fact that a CMake configuration error happens well before the compile error (as reported in the top comment).

@matteosal
Copy link
Author

Any other take here? @RyanUnderhill maybe?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build build issues; typically submitted using template ep:oneDNN questions/issues related to DNNL EP
Projects
None yet
Development

No branches or pull requests

2 participants