From 0a180584e6f907af43a32764fcb2f63d69672c33 Mon Sep 17 00:00:00 2001 From: dzhwinter Date: Thu, 1 Nov 2018 23:44:41 +0800 Subject: [PATCH] clean cmake. test=develop --- CMakeLists.txt | 1 - cmake/external/warpctc.cmake | 7 +++---- cmake/flags.cmake | 2 ++ cmake/generic.cmake | 4 ++-- paddle/fluid/platform/CMakeLists.txt | 7 ------- 5 files changed, 7 insertions(+), 14 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ff8e2ec8d6b..e37afa3ec71 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -34,7 +34,6 @@ if(NOT CMAKE_CROSSCOMPILING) endif(NOT CMAKE_CROSSCOMPILING) find_package(Git REQUIRED) find_package(Threads REQUIRED) -include(flags) # set paddle compile flags include(simd) ################################ Configurations ####################################### diff --git a/cmake/external/warpctc.cmake b/cmake/external/warpctc.cmake index 63dbee9c400..07e1137e16a 100644 --- a/cmake/external/warpctc.cmake +++ b/cmake/external/warpctc.cmake @@ -34,9 +34,7 @@ IF(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "App ELSE() SET(USE_OMP ON) ENDIF() -message("warpctc") -message(${CMAKE_CXX_COMPILER}) -message(${CMAKE_CXX_FLAGS}) + ExternalProject_Add( extern_warpctc ${EXTERNAL_PROJECT_LOG_ARGS} @@ -45,7 +43,8 @@ ExternalProject_Add( UPDATE_COMMAND "" CMAKE_ARGS -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} - -DCMAKE_CXX_FLAGS="" + -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS} + -DCMAKE_C_FLAGS=${CMAKE_C_FLAGS} -DCMAKE_INSTALL_PREFIX=${WARPCTC_INSTALL_DIR} -DWITH_GPU=${WITH_GPU} -DWITH_OMP=${USE_OMP} diff --git a/cmake/flags.cmake b/cmake/flags.cmake index 0476d2f5983..a652b844c65 100644 --- a/cmake/flags.cmake +++ b/cmake/flags.cmake @@ -119,6 +119,7 @@ set(COMMON_FLAGS -Werror -Wall -Wextra + -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wno-unused-parameter -Wno-unused-function @@ -166,6 +167,7 @@ endif(APPLE) if(LINUX) set(GPU_COMMON_FLAGS -Wall + -Werror -Wextra ${GPU_COMMON_FLAGS}) endif(LINUX) diff --git a/cmake/generic.cmake b/cmake/generic.cmake index e29e69165ff..7421a012a12 100644 --- a/cmake/generic.cmake +++ b/cmake/generic.cmake @@ -308,8 +308,8 @@ function(cc_test TARGET_NAME) set(multiValueArgs SRCS DEPS ARGS) cmake_parse_arguments(cc_test "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) add_executable(${TARGET_NAME} ${cc_test_SRCS}) - if(WIN32) - target_link_libraries(${TARGET_NAME} ${cc_test_DEPS} paddle_gtest_main lod_tensor memory gtest gflags glog shlwapi openblas) + if(WIN32) # in windows deps. shlwapi library. + target_link_libraries(${TARGET_NAME} ${cc_test_DEPS} paddle_gtest_main lod_tensor memory gtest gflags glog shlwapi) else(WIN32) target_link_libraries(${TARGET_NAME} ${cc_test_DEPS} paddle_gtest_main lod_tensor memory gtest gflags glog) endif(WIN32) diff --git a/paddle/fluid/platform/CMakeLists.txt b/paddle/fluid/platform/CMakeLists.txt index 33c40d5a3f5..5af8af640e4 100644 --- a/paddle/fluid/platform/CMakeLists.txt +++ b/paddle/fluid/platform/CMakeLists.txt @@ -27,12 +27,6 @@ ENDIF() cc_library(cpu_info SRCS cpu_info.cc DEPS ${CPU_INFO_DEPS}) cc_test(cpu_info_test SRCS cpu_info_test.cc DEPS cpu_info) -set(CUDA_LIB "C:\\Program\ Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v8.0\\lib\\x64") -set(MYDEPS ${MYDEPS} libcmt shlwapi) -set(MYDEPS ${MYDEPS} ${CUDA_LIB}/cudart${CMAKE_STATIC_LIBRARY_SUFFIX}) -set(MYDEPS ${MYDEPS} ${CUDA_LIB}/cublas${CMAKE_STATIC_LIBRARY_SUFFIX}) -set(MYDEPS ${MYDEPS} ${CUDA_LIB}/cudnn${CMAKE_STATIC_LIBRARY_SUFFIX}) - nv_library(gpu_info SRCS gpu_info.cc DEPS gflags glog enforce) cc_library(place SRCS place.cc DEPS enforce boost) @@ -64,7 +58,6 @@ nv_test(device_context_test SRCS device_context_test.cu DEPS device_context gpu_ cc_test(init_test SRCS init_test.cc DEPS device_context) nv_test(cudnn_helper_test SRCS cudnn_helper_test.cc DEPS dynload_cuda) -target_link_libraries(cudnn_helper_test ${MYDEPS}) nv_test(transform_test SRCS transform_test.cu DEPS memory place device_context) -- GitLab