From 494f5a836b8d0714b57d3f711715e4442334906a Mon Sep 17 00:00:00 2001 From: Yu Yang Date: Mon, 19 Sep 2016 17:13:44 +0800 Subject: [PATCH] Add findZLIB in cmake * Also fix a bug, we should link -ldl at last --- CMakeLists.txt | 3 ++- cmake/util.cmake | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 007f1f18b..1bb73f8b9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,7 +14,8 @@ find_package(CUDA QUIET) find_package(Protobuf REQUIRED) find_package(PythonLibs 2.7 REQUIRED) find_package(PythonInterp 2.7 REQUIRED) -find_package(NumPy) +find_package(ZLIB REQUIRED) +find_package(NumPy REQUIRED) find_package(Threads REQUIRED) find_package(Glog) find_package(Gflags QUIET) diff --git a/cmake/util.cmake b/cmake/util.cmake index e0e372fed..5b5630465 100644 --- a/cmake/util.cmake +++ b/cmake/util.cmake @@ -67,9 +67,9 @@ function(link_paddle_exe TARGET_NAME) ${PROTOBUF_LIBRARY} ${CMAKE_THREAD_LIBS_INIT} ${CBLAS_LIBS} - ${CMAKE_DL_LIBS} + ${ZLIB_LIBRARIES} ${INTERAL_LIBS} - -lz) + ${CMAKE_DL_LIBS}) if(WITH_PYTHON) target_link_libraries(${TARGET_NAME} -- GitLab