@@ -11,7 +11,7 @@ find_package(Protobuf REQUIRED)
1111
1212# Check protobuf library version.
1313execute_process (COMMAND ${PROTOBUF_PROTOC_EXECUTABLE} --version
14- OUTPUT_VARIABLE PROTOBUF_VERSION)
14+ OUTPUT_VARIABLE PROTOBUF_VERSION)
1515string (REPLACE "libprotoc " "" PROTOBUF_VERSION ${PROTOBUF_VERSION} )
1616
1717set (PROTOBUF_3 OFF )
@@ -51,13 +51,7 @@ option(ON_TRAVIS "Running test on travis-ci or not." OFF)
5151option (ON_COVERALLS "Generating code coverage data on coveralls or not." OFF )
5252option (COVERALLS_UPLOAD "Uploading the generated coveralls json." ON )
5353
54- if (NOT CMAKE_BUILD_TYPE )
55- set (CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING
56- "Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel"
57- FORCE)
58- endif ()
5954
60- include (enableCXX11)
6155include (cpplint)
6256include (ccache)
6357if (WITH_RDMA)
@@ -75,42 +69,37 @@ include(coveralls)
7569find_package (Git REQUIRED)
7670# version.cmake will get the current PADDLE_VERSION
7771include (version )
78- add_definitions (-DPADDLE_VERSION=\"${PADDLE_VERSION} \")
79-
72+ add_definitions (-DPADDLE_VERSION=${PADDLE_VERSION} )
8073
8174if (NOT WITH_GPU)
8275 add_definitions (-DPADDLE_ONLY_CPU)
8376 add_definitions (-DHPPL_STUB_FUNC)
77+
8478 list (APPEND CMAKE_CXX_SOURCE_FILE_EXTENSIONS cu)
8579else ()
86- if (${CUDA_VERSION_MAJOR} GREATER 6)
87- if (COMPILER_SUPPORT_CXX11)
88- LIST (APPEND CUDA_NVCC_FLAGS -std=c++11)
89- endif ()
80+ if (${CUDA_VERSION_MAJOR} VERSION_LESS 7)
81+ message (FATAL_ERROR "Paddle need CUDA >= 7.0 to compile" )
9082 endif ()
9183
92- # TODO(yuyang18): Change it to remove std=c++11 in cuda compile.
93- set (CUDA_PROPAGATE_HOST_FLAGS OFF )
9484 if (NOT CUDNN_FOUND)
9585 message (FATAL_ERROR "Paddle need cudnn to compile" )
9686 endif ()
97- set (CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} "-g -O3 --use_fast_math" )
9887
9988 if (WITH_AVX)
10089 set (CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} "-Xcompiler ${AVX_FLAG} " )
10190 else (WITH_AVX)
10291 set (CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} "-Xcompiler ${SSE3_FLAG} " )
10392 endif (WITH_AVX)
10493
105- if (WITH_DSO)
106- add_definitions (-DPADDLE_USE_DSO)
107- endif (WITH_DSO)
108-
10994 # Include cuda and cudnn
11095 include_directories (${CUDNN_INCLUDE_DIR} )
11196 include_directories (${CUDA_TOOLKIT_INCLUDE} )
11297endif (NOT WITH_GPU)
11398
99+ if (WITH_DSO)
100+ add_definitions (-DPADDLE_USE_DSO)
101+ endif (WITH_DSO)
102+
114103if (WITH_DOUBLE)
115104 add_definitions (-DPADDLE_TYPE_DOUBLE)
116105 set (ACCURACY double)
@@ -180,5 +169,4 @@ add_subdirectory(paddle)
180169add_subdirectory (python)
181170if (WITH_DOC)
182171 add_subdirectory (doc )
183- add_subdirectory (doc_cn)
184172endif ()
0 commit comments