New to bazel/tf. How can tensorflow be built from source using a custom llvm toolchain with musl on ubuntu 22 (glibc based)?

Hi all,

I am a total noob when it comes to bazel and tensorflow. I would like to produce a wheel for a custom llvm toolchain using musl. The build system is ubuntu based so glibc. How do I achieve this? Thanks a lot!

Cheers,

Cosmin

Hi @Cosmin_Basca, Building TensorFlow with a custom musl-based LLVM toolchain on Ubuntu involves cross-compilation.

  1. First, Install the standard build dependencies and Bazel
  2. Build and Install your Custom LLVM/musl Toolchain
  3. Clone the TensorFlow source code
  4. Create a custom toolchain configuration. Refer to this Bazel C++ Toolchain Configuration tutorial
  5. Configure TensorFlow build
  6. Add a build configuration (--config=musl ) to your .bazelrc file
  7. Generate and Install the Wheel.