Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
Paddle
提交
4fd6888e
P
Paddle
项目概览
BaiXuePrincess
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
4fd6888e
编写于
1月 11, 2017
作者:
Y
Yu Yang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
C-API for model inference.
上级
06b1a6a6
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
44 addition
and
4 deletion
+44
-4
paddle/capi/CMakeLists.txt
paddle/capi/CMakeLists.txt
+44
-4
未找到文件。
paddle/capi/CMakeLists.txt
浏览文件 @
4fd6888e
...
...
@@ -4,21 +4,61 @@ else ()
set
(
PADDLE_FLOAT_TYPE float
)
endif
()
# config.h used for C-API. It will store Paddle building configuration as a
# header. Make user just include PaddleCAPI.h then can get building
# configuration without explicitly set -DPADDLE_WITH_DOUBLE when building their
# libraries.
configure_file
(
config.h.in config.h @ONLY
)
set
(
CAPI_HEADER
PaddleCAPI.h
)
set
(
CAPI_PRIVATE_HEADER
PaddleCAPIPrivate.h
)
# PaddleCAPI.h is the only header we exposed. It currently only used for model
# inference.
set
(
CAPI_HEADER PaddleCAPI.h
)
set
(
CAPI_PRIVATE_HEADER PaddleCAPIPrivate.h
)
file
(
GLOB CAPI_SOURCES *.cpp
)
# building paddle_capi
add_library
(
paddle_capi STATIC
${
CAPI_SOURCES
}
)
target_include_directories
(
paddle_capi PUBLIC
${
CMAKE_CURRENT_BINARY_DIR
}
)
add_style_check_target
(
paddle_capi
${
CAPI_SOURCES
}
${
CAPI_HEADER
}
${
CAPI_PRIVATE_HEADER
}
)
add_dependencies
(
paddle_capi gen_proto_cpp
)
# combine all paddle static libraries together, into libpaddle_capi_whole.a
# user should use PaddleCAPI as -lpaddle_capi_whole
set
(
capi_whole_library libpaddle_capi_whole.a
)
add_custom_target
(
paddle_capi_whole
COMMAND mkdir -p o_files/capi && cd o_files/capi/ && ar -x $<TARGET_FILE:paddle_capi>
COMMAND mkdir -p o_files/utils && cd o_files/utils/ && ar -x $<TARGET_FILE:paddle_utils>
COMMAND mkdir -p o_files/parameter && cd o_files/parameter/ && ar -x $<TARGET_FILE:paddle_parameter>
COMMAND mkdir -p o_files/math && cd o_files/math/ && ar -x $<TARGET_FILE:paddle_math>
COMMAND mkdir -p o_files/cuda && cd o_files/cuda/ && ar -x $<TARGET_FILE:paddle_cuda>
COMMAND mkdir -p o_files/function && cd o_files/function/ && ar -x $<TARGET_FILE:paddle_function>
COMMAND mkdir -p o_files/pserver && cd o_files/pserver/ && ar -x $<TARGET_FILE:paddle_pserver>
COMMAND mkdir -p o_files/gserver && cd o_files/gserver/ && ar -x $<TARGET_FILE:paddle_gserver>
COMMAND mkdir -p o_files/proto && cd o_files/proto/ && ar -x $<TARGET_FILE:paddle_proto>
COMMAND ar crs
${
capi_whole_library
}
`find ./o_files -name '*.o'`
COMMAND rm -rf o_files
WORKING_DIRECTORY
${
CMAKE_CURRENT_BINARY_DIR
}
DEPENDS paddle_capi paddle_utils paddle_parameter paddle_math
paddle_cuda paddle_function paddle_pserver paddle_gserver
paddle_proto
)
set_target_properties
(
paddle_capi_whole
PROPERTIES IMPORTED_LOCATION
${
CMAKE_CURRENT_BINARY_DIR
}
/
${
capi_whole_library
}
)
# install library & headers.
install
(
FILES
${
CMAKE_CURRENT_BINARY_DIR
}
/
${
capi_whole_library
}
DESTINATION lib
)
install
(
FILES
${
CAPI_HEADER
}
DESTINATION include/paddle
)
install
(
FILES
${
CMAKE_CURRENT_BINARY_DIR
}
/config.h DESTINATION include/paddle
)
# this variable used for unittest
set
(
PADDLE_CAPI_INC_PATH
${
CMAKE_CURRENT_BINARY_DIR
}
${
CMAKE_CURRENT_SOURCE_DIR
}
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录