Tensorflow macOS Universal Binary

Hi there, I’m new to tensorflow and I would like to use it in my project.
I was wondering if there is a way to build tensorlfow C++ libraries universal binary for both arm64 and x86_64 for macOS.

Hi @Fabrizio_Cheloni

Welcome to the TensorFlow Forum!

You can use the Bazel build tool to build a universal binary for the TensorFlow C++ libraries that can be used on both arm64 and x86_64 macOS devices.

bazel build --config opt --cpu=darwin_arm64 --host_cpu=darwin_arm64 //tensorflow/tools/lib_package:libtensorflow

(For both M1 Macs and Intel Macs.)

bazel build --config opt --cpu=darwin_arm64 --host_cpu=darwin_x86_64 //tensorflow/tools/lib_package:libtensorflow

Please have a look at this similar issue for your reference. Thank you.