From 3ce10dba15f7d0ac6f3a4e45e59550ac58563eff Mon Sep 17 00:00:00 2001
From: Tao Luo <luotao02@baidu.com>
Date: Mon, 21 Jan 2019 18:56:16 +0800
Subject: [PATCH] remove legacy USE_NNPACK option

---
 CMakeLists.txt              |  6 ------
 cmake/external/nnpack.cmake | 30 ------------------------------
 2 files changed, 36 deletions(-)
 delete mode 100644 cmake/external/nnpack.cmake

diff --git a/CMakeLists.txt b/CMakeLists.txt
index de62382b78..37bc1743e2 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -60,7 +60,6 @@ option(ON_TRAVIS        "Exclude special unit test on Travis CI"        OFF)
 option(WITH_FLUID_ONLY  "Compile PaddlePaddle fluid only"               OFF)
 option(WITH_GOLANG      "Compile PaddlePaddle with GOLANG"              OFF)
 option(GLIDE_INSTALL    "Download and install go dependencies "         ON)
-option(USE_NNPACK       "Compile PaddlePaddle with NNPACK library"      OFF)
 option(WITH_DISTRIBUTE  "Compile with distributed support"              OFF)
 option(WITH_PSLIB       "Compile with pslib support"                    OFF)
 option(USE_EIGEN_FOR_BLAS   "Use matrix multiplication in Eigen"        OFF)
@@ -283,11 +282,6 @@ if(WITH_MKLDNN)
     list(APPEND EXTERNAL_LIBS ${MKLDNN_LIB})
 endif()
 
-if(USE_NNPACK)
-    include(external/nnpack)
-    list(APPEND EXTERNAL_LIBS ${NNPACK_LIBS})
-endif(USE_NNPACK)
-
 set(PADDLE_PYTHON_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}/python/build")
 
 set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O3 -g -DNDEBUG")
diff --git a/cmake/external/nnpack.cmake b/cmake/external/nnpack.cmake
deleted file mode 100644
index d42bcb0f32..0000000000
--- a/cmake/external/nnpack.cmake
+++ /dev/null
@@ -1,30 +0,0 @@
-# Find the NNPACK library
-#  NNPACK_ROOT - where to find NNPACK include and library.
-#
-
-set(NNPACK_FOUND OFF)
-set(NNPACK_ROOT $ENV{NNPACK_ROOT} CACHE PATH "Folder contains NNPACK")
-find_path(NNPACK_INC_DIR nnpack.h PATHS ${NNPACK_ROOT}/include)
-find_library(NNPACK_LIB NAMES nnpack PATHS ${NNPACK_ROOT}/lib)
-find_library(PTHREADPOOL_LIB NAMES pthreadpool PATHS ${NNPACK_ROOT}/lib)
-find_library(NNPACK_UKERNELS_LIB NAMES nnpack_ukernels PATHS ${NNPACK_ROOT}/lib)
-find_library(NNPACK_CPUFEATURES_LIB NAMES cpufeatures PATHS ${NNPACK_ROOT}/lib)
-
-if(NNPACK_INC_DIR AND NNPACK_LIB AND PTHREADPOOL_LIB)
-  set(NNPACK_FOUND ON)
-  INCLUDE_DIRECTORIES(${NNPACK_INC_DIR})
-
-  set(NNPACK_LIBS)
-  list(APPEND NNPACK_LIBS ${NNPACK_LIB} ${PTHREADPOOL_LIB})
-  if (NNPACK_UKERNELS_LIB)
-    list(APPEND NNPACK_LIBS ${NNPACK_UKERNELS_LIB})
-  endif()
-  if (NNPACK_CPUFEATURES_LIB)
-    list(APPEND NNPACK_LIBS ${NNPACK_CPUFEATURES_LIB})
-  endif()
-  if(NOT ANDROID)
-    list(APPEND NNPACK_LIBS "rt")
-  endif()
-else()
-  message(FATAL_ERROR "Cannot find NNPACK in (${NNPACK_ROOT})")
-endif()
-- 
GitLab