Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
机器未来
Paddle
提交
d6cb1a41
P
Paddle
项目概览
机器未来
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
d6cb1a41
编写于
8月 30, 2019
作者:
L
liuwei1031
提交者:
GitHub
8月 30, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add dynamic C runtime support on windows, test=develop (#19502)
上级
6d99842b
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
26 addition
and
12 deletion
+26
-12
CMakeLists.txt
CMakeLists.txt
+11
-4
cmake/external/protobuf.cmake
cmake/external/protobuf.cmake
+1
-0
cmake/flags.cmake
cmake/flags.cmake
+1
-1
paddle/fluid/inference/api/demo_ci/CMakeLists.txt
paddle/fluid/inference/api/demo_ci/CMakeLists.txt
+9
-7
paddle/fluid/platform/init.cc
paddle/fluid/platform/init.cc
+4
-0
未找到文件。
CMakeLists.txt
浏览文件 @
d6cb1a41
...
@@ -27,13 +27,20 @@ message(STATUS "C compiler: ${CMAKE_C_COMPILER}, version: "
...
@@ -27,13 +27,20 @@ message(STATUS "C compiler: ${CMAKE_C_COMPILER}, version: "
message
(
STATUS
"AR tools:
${
CMAKE_AR
}
"
)
message
(
STATUS
"AR tools:
${
CMAKE_AR
}
"
)
if
(
WIN32
)
if
(
WIN32
)
option
(
MSVC_STATIC_CRT
"use static C Runtime library by default"
ON
)
set
(
CMAKE_SUPPRESS_REGENERATION ON
)
set
(
CMAKE_SUPPRESS_REGENERATION ON
)
set
(
CMAKE_STATIC_LIBRARY_PREFIX lib
)
set
(
CMAKE_STATIC_LIBRARY_PREFIX lib
)
add_definitions
(
"/DGOOGLE_GLOG_DLL_DECL="
)
add_definitions
(
"/DGOOGLE_GLOG_DLL_DECL="
)
if
(
MSVC_STATIC_CRT
)
message
(
STATUS
"Use static C runtime time, refer to https://docs.microsoft.com/en-us/cpp/c-runtime-library/crt-library-features?view=vs-2019"
)
set
(
CMAKE_C_FLAGS_DEBUG
"
${
CMAKE_C_FLAGS_DEBUG
}
/bigobj /MTd"
)
set
(
CMAKE_C_FLAGS_DEBUG
"
${
CMAKE_C_FLAGS_DEBUG
}
/bigobj /MTd"
)
set
(
CMAKE_C_FLAGS_RELEASE
"
${
CMAKE_C_FLAGS_RELEASE
}
/bigobj /MT"
)
set
(
CMAKE_C_FLAGS_RELEASE
"
${
CMAKE_C_FLAGS_RELEASE
}
/bigobj /MT"
)
set
(
CMAKE_CXX_FLAGS_DEBUG
"
${
CMAKE_CXX_FLAGS_DEBUG
}
/bigobj /MTd"
)
set
(
CMAKE_CXX_FLAGS_DEBUG
"
${
CMAKE_CXX_FLAGS_DEBUG
}
/bigobj /MTd"
)
set
(
CMAKE_CXX_FLAGS_RELEASE
"
${
CMAKE_CXX_FLAGS_RELEASE
}
/bigobj /MT"
)
set
(
CMAKE_CXX_FLAGS_RELEASE
"
${
CMAKE_CXX_FLAGS_RELEASE
}
/bigobj /MT"
)
endif
()
add_compile_options
(
/wd4068 /wd4129 /wd4244 /wd4267 /wd4297 /wd4530 /wd4577 /wd4819 /wd4838
)
add_compile_options
(
/wd4068 /wd4129 /wd4244 /wd4267 /wd4297 /wd4530 /wd4577 /wd4819 /wd4838
)
set
(
PADDLE_LINK_FLAGS
"/IGNORE:4006 /IGNORE:4098 /IGNORE:4217 /IGNORE:4221"
)
set
(
PADDLE_LINK_FLAGS
"/IGNORE:4006 /IGNORE:4098 /IGNORE:4217 /IGNORE:4221"
)
set
(
CMAKE_STATIC_LINKER_FLAGS
"
${
CMAKE_STATIC_LINKER_FLAGS
}
${
PADDLE_LINK_FLAGS
}
"
)
set
(
CMAKE_STATIC_LINKER_FLAGS
"
${
CMAKE_STATIC_LINKER_FLAGS
}
${
PADDLE_LINK_FLAGS
}
"
)
...
...
cmake/external/protobuf.cmake
浏览文件 @
d6cb1a41
...
@@ -222,6 +222,7 @@ FUNCTION(build_protobuf TARGET_NAME BUILD_FOR_HOST)
...
@@ -222,6 +222,7 @@ FUNCTION(build_protobuf TARGET_NAME BUILD_FOR_HOST)
-DCMAKE_INSTALL_PREFIX=
${
PROTOBUF_INSTALL_DIR
}
-DCMAKE_INSTALL_PREFIX=
${
PROTOBUF_INSTALL_DIR
}
-DCMAKE_INSTALL_LIBDIR=lib
-DCMAKE_INSTALL_LIBDIR=lib
-DBUILD_SHARED_LIBS=OFF
-DBUILD_SHARED_LIBS=OFF
-Dprotobuf_MSVC_STATIC_RUNTIME=
${
MSVC_STATIC_CRT
}
CMAKE_CACHE_ARGS
CMAKE_CACHE_ARGS
-DCMAKE_INSTALL_PREFIX:PATH=
${
PROTOBUF_INSTALL_DIR
}
-DCMAKE_INSTALL_PREFIX:PATH=
${
PROTOBUF_INSTALL_DIR
}
-DCMAKE_BUILD_TYPE:STRING=
${
THIRD_PARTY_BUILD_TYPE
}
-DCMAKE_BUILD_TYPE:STRING=
${
THIRD_PARTY_BUILD_TYPE
}
...
...
cmake/flags.cmake
浏览文件 @
d6cb1a41
...
@@ -204,7 +204,7 @@ foreach(flag ${GPU_COMMON_FLAGS})
...
@@ -204,7 +204,7 @@ foreach(flag ${GPU_COMMON_FLAGS})
safe_set_nvflag
(
${
flag
}
)
safe_set_nvflag
(
${
flag
}
)
endforeach
()
endforeach
()
if
(
WIN32
)
if
(
WIN32
AND MSVC_STATIC_CRT
)
# windows build turn off warnings.
# windows build turn off warnings.
safe_set_static_flag
()
safe_set_static_flag
()
foreach
(
flag_var
foreach
(
flag_var
...
...
paddle/fluid/inference/api/demo_ci/CMakeLists.txt
浏览文件 @
d6cb1a41
...
@@ -44,6 +44,7 @@ link_directories("${PADDLE_LIB}/paddle/lib")
...
@@ -44,6 +44,7 @@ link_directories("${PADDLE_LIB}/paddle/lib")
if
(
WIN32
)
if
(
WIN32
)
add_definitions
(
"/DGOOGLE_GLOG_DLL_DECL="
)
add_definitions
(
"/DGOOGLE_GLOG_DLL_DECL="
)
if
(
MSVC_STATIC_CRT
)
set
(
CMAKE_C_FLAGS_DEBUG
"
${
CMAKE_C_FLAGS_DEBUG
}
/bigobj /MTd"
)
set
(
CMAKE_C_FLAGS_DEBUG
"
${
CMAKE_C_FLAGS_DEBUG
}
/bigobj /MTd"
)
set
(
CMAKE_C_FLAGS_RELEASE
"
${
CMAKE_C_FLAGS_RELEASE
}
/bigobj /MT"
)
set
(
CMAKE_C_FLAGS_RELEASE
"
${
CMAKE_C_FLAGS_RELEASE
}
/bigobj /MT"
)
set
(
CMAKE_CXX_FLAGS_DEBUG
"
${
CMAKE_CXX_FLAGS_DEBUG
}
/bigobj /MTd"
)
set
(
CMAKE_CXX_FLAGS_DEBUG
"
${
CMAKE_CXX_FLAGS_DEBUG
}
/bigobj /MTd"
)
...
@@ -52,6 +53,7 @@ if (WIN32)
...
@@ -52,6 +53,7 @@ if (WIN32)
safe_set_static_flag
()
safe_set_static_flag
()
add_definitions
(
-DSTATIC_LIB
)
add_definitions
(
-DSTATIC_LIB
)
endif
()
endif
()
endif
()
else
()
else
()
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-std=c++11"
)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-std=c++11"
)
endif
()
endif
()
...
...
paddle/fluid/platform/init.cc
浏览文件 @
d6cb1a41
...
@@ -44,6 +44,10 @@ DEFINE_int32(multiple_of_cupti_buffer_size, 1,
...
@@ -44,6 +44,10 @@ DEFINE_int32(multiple_of_cupti_buffer_size, 1,
namespace
paddle
{
namespace
paddle
{
namespace
framework
{
namespace
framework
{
#ifdef _WIN32
#define strdup _strdup
#endif
std
::
once_flag
gflags_init_flag
;
std
::
once_flag
gflags_init_flag
;
std
::
once_flag
p2p_init_flag
;
std
::
once_flag
p2p_init_flag
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录