Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
f28dc9a6
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看板
提交
f28dc9a6
编写于
2月 06, 2018
作者:
L
Luo Tao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refine inference_lib.cmake
上级
8833cfcf
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
65 addition
and
49 deletion
+65
-49
cmake/inference_lib.cmake
cmake/inference_lib.cmake
+65
-49
未找到文件。
cmake/inference_lib.cmake
浏览文件 @
f28dc9a6
# make package for paddle fluid shared and static library
# make package for paddle fluid shared and static library
function
(
copy TARGET
)
set
(
options
""
)
set
(
oneValueArgs
""
)
set
(
multiValueArgs SRCS DSTS DEPS
)
cmake_parse_arguments
(
copy_lib
"
${
options
}
"
"
${
oneValueArgs
}
"
"
${
multiValueArgs
}
"
${
ARGN
}
)
list
(
LENGTH copy_lib_SRCS copy_lib_SRCS_len
)
list
(
LENGTH copy_lib_DSTS copy_lib_DSTS_len
)
if
(
NOT
${
copy_lib_SRCS_len
}
EQUAL
${
copy_lib_DSTS_len
}
)
message
(
FATAL_ERROR
"
${
TARGET
}
source numbers are not equal to destination numbers"
)
endif
()
math
(
EXPR len
"
${
copy_lib_SRCS_len
}
- 1"
)
add_custom_target
(
${
TARGET
}
DEPENDS
${
copy_lib_DEPS
}
)
foreach
(
index RANGE
${
len
}
)
list
(
GET copy_lib_SRCS
${
index
}
src
)
list
(
GET copy_lib_DSTS
${
index
}
dst
)
add_custom_command
(
TARGET
${
TARGET
}
PRE_BUILD COMMAND mkdir -p
"
${
dst
}
"
)
if
(
IS_DIRECTORY
${
src
}
)
add_custom_command
(
TARGET
${
TARGET
}
PRE_BUILD COMMAND cp -r
"
${
src
}
"
"
${
dst
}
"
)
else
()
add_custom_command
(
TARGET
${
TARGET
}
PRE_BUILD COMMAND cp
"
${
src
}
"
"
${
dst
}
"
)
endif
()
endforeach
()
endfunction
()
# third party
# third party
set
(
lib_dir
"
${
CMAKE_INSTALL_PREFIX
}
/third_party/eigen3"
)
set
(
dst_dir
"
${
CMAKE_INSTALL_PREFIX
}
/third_party/eigen3"
)
add_custom_target
(
eigen3_lib
copy
(
eigen3_lib
COMMAND mkdir -p
"
${
lib_dir
}
/Eigen"
"
${
lib_dir
}
/unsupported"
SRCS
${
EIGEN_INCLUDE_DIR
}
/Eigen/Core
${
EIGEN_INCLUDE_DIR
}
/Eigen/src
${
EIGEN_INCLUDE_DIR
}
/unsupported/Eigen
COMMAND cp
"
${
EIGEN_INCLUDE_DIR
}
/Eigen/Core"
"
${
lib_dir
}
/Eigen"
DSTS
${
dst_dir
}
/Eigen
${
dst_dir
}
/Eigen
${
dst_dir
}
/unsupported
COMMAND cp -r
"
${
EIGEN_INCLUDE_DIR
}
/Eigen/src"
"
${
lib_dir
}
/Eigen"
COMMAND cp -r
"
${
EIGEN_INCLUDE_DIR
}
/unsupported/Eigen"
"
${
lib_dir
}
/unsupported"
)
)
set
(
lib_dir
"
${
CMAKE_INSTALL_PREFIX
}
/third_party/install/gflags"
)
set
(
dst_dir
"
${
CMAKE_INSTALL_PREFIX
}
/third_party/install/gflags"
)
add_custom_target
(
gflags_lib
copy
(
gflags_lib
COMMAND mkdir -p
"
${
lib_dir
}
/lib"
SRCS
${
GFLAGS_INCLUDE_DIR
}
${
GFLAGS_LIBRARIES
}
COMMAND cp -r
"
${
GFLAGS_INCLUDE_DIR
}
"
"
${
lib_dir
}
"
DSTS
${
dst_dir
}
${
dst_dir
}
/lib
COMMAND cp
"
${
GFLAGS_LIBRARIES
}
"
"
${
lib_dir
}
/lib"
)
)
set
(
lib_dir
"
${
CMAKE_INSTALL_PREFIX
}
/third_party/install/glog"
)
set
(
dst_dir
"
${
CMAKE_INSTALL_PREFIX
}
/third_party/install/glog"
)
add_custom_target
(
glog_lib
copy
(
glog_lib
COMMAND mkdir -p
"
${
lib_dir
}
/lib"
SRCS
${
GLOG_INCLUDE_DIR
}
${
GLOG_LIBRARIES
}
COMMAND cp -r
"
${
GLOG_INCLUDE_DIR
}
"
"
${
lib_dir
}
"
DSTS
${
dst_dir
}
${
dst_dir
}
/lib
COMMAND cp
"
${
GLOG_LIBRARIES
}
"
"
${
lib_dir
}
/lib"
)
)
IF
(
NOT PROTOBUF_FOUND
)
IF
(
NOT PROTOBUF_FOUND
)
set
(
lib_dir
"
${
CMAKE_INSTALL_PREFIX
}
/third_party/install/protobuf"
)
set
(
dst_dir
"
${
CMAKE_INSTALL_PREFIX
}
/third_party/install/protobuf"
)
add_custom_target
(
protobuf_lib
copy
(
protobuf_lib
COMMAND mkdir -p
"
${
lib_dir
}
/lib"
SRCS
${
PROTOBUF_INCLUDE_DIR
}
${
PROTOBUF_LITE_LIBRARY
}
COMMAND cp -r
"
${
PROTOBUF_INCLUDE_DIR
}
"
"
${
lib_dir
}
"
DSTS
${
dst_dir
}
${
dst_dir
}
/lib
COMMAND cp
"
${
PROTOBUF_LITE_LIBRARY
}
"
"
${
lib_dir
}
/lib"
)
)
ENDIF
(
NOT PROTOBUF_FOUND
)
ENDIF
(
NOT PROTOBUF_FOUND
)
# paddle fluid module
# paddle fluid module
set
(
lib_dir
"
${
CMAKE_INSTALL_PREFIX
}
/paddle/framework
"
)
set
(
src_dir
"
${
PADDLE_SOURCE_DIR
}
/paddle
"
)
add_custom_target
(
framework_lib DEPENDS framework_py_proto
set
(
dst_dir
"
${
CMAKE_INSTALL_PREFIX
}
/paddle"
)
COMMAND mkdir -p
"
${
lib_dir
}
/details"
set
(
module
"framework"
)
COMMAND cp
"
${
PADDLE_SOURCE_DIR
}
/paddle/framework/*.h"
"
${
lib_dir
}
"
copy
(
framework_lib DEPS framework_py_proto
COMMAND cp
"
${
PADDLE_SOURCE_DIR
}
/paddle/framework/details/*.h"
"
${
lib_dir
}
/details"
SRCS
${
src_dir
}
/
${
module
}
/*.h
${
src_dir
}
/
${
module
}
/details/*.h
${
PADDLE_BINARY_DIR
}
/paddle/framework/framework.pb.h
COMMAND cp
"
${
PADDLE_BINARY_DIR
}
/paddle/framework/framework.pb.h"
"
${
lib_dir
}
"
DSTS
${
dst_dir
}
/
${
module
}
${
dst_dir
}
/
${
module
}
/details
${
dst_dir
}
/
${
module
}
)
)
set
(
lib_dir
"
${
CMAKE_INSTALL_PREFIX
}
/paddle/memory"
)
set
(
module
"memory"
)
add_custom_target
(
memory_lib
copy
(
memory_lib
COMMAND mkdir -p
"
${
lib_dir
}
/detail"
SRCS
${
src_dir
}
/
${
module
}
/*.h
${
src_dir
}
/
${
module
}
/detail/*.h
COMMAND cp
"
${
PADDLE_SOURCE_DIR
}
/paddle/memory/*.h"
"
${
lib_dir
}
"
DSTS
${
dst_dir
}
/
${
module
}
${
dst_dir
}
/
${
module
}
/detail
COMMAND cp
"
${
PADDLE_SOURCE_DIR
}
/paddle/memory/detail/*.h"
"
${
lib_dir
}
/detail"
)
)
set
(
lib_dir
"
${
CMAKE_INSTALL_PREFIX
}
/paddle/inference"
)
set
(
module
"inference"
)
add_custom_target
(
inference_lib DEPENDS paddle_fluid_shared
copy
(
inference_lib DEPENDS paddle_fluid_shared
COMMAND mkdir -p
"
${
lib_dir
}
"
SRCS
${
src_dir
}
/
${
module
}
/*.h
${
PADDLE_BINARY_DIR
}
/paddle/inference/libpaddle_fluid.so
COMMAND cp
"
${
PADDLE_SOURCE_DIR
}
/paddle/inference/*.h"
"
${
lib_dir
}
"
DSTS
${
dst_dir
}
/
${
module
}
${
dst_dir
}
/
${
module
}
COMMAND cp
"
${
PADDLE_BINARY_DIR
}
/paddle/inference/libpaddle_fluid.so"
"
${
lib_dir
}
"
)
)
set
(
lib_dir
"
${
CMAKE_INSTALL_PREFIX
}
/paddle/platform"
)
set
(
module
"platform"
)
add_custom_target
(
platform_lib
copy
(
platform_lib
COMMAND mkdir -p
"
${
lib_dir
}
/dynload"
"
${
lib_dir
}
/details"
SRCS
${
src_dir
}
/
${
module
}
/*.h
${
src_dir
}
/
${
module
}
/dynload/*.h
${
src_dir
}
/
${
module
}
/details/*.h
COMMAND cp
"
${
PADDLE_SOURCE_DIR
}
/paddle/platform/*.h"
"
${
lib_dir
}
"
DSTS
${
dst_dir
}
/
${
module
}
${
dst_dir
}
/
${
module
}
/dynload
${
dst_dir
}
/
${
module
}
/details
COMMAND cp
"
${
PADDLE_SOURCE_DIR
}
/paddle/platform/dynload/*.h"
"
${
lib_dir
}
/dynload"
)
COMMAND cp
"
${
PADDLE_SOURCE_DIR
}
/paddle/platform/details/*.h"
"
${
lib_dir
}
/details"
)
set
(
lib_dir
"
${
CMAKE_INSTALL_PREFIX
}
/paddle/string"
)
set
(
module
"string"
)
add_custom_target
(
string_lib
copy
(
string_lib
COMMAND mkdir -p
"
${
lib_dir
}
/tinyformat"
SRCS
${
src_dir
}
/
${
module
}
/*.h
${
src_dir
}
/
${
module
}
/tinyformat/*.h
COMMAND cp
"
${
PADDLE_SOURCE_DIR
}
/paddle/string/*.h"
"
${
lib_dir
}
"
DSTS
${
dst_dir
}
/
${
module
}
${
dst_dir
}
/
${
module
}
/tinyformat
COMMAND cp
"
${
PADDLE_SOURCE_DIR
}
/paddle/string/tinyformat/*.h"
"
${
lib_dir
}
/tinyformat"
)
)
add_custom_target
(
inference_lib_dist DEPENDS
add_custom_target
(
inference_lib_dist DEPENDS
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录