#112566·tensorflow

failure to build tf2.9 with oneDNN on macos

Author: xllaCreated Mar 17, 2026Updated Oct 2, 2026
Labelsstat:awaiting responsetype:build/installstalecomp:mklsubtype:macOSTF 2.9

Issue type

Build/Install

Have you reproduced the bug with TensorFlow Nightly?

No

Source

source

TensorFlow version

tf 2.9

Custom code

Yes

OS platform and distribution

macos 10.13.6

Mobile device

No response

Python version

3.9

Bazel version

5.2.1

GCC/compiler version

Apple LLVM version 10.0.1 (clang-1001.0.46.4)

CUDA/cuDNN version

10.1, 7

GPU model and memory

gtx1080ti 11GB

Current behavior?

I want to build tf with oneDNN, I'v pass --config=mkl to bazel build, It complains "aliases are not supported on darwin"

Standalone code to reproduce the issue

bash
bazel build --config=opt --copt=-mssse3 --copt=-mfma --copt=-mcx16 --copt=-msse4.1 --copt=-msse4.2 --copt=-mpopcnt --copt=-mavx --config=noaws --config=nonccl --config=mkl --copt=-mavx2  --verbose_failures --action_env DYLD_LIBRARY_PATH=/usr/local/cuda/lib //tensorflow/tools/pip_package:build_pip_package

Relevant log output

bash
# Execution platform: @local_execution_config_platform//:platform
external/llvm_openmp/runtime/src/kmp_gsupport.cpp:1845:1: error: aliases are not supported on darwin
KMP_VERSION_SYMBOL(KMP_API_NAME_GOMP_ATOMIC_END, 10, "GOMP_1.0");
^
external/llvm_openmp/runtime/src/kmp_os.h:359:3: note: expanded from macro 'KMP_VERSION_SYMBOL'
  _KMP_VERSION_SYMBOL(api_name, ver_num, ver_str, "VERSION")
  ^
external/llvm_openmp/runtime/src/kmp_os.h:362:22: note: expanded from macro '_KMP_VERSION_SYMBOL'
      __attribute__((alias(KMP_STR(__kmp_api_##api_name))));                    \
                     ^