tensorflow: error: aliases are not supported on darwin In MacOS Big Sur

Please make sure that this is a build/installation issue. As per our GitHub Policy, we only address code/doc bugs, performance issues, feature requests and build/installation issues on GitHub. tag:build_template

System information

  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): MacOS Big Sur 11.2.3
  • Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device: N/A
  • TensorFlow installed from (source or binary): Source
  • TensorFlow version: 2.4.1/master branch
  • Python version: 3.7
  • Installed using virtualenv? pip? conda?: pip
  • Bazel version (if compiling from source):3.7.2
  • GCC/Compiler version (if compiling from source): Apple clang version 12.0.0 (clang-1200.0.32.29) (XCode 12+)
  • CUDA/cuDNN version: N/A
  • GPU model and memory: N/A

Describe the problem

Hi, I got this error while building TensorFlow from source using master branch/v2.4.1 branch from latest version of MacOS Big Sur (11+):

bazelisk build --config=mkl -c opt --copt=-march=native //tensorflow/tools/lib_package:libtensorflow

INFO: Options provided by the client:
  Inherited 'common' options: --isatty=1 --terminal_columns=178
INFO: Reading rc options for 'build' from /Users/mania25/Downloads/tensorflow/.bazelrc:
  Inherited 'common' options: --experimental_repo_remote_exec
INFO: Reading rc options for 'build' from /Users/mania25/Downloads/tensorflow/.bazelrc:
  'build' options: --define framework_shared_object=true --java_toolchain=@tf_toolchains//toolchains/java:tf_java_toolchain --host_java_toolchain=@tf_toolchains//toolchains/java:tf_java_toolchain --define=use_fast_cpp_protos=true --define=allow_oversize_protos=true --spawn_strategy=standalone -c opt --announce_rc --define=grpc_no_ares=true --noincompatible_remove_legacy_whole_archive --noincompatible_prohibit_aapt1 --enable_platform_specific_config --define=with_xla_support=true --config=short_logs --config=v2
INFO: Reading rc options for 'build' from /Users/mania25/Downloads/tensorflow/.tf_configure.bazelrc:
  'build' options: --action_env PYTHON_BIN_PATH=/opt/intel/oneapi/intelpython/latest/bin/python3 --action_env PYTHON_LIB_PATH=/opt/intel/oneapi/intelpython/latest/lib/python3.7/site-packages --python_path=/opt/intel/oneapi/intelpython/latest/bin/python3
INFO: Found applicable config definition build:short_logs in file /Users/mania25/Downloads/tensorflow/.bazelrc: --output_filter=DONT_MATCH_ANYTHING
INFO: Found applicable config definition build:v2 in file /Users/mania25/Downloads/tensorflow/.bazelrc: --define=tf_api_version=2 --action_env=TF2_BEHAVIOR=1
INFO: Found applicable config definition build:mkl in file /Users/mania25/Downloads/tensorflow/.bazelrc: --define=build_with_mkl=true --define=enable_mkl=true --define=tensorflow_mkldnn_contraction_kernel=0 --define=build_with_openmp=true -c opt
INFO: Found applicable config definition build:macos in file /Users/mania25/Downloads/tensorflow/.bazelrc: --apple_platform_type=macos --copt=-DGRPC_BAZEL_BUILD --copt=-w --define=PREFIX=/usr --define=LIBDIR=$(PREFIX)/lib --define=INCLUDEDIR=$(PREFIX)/include --define=PROTOBUF_INCLUDE_PATH=$(PREFIX)/include --cxxopt=-std=c++14 --host_cxxopt=-std=c++14
DEBUG: Rule 'io_bazel_rules_docker' indicated that a canonical reproducible form can be obtained by modifying arguments shallow_since = "1556410077 -0400"
DEBUG: Repository io_bazel_rules_docker instantiated at:
  /Users/mania25/Downloads/tensorflow/WORKSPACE:23:14: in <toplevel>
  /Users/mania25/Downloads/tensorflow/tensorflow/workspace0.bzl:105:34: in workspace
  /private/var/tmp/_bazel_mania25/2fa4938439e248c63b3c0f49ddc6c271/external/bazel_toolchains/repositories/repositories.bzl:37:23: in repositories
Repository rule git_repository defined at:
  /private/var/tmp/_bazel_mania25/2fa4938439e248c63b3c0f49ddc6c271/external/bazel_tools/tools/build_defs/repo/git.bzl:199:33: in <toplevel>
INFO: Analyzed target //tensorflow/tools/lib_package:libtensorflow (227 packages loaded, 20983 targets configured).
INFO: Found 1 target...
INFO: Deleting stale sandbox base /private/var/tmp/_bazel_mania25/2fa4938439e248c63b3c0f49ddc6c271/sandbox
ERROR: /private/var/tmp/_bazel_mania25/2fa4938439e248c63b3c0f49ddc6c271/external/llvm_openmp/BUILD.bazel:192:10: C++ compilation of rule '@llvm_openmp//:libiomp5.dylib' failed (Exit 1): wrapped_clang failed: error executing command external/local_config_cc/wrapped_clang '-D_FORTIFY_SOURCE=1' -fstack-protector -fcolor-diagnostics -Wall -Wthread-safety -Wself-assign -fno-omit-frame-pointer -g0 -O2 '-D_FORTIFY_SOURCE=1' -DNDEBUG ... (remaining 42 argument(s) skipped)
In file included from external/llvm_openmp/runtime/src/kmp_ftn_cdecl.cpp:31:
external/llvm_openmp/runtime/src/kmp_ftn_entry.h:1397:1: error: aliases are not supported on darwin
KMP_VERSION_SYMBOL(FTN_SET_NUM_THREADS, 10, "OMP_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))));                    \
                     ^
In file included from external/llvm_openmp/runtime/src/kmp_ftn_cdecl.cpp:31:
external/llvm_openmp/runtime/src/kmp_ftn_entry.h:1398:1: error: aliases are not supported on darwin
KMP_VERSION_SYMBOL(FTN_GET_NUM_THREADS, 10, "OMP_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))));                    \
                     ^
In file included from external/llvm_openmp/runtime/src/kmp_ftn_cdecl.cpp:31:
external/llvm_openmp/runtime/src/kmp_ftn_entry.h:1399:1: error: aliases are not supported on darwin
KMP_VERSION_SYMBOL(FTN_GET_MAX_THREADS, 10, "OMP_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))));                    \
                     ^
In file included from external/llvm_openmp/runtime/src/kmp_ftn_cdecl.cpp:31:
external/llvm_openmp/runtime/src/kmp_ftn_entry.h:1400:1: error: aliases are not supported on darwin
KMP_VERSION_SYMBOL(FTN_GET_THREAD_NUM, 10, "OMP_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))));                    \
                     ^
In file included from external/llvm_openmp/runtime/src/kmp_ftn_cdecl.cpp:31:
external/llvm_openmp/runtime/src/kmp_ftn_entry.h:1401:1: error: aliases are not supported on darwin
KMP_VERSION_SYMBOL(FTN_GET_NUM_PROCS, 10, "OMP_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))));                    \
                     ^
In file included from external/llvm_openmp/runtime/src/kmp_ftn_cdecl.cpp:31:
external/llvm_openmp/runtime/src/kmp_ftn_entry.h:1402:1: error: aliases are not supported on darwin
KMP_VERSION_SYMBOL(FTN_IN_PARALLEL, 10, "OMP_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))));                    \
                     ^
In file included from external/llvm_openmp/runtime/src/kmp_ftn_cdecl.cpp:31:
external/llvm_openmp/runtime/src/kmp_ftn_entry.h:1403:1: error: aliases are not supported on darwin
KMP_VERSION_SYMBOL(FTN_SET_DYNAMIC, 10, "OMP_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))));                    \
                     ^
In file included from external/llvm_openmp/runtime/src/kmp_ftn_cdecl.cpp:31:
external/llvm_openmp/runtime/src/kmp_ftn_entry.h:1404:1: error: aliases are not supported on darwin
KMP_VERSION_SYMBOL(FTN_GET_DYNAMIC, 10, "OMP_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))));                    \
                     ^
In file included from external/llvm_openmp/runtime/src/kmp_ftn_cdecl.cpp:31:
external/llvm_openmp/runtime/src/kmp_ftn_entry.h:1405:1: error: aliases are not supported on darwin
KMP_VERSION_SYMBOL(FTN_SET_NESTED, 10, "OMP_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))));                    \
                     ^
In file included from external/llvm_openmp/runtime/src/kmp_ftn_cdecl.cpp:31:
external/llvm_openmp/runtime/src/kmp_ftn_entry.h:1406:1: error: aliases are not supported on darwin
KMP_VERSION_SYMBOL(FTN_GET_NESTED, 10, "OMP_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))));                    \
                     ^
In file included from external/llvm_openmp/runtime/src/kmp_ftn_cdecl.cpp:31:
external/llvm_openmp/runtime/src/kmp_ftn_entry.h:1407:1: error: aliases are not supported on darwin
KMP_VERSION_SYMBOL(FTN_INIT_LOCK, 10, "OMP_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))));                    \
                     ^
In file included from external/llvm_openmp/runtime/src/kmp_ftn_cdecl.cpp:31:
external/llvm_openmp/runtime/src/kmp_ftn_entry.h:1408:1: error: aliases are not supported on darwin
KMP_VERSION_SYMBOL(FTN_INIT_NEST_LOCK, 10, "OMP_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))));                    \
                     ^
In file included from external/llvm_openmp/runtime/src/kmp_ftn_cdecl.cpp:31:
external/llvm_openmp/runtime/src/kmp_ftn_entry.h:1409:1: error: aliases are not supported on darwin
KMP_VERSION_SYMBOL(FTN_DESTROY_LOCK, 10, "OMP_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))));                    \
                     ^
In file included from external/llvm_openmp/runtime/src/kmp_ftn_cdecl.cpp:31:
external/llvm_openmp/runtime/src/kmp_ftn_entry.h:1410:1: error: aliases are not supported on darwin
KMP_VERSION_SYMBOL(FTN_DESTROY_NEST_LOCK, 10, "OMP_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))));                    \
                     ^
In file included from external/llvm_openmp/runtime/src/kmp_ftn_cdecl.cpp:31:
external/llvm_openmp/runtime/src/kmp_ftn_entry.h:1411:1: error: aliases are not supported on darwin
KMP_VERSION_SYMBOL(FTN_SET_LOCK, 10, "OMP_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))));                    \
                     ^
In file included from external/llvm_openmp/runtime/src/kmp_ftn_cdecl.cpp:31:
external/llvm_openmp/runtime/src/kmp_ftn_entry.h:1412:1: error: aliases are not supported on darwin
KMP_VERSION_SYMBOL(FTN_SET_NEST_LOCK, 10, "OMP_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))));                    \
                     ^
In file included from external/llvm_openmp/runtime/src/kmp_ftn_cdecl.cpp:31:
external/llvm_openmp/runtime/src/kmp_ftn_entry.h:1413:1: error: aliases are not supported on darwin
KMP_VERSION_SYMBOL(FTN_UNSET_LOCK, 10, "OMP_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))));                    \
                     ^
In file included from external/llvm_openmp/runtime/src/kmp_ftn_cdecl.cpp:31:
external/llvm_openmp/runtime/src/kmp_ftn_entry.h:1414:1: error: aliases are not supported on darwin
KMP_VERSION_SYMBOL(FTN_UNSET_NEST_LOCK, 10, "OMP_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))));                    \
                     ^
In file included from external/llvm_openmp/runtime/src/kmp_ftn_cdecl.cpp:31:
external/llvm_openmp/runtime/src/kmp_ftn_entry.h:1415:1: error: aliases are not supported on darwin
KMP_VERSION_SYMBOL(FTN_TEST_LOCK, 10, "OMP_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))));                    \
                     ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
Target //tensorflow/tools/lib_package:libtensorflow failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 1726.530s, Critical Path: 245.91s
INFO: 4331 processes: 148 internal, 4183 local.
FAILED: Build did NOT complete successfully

Provide the exact sequence of commands / steps that you executed before running into the problem

  1. Intel® oneAPI Base Toolkit (https://software.intel.com/content/www/us/en/develop/tools/oneapi/base-toolkit/download.html?operatingsystem=mac&distributions=webdownload&options=offline).
  2. source /opt/intel/oneapi/setvars.sh
  3. pip install pip numpy wheel
  4. pip install keras_preprocessing --no-deps
  5. git clone https://github.com/tensorflow/tensorflow.git
  6. ./configure
  7. bazelisk build --config=mkl -c opt --copt=-march=native //tensorflow/tools/lib_package:libtensorflow

Any other info / logs None

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 30 (8 by maintainers)

Most upvoted comments

Big Sur 11.3 with XCode 12.5 has exactly same issues that do not seem to be addressed yet.

Any update on this thread please? I am on Macbook pro 2017, Big Sur Version 11.4. Do I need to install oneDNN via Intel® oneAPI Base Toolkit (https://software.intel.com/content/www/us/en/develop/tools/oneapi/base-toolkit/download.html?operatingsystem=mac&distributions=webdownload&options=offline)? I thought this is already supported.

What do you want? MKL/oneAPI or mkl_dnn/oneDNN only? The former, yes, you have to download it. And I don’t think it’s well-tested and supported. The latter, something like bazel build --config opt //tensorflow/tools/pip_package:build_pip_package should download necessary mkldnn source code for you.