Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
26b2996b
P
Paddle
项目概览
PaddlePaddle
/
Paddle
1 年多 前同步成功
通知
2302
Star
20931
Fork
5422
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1423
列表
看板
标记
里程碑
合并请求
543
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1,423
Issue
1,423
列表
看板
标记
里程碑
合并请求
543
合并请求
543
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
26b2996b
编写于
12月 05, 2016
作者:
L
liaogang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Upgrade compiler‘s minimum version
* for modern language properties
上级
9ffa434b
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
45 addition
and
30 deletion
+45
-30
CMakeLists.txt
CMakeLists.txt
+2
-11
cmake/enableCXX11.cmake
cmake/enableCXX11.cmake
+0
-13
cmake/flags.cmake
cmake/flags.cmake
+43
-3
paddle/cuda/CMakeLists.txt
paddle/cuda/CMakeLists.txt
+0
-3
未找到文件。
CMakeLists.txt
浏览文件 @
26b2996b
...
...
@@ -51,13 +51,7 @@ option(ON_TRAVIS "Running test on travis-ci or not." OFF)
option
(
ON_COVERALLS
"Generating code coverage data on coveralls or not."
OFF
)
option
(
COVERALLS_UPLOAD
"Uploading the generated coveralls json."
ON
)
if
(
NOT CMAKE_BUILD_TYPE
)
set
(
CMAKE_BUILD_TYPE
"RelWithDebInfo"
CACHE STRING
"Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel"
FORCE
)
endif
()
include
(
enableCXX11
)
include
(
cpplint
)
include
(
ccache
)
if
(
WITH_RDMA
)
...
...
@@ -84,17 +78,14 @@ if(NOT WITH_GPU)
list
(
APPEND CMAKE_CXX_SOURCE_FILE_EXTENSIONS cu
)
else
()
if
(
${
CUDA_VERSION_MAJOR
}
GREATER 6
)
if
(
COMPILER_SUPPORT_CXX11
)
LIST
(
APPEND CUDA_NVCC_FLAGS -std=c++11
)
endif
()
endif
()
# TODO(yuyang18): Change it to remove std=c++11 in cuda compile.
set
(
CUDA_PROPAGATE_HOST_FLAGS OFF
)
if
(
NOT CUDNN_FOUND
)
message
(
FATAL_ERROR
"Paddle need cudnn to compile"
)
endif
()
set
(
CUDA_NVCC_FLAGS
${
CUDA_NVCC_FLAGS
}
"-g -O3 --use_fast_math"
)
if
(
WITH_AVX
)
set
(
CUDA_NVCC_FLAGS
${
CUDA_NVCC_FLAGS
}
"-Xcompiler
${
AVX_FLAG
}
"
)
...
...
cmake/enableCXX11.cmake
已删除
100644 → 0
浏览文件 @
9ffa434b
# Enable C++ 11 for GCC.
# NOTE: It's only tested for gcc.
include
(
CheckCXXCompilerFlag
)
CHECK_CXX_COMPILER_FLAG
(
"-std=c++11"
COMPILER_SUPPORT_CXX11
)
CHECK_CXX_COMPILER_FLAG
(
"-std=c++0x"
COMPILER_SUPPORT_CXX0X
)
if
(
COMPILER_SUPPORT_CXX11
)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-std=c++11"
)
elseif
(
COMPILER_SUPPORT_CXX0X
)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-std=c++0x"
)
else
()
message
(
FATAL_ERROR
"Your compiler must support c++11"
)
endif
()
\ No newline at end of file
cmake/flags.cmake
浏览文件 @
26b2996b
...
...
@@ -2,6 +2,37 @@
include
(
CheckCXXCompilerFlag
)
include
(
CheckCCompilerFlag
)
include
(
CheckCXXSymbolExists
)
if
(
NOT CMAKE_BUILD_TYPE
)
set
(
CMAKE_BUILD_TYPE
"RelWithDebInfo"
CACHE STRING
"Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel"
FORCE
)
endif
()
function
(
CheckCompilerCXX11Flag
)
if
(
CMAKE_CXX_COMPILER_ID STREQUAL
"GNU"
)
if
(
${
CMAKE_CXX_COMPILER_VERSION
}
VERSION_LESS 4.8
)
message
(
FATAL_ERROR
"Unsupported GCC version. GCC >= 4.8 required."
)
endif
()
elseif
(
CMAKE_CXX_COMPILER_ID STREQUAL
"AppleClang"
OR CMAKE_CXX_COMPILER_ID STREQUAL
"Clang"
)
# cmake >= 3.0 compiler id "AppleClang" on Mac OS X, otherwise "Clang"
# Apple Clang is a different compiler than upstream Clang which havs different version numbers.
# https://gist.github.com/yamaya/2924292
if
(
APPLE
)
# cmake < 3.0 compiler id "Clang" on Mac OS X
if
(
${
CMAKE_CXX_COMPILER_VERSION
}
VERSION_LESS 5.1
)
message
(
FATAL_ERROR
"Unsupported AppleClang version. AppleClang >= 5.1 required."
)
endif
()
else
()
if
(
${
CMAKE_CXX_COMPILER_VERSION
}
VERSION_LESS 3.3
)
message
(
FATAL_ERROR
"Unsupported Clang version. Clang >= 3.3 required."
)
endif
()
endif
()
endif
()
endfunction
()
CheckCompilerCXX11Flag
()
LIST
(
APPEND CMAKE_CXX_FLAGS -std=c++11
)
# safe_set_flag
#
# Set a compile flag only if compiler is support
...
...
@@ -41,9 +72,7 @@ macro(safe_set_nvflag flag_name)
CHECK_C_COMPILER_FLAG
(
${
flag_name
}
C_COMPILER_SUPPORT_FLAG_
${
safe_name
}
)
set
(
safe_name C_COMPILER_SUPPORT_FLAG_
${
safe_name
}
)
if
(
${
safe_name
}
)
set
(
CUDA_NVCC_FLAGS
--compiler-options;
${
flag_name
}
${
CUDA_NVCC_FLAGS
}
)
LIST
(
APPEND CUDA_NVCC_FLAGS -Xcompiler
${
flag_name
}
)
endif
()
endmacro
()
...
...
@@ -111,6 +140,17 @@ endforeach()
# Release/Debug flags set by cmake. Such as -O3 -g -DNDEBUG etc.
# So, don't set these flags here.
LIST
(
APPEND CUDA_NVCC_FLAGS --use_fast_math
)
if
(
CMAKE_BUILD_TYPE STREQUAL
"Debug"
)
LIST
(
APPEND CUDA_NVCC_FLAGS
${
CMAKE_CXX_FLAGS_DEBUG
}
)
elseif
(
CMAKE_BUILD_TYPE STREQUAL
"Release"
)
LIST
(
APPEND CUDA_NVCC_FLAGS
${
CMAKE_CXX_FLAGS_RELEASE
}
)
elseif
(
CMAKE_BUILD_TYPE STREQUAL
"RelWithDebInfo"
)
LIST
(
APPEND CUDA_NVCC_FLAGS
${
CMAKE_CXX_FLAGS_RELWITHDEBINFO
}
)
elseif
(
CMAKE_BUILD_TYPE STREQUAL
"MinSizeRel"
)
LIST
(
APPEND CUDA_NVCC_FLAGS
${
CMAKE_CXX_FLAGS_MINSIZEREL
}
)
endif
()
function
(
specify_cuda_arch cuda_version cuda_arch
)
if
(
${
cuda_version
}
VERSION_GREATER
"8.0"
)
...
...
paddle/cuda/CMakeLists.txt
浏览文件 @
26b2996b
...
...
@@ -22,9 +22,6 @@ set(CUDA_CXX_WITH_GPU_SOURCES
set_source_files_properties
(
${
CUDA_CXX_WITH_GPU_SOURCES
}
PROPERTIES COMPILE_FLAGS
"-D__NVCC__"
)
set_source_files_properties
(
${
AVX_SOURCES
}
PROPERTIES COMPILE_FLAGS
"-mavx"
)
set
(
CUDA_DSO_SOURCES
src/hl_dso_loader.cc
src/hl_cudart_wrap.cc
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录