Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
wmsofts
Paddle
提交
4798a8c7
P
Paddle
项目概览
wmsofts
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
0
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
4798a8c7
编写于
12月 01, 2018
作者:
H
heqiaozhi
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
pslib_brpc
上级
038346c0
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
76 addition
and
0 deletion
+76
-0
cmake/external/pslib_brpc.cmake
cmake/external/pslib_brpc.cmake
+76
-0
未找到文件。
cmake/external/pslib_brpc.cmake
0 → 100644
浏览文件 @
4798a8c7
# Copyright (c) 2017 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
IF
(
NOT
${
WITH_PSLIB_BRPC
}
)
return
()
ENDIF
(
NOT
${
WITH_PSLIB_BRPC
}
)
IF
(
WIN32 OR APPLE
)
MESSAGE
(
WARNING
"Windows or Mac is not supported with PSLIB_BRPC in Paddle yet."
"Force WITH_PSLIB_BRPC=OFF"
)
SET
(
WITH_PSLIB_BRPC OFF CACHE STRING
"Disable PSLIB_BRPC package in Windows and MacOS"
FORCE
)
return
()
ENDIF
()
INCLUDE
(
ExternalProject
)
SET
(
PSLIB_BRPC_PROJECT
"extern_pslib_brpc"
)
IF
((
NOT DEFINED PSLIB_BRPC_VER
)
OR
(
NOT DEFINED PSLIB_BRPC_URL
))
MESSAGE
(
STATUS
"use pre defined download url"
)
SET
(
PSLIB_BRPC_VER
"pslib_brpc"
CACHE STRING
""
FORCE
)
#todo pslib version
SET
(
PSLIB_BRPC_URL
"http://bjyz-heqiaozhi-dev-new.epc.baidu.com:8000/
${
PSLIB_BRPC_VER
}
.tar.gz"
CACHE STRING
""
FORCE
)
#todo pslib_brpc url
ENDIF
()
MESSAGE
(
STATUS
"PSLIB_BRPC_VER:
${
PSLIB_BRPC_VER
}
, PSLIB_BRPC_URL:
${
PSLIB_BRPC_URL
}
"
)
SET
(
PSLIB_BRPC_SOURCE_DIR
"
${
THIRD_PARTY_PATH
}
/pslib_brpc"
)
SET
(
PSLIB_BRPC_DOWNLOAD_DIR
"
${
PSLIB_BRPC_SOURCE_DIR
}
/src/
${
PSLIB_BRPC_PROJECT
}
"
)
SET
(
PSLIB_BRPC_DST_DIR
"pslib_brpc"
)
SET
(
PSLIB_BRPC_INSTALL_ROOT
"
${
THIRD_PARTY_PATH
}
/install"
)
SET
(
PSLIB_BRPC_INSTALL_DIR
${
PSLIB_BRPC_INSTALL_ROOT
}
/
${
PSLIB_BRPC_DST_DIR
}
)
SET
(
PSLIB_BRPC_ROOT
${
PSLIB_BRPC_INSTALL_DIR
}
)
SET
(
PSLIB_BRPC_INC_DIR
${
PSLIB_BRPC_ROOT
}
/include
)
SET
(
PSLIB_BRPC_LIB_DIR
${
PSLIB_BRPC_ROOT
}
/lib
)
SET
(
PSLIB_BRPC_LIB
${
PSLIB_BRPC_LIB_DIR
}
/libps.so
)
SET
(
PSLIB_BRPC_IOMP_LIB
${
PSLIB_BRPC_LIB_DIR
}
/libiomp5.so
)
#todo what is this
SET
(
CMAKE_INSTALL_RPATH
"
${
CMAKE_INSTALL_RPATH
}
"
"
${
PSLIB_BRPC_ROOT
}
/lib"
)
INCLUDE_DIRECTORIES
(
${
PSLIB_BRPC_INC_DIR
}
)
FILE
(
WRITE
${
PSLIB_BRPC_DOWNLOAD_DIR
}
/CMakeLists.txt
"PROJECT(PSLIB_BRPC)
\n
"
"cmake_minimum_required(VERSION 3.0)
\n
"
"install(DIRECTORY
${
PSLIB_BRPC_VER
}
/include
${
PSLIB_BRPC_VER
}
/lib
\n
"
" DESTINATION
${
PSLIB_BRPC_DST_DIR
}
)
\n
"
)
ExternalProject_Add
(
${
PSLIB_BRPC_PROJECT
}
${
EXTERNAL_PROJECT_LOG_ARGS
}
PREFIX
${
PSLIB_BRPC_SOURCE_DIR
}
DOWNLOAD_DIR
${
PSLIB_BRPC_DOWNLOAD_DIR
}
DOWNLOAD_COMMAND wget --no-check-certificate
${
PSLIB_BRPC_URL
}
-c -q -O
${
PSLIB_BRPC_VER
}
.tar.gz
&& tar zxvf
${
PSLIB_BRPC_VER
}
.tar.gz
DOWNLOAD_NO_PROGRESS 1
UPDATE_COMMAND
""
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=
${
PSLIB_BRPC_INSTALL_ROOT
}
CMAKE_CACHE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=
${
PSLIB_BRPC_INSTALL_ROOT
}
)
ADD_LIBRARY
(
pslib_brpc SHARED IMPORTED GLOBAL
)
SET_PROPERTY
(
TARGET pslib_brpc PROPERTY IMPORTED_LOCATION
${
PSLIB_BRPC_LIB
}
)
ADD_DEPENDENCIES
(
pslib_brpc
${
PSLIB_BRPC_PROJECT
}
)
LIST
(
APPEND external_project_dependencies pslib_brpc
)
IF
(
WITH_C_API
)
INSTALL
(
FILES
${
PSLIB_BRPC_LIB
}
${
PSLIB_BRPC_IOMP_LIB
}
DESTINATION lib
)
ENDIF
()
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录