[llvm] 842b0d0 - [mlgo] Remove TENSORFLOW_C_LIB_PATH
Kazu Hirata via llvm-commits
llvm-commits at lists.llvm.org
Mon Dec 12 11:28:48 PST 2022
Author: Kazu Hirata
Date: 2022-12-12T11:28:38-08:00
New Revision: 842b0d0fe2dd142305a9461e50cdce9aff7f86bc
URL: https://github.com/llvm/llvm-project/commit/842b0d0fe2dd142305a9461e50cdce9aff7f86bc
DIFF: https://github.com/llvm/llvm-project/commit/842b0d0fe2dd142305a9461e50cdce9aff7f86bc.diff
LOG: [mlgo] Remove TENSORFLOW_C_LIB_PATH
We use LLVM_HAVE_TFLITE as the key to enable the MLGO bits. We do not
use the "else" clause.
Differential Revision: https://reviews.llvm.org/D139860
Added:
Modified:
llvm/CMakeLists.txt
Removed:
################################################################################
diff --git a/llvm/CMakeLists.txt b/llvm/CMakeLists.txt
index 6a86d5065c8d..8191b27e99f0 100644
--- a/llvm/CMakeLists.txt
+++ b/llvm/CMakeLists.txt
@@ -980,7 +980,6 @@ endif()
# For up-to-date instructions for installing the TFLite dependency, refer to
# the bot setup script: https://github.com/google/ml-compiler-opt/blob/main/buildbot/buildbot_init.sh
-set(TENSORFLOW_C_LIB_PATH "" CACHE PATH "Path to TensorFlow C library install")
set(LLVM_HAVE_TFLITE "" CACHE BOOL "Use tflite")
if (LLVM_HAVE_TFLITE)
find_package(protobuf REQUIRED)
@@ -988,28 +987,6 @@ if (LLVM_HAVE_TFLITE)
set(LLVM_HAVE_TF_API "ON" CACHE BOOL "Full Tensorflow API available")
set(LLVM_PROTOBUF_OUT_DIR ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/protobuf_gen)
include_directories(${LLVM_PROTOBUF_OUT_DIR})
-elseif (TENSORFLOW_C_LIB_PATH)
- find_library(tensorflow_c_api tensorflow PATHS ${TENSORFLOW_C_LIB_PATH}/lib NO_DEFAULT_PATH REQUIRED)
- # Currently, the protobuf headers are distributed with the pip package that corresponds to the version
- # of the C API library.
- find_library(tensorflow_fx tensorflow_framework PATHS ${TENSORFLOW_C_LIB_PATH}/lib NO_DEFAULT_PATH REQUIRED)
- set(LLVM_HAVE_TF_API "ON" CACHE BOOL "Full Tensorflow API available")
- include_directories(${TENSORFLOW_C_LIB_PATH}/include)
- if (NOT TF_PROTO_HEADERS)
- message(STATUS "TF_PROTO_HEADERS not defined. Looking for tensorflow pip package.")
- execute_process(COMMAND
- ${Python3_EXECUTABLE} "-c" "import tensorflow as tf; import os; print(os.path.dirname(tf.__file__))"
- OUTPUT_VARIABLE TF_PIP)
- if ("${TF_PIP}" STREQUAL "")
- message(FATAL ERROR "Tensorflow pip package is also required for 'development' mode (protobuf headers)")
- endif()
- string(STRIP ${TF_PIP} TF_PIP)
- set(TF_PROTO_HEADERS "${TF_PIP}/include")
- endif()
- message(STATUS "Using Tensorflow headers under: ${TF_PROTO_HEADERS}")
- include_directories(${TF_PROTO_HEADERS})
- add_definitions("-DGOOGLE_PROTOBUF_NO_RTTI")
- add_definitions("-D_GLIBCXX_USE_CXX11_ABI=0")
endif()
# For up-to-date instructions for installing the Tensorflow dependency, refer to
More information about the llvm-commits
mailing list