[all-commits] [llvm/llvm-project] e72d79: Guard `find_library(tensorflow_c_api ...)` by chec...

Mehdi Amini via All-commits all-commits at lists.llvm.org
Mon Sep 28 15:16:18 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: e72d792c147ee506e337401e20c0f23042cc43fe
      https://github.com/llvm/llvm-project/commit/e72d792c147ee506e337401e20c0f23042cc43fe
  Author: Mehdi Amini <joker.eph at gmail.com>
  Date:   2020-09-28 (Mon, 28 Sep 2020)

  Changed paths:
    M llvm/CMakeLists.txt

  Log Message:
  -----------
  Guard `find_library(tensorflow_c_api ...)` by checking for TENSORFLOW_C_LIB_PATH to be set by the user

Also have CMake fails if the user provides a TENSORFLOW_C_LIB_PATH but
we can't find TensorFlow at this path.

At the moment the CMake script tries to figure if TensorFlow is
available on the system and enables support for it. This is in general
not desirable to customize build features this way and instead it is
preferable to let the user opt-in explicitly into the features they want
to enable. This is in line with other optional external dependencies
like Z3.
There are a few reasons to this but amongst others:
- reproducibility: making features "magically" enabled based on whether
  we find a package on the system or not makes it harder to handle bug
  reports from users.
- user control: they can't have TensorFlow on the system and build LLVM
  without TensorFlow right now. They also would suddenly distribute LLVM
  with a different set of features unknowingly just because their build
  machine environment would change subtly.

Right now this is motivated by a user reporting build failures on their system:

.../mesa-git/llvm-git/src/llvm-project/llvm/lib/Analysis/TFUtils.cpp:23:10: fatal error: tensorflow/c/c_api.h: No such file or directory
   23 | #include "tensorflow/c/c_api.h"
      |          ^~~~~~

It looks like we detected TensorFlow at configure time but couldn't set all the paths correctly.

Differential Revision: https://reviews.llvm.org/D88371




More information about the All-commits mailing list