Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleDetection
提交
744dba4a
P
PaddleDetection
项目概览
PaddlePaddle
/
PaddleDetection
大约 1 年 前同步成功
通知
695
Star
11112
Fork
2696
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
184
列表
看板
标记
里程碑
合并请求
40
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleDetection
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
184
Issue
184
列表
看板
标记
里程碑
合并请求
40
合并请求
40
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
744dba4a
编写于
11月 05, 2016
作者:
B
backyes
提交者:
Yu Yang
11月 05, 2016
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add rdma cmake support (#284)
* add rdma cmake support * move rdma related code to rdma.cmake
上级
8ff9aa3d
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
94 addition
and
3 deletion
+94
-3
CMakeLists.txt
CMakeLists.txt
+8
-3
cmake/rdma.cmake
cmake/rdma.cmake
+76
-0
cmake/util.cmake
cmake/util.cmake
+10
-0
未找到文件。
CMakeLists.txt
浏览文件 @
744dba4a
...
...
@@ -52,6 +52,9 @@ endif()
include
(
enableCXX11
)
include
(
cpplint
)
include
(
ccache
)
if
(
WITH_RDMA
)
include
(
rdma
)
endif
()
include
(
util
)
include
(
flags
)
include
(
cudnn
)
...
...
@@ -133,9 +136,11 @@ else(WITH_PYTHON)
add_definitions
(
-DPADDLE_NO_PYTHON
)
endif
(
WITH_PYTHON
)
if
(
NOT WITH_RDMA
)
add_definitions
(
-DPADDLE_DISABLE_RDMA
)
endif
()
if
(
WITH_RDMA
)
include_directories
(
"
${
RDMA_INC_DIR
}
"
)
else
(
WITH_RDMA
)
add_definitions
(
-DPADDLE_DISABLE_RDMA
)
endif
(
WITH_RDMA
)
if
(
WITH_GLOG
)
add_definitions
(
-DPADDLE_USE_GLOG
)
...
...
cmake/rdma.cmake
0 → 100644
浏览文件 @
744dba4a
# user should download rdma first from subversion repository
# execute following instruction to download svn mannally
# svn co https://svn.baidu.com/sys/ip/trunk/rdma/sockrdmav1 rdma/
# svn co https://svn.baidu.com/sys/ip/trunk/rdma/thirdparty rdma/
# we use static output in svn repositories to avoid implict bugs from not standard runtime env.
set
(
RDMA_ROOT $ENV{RDMA_ROOT} CACHE PATH
"Folder contains RDMA sock library and thirdparty library"
)
function
(
generate_rdma_links
)
#redirect to current DIR to isolate the pollution from system runtime environment
#it can benifits unified control for different gcc environment.
#e.g, by default gcc48 did not refer /usr/lib64 which could contain low version
#runtime libraries that will crash process while loading it. That redirect trick
#can fix it.
execute_process
(
COMMAND mkdir -p librdma
COMMAND ln -s -f /usr/lib64/libibverbs.so.1.0.0 librdma/libibverbs.so.1
COMMAND ln -s -f /usr/lib64/libibverbs.so.1.0.0 librdma/libibverbs.so
COMMAND ln -s -f /usr/lib64/librdmacm.so.1.0.0 librdma/librdmacm.so.1
COMMAND ln -s -f /usr/lib64/librdmacm.so.1.0.0 librdma/librdmacm.so
WORKING_DIRECTORY
${
CMAKE_CURRENT_BINARY_DIR
}
)
endfunction
(
generate_rdma_links
)
#check and set headers
find_path
(
RDMA_INC_SXISOCK sxi_sock.h PATHS
${
RDMA_ROOT
}
/sockrdmav1/output/include
)
find_path
(
RDMA_INC_XIO libxio.h PATHS
${
RDMA_ROOT
}
/thirdparty/output/accelio
)
find_path
(
RDMA_INC_EVENT event2 PATHS
${
RDMA_ROOT
}
/thirdparty/output/libevent
)
find_path
(
RDMA_INC_NUMA numa.h PATHS
${
RDMA_ROOT
}
/thirdparty/output/libnuma
)
#check and set libs
find_library
(
RDMA_LIB_SXISOCK NAMES sxisock PATHS
${
RDMA_ROOT
}
/sockrdmav1/output
)
find_library
(
RDMA_LIB_XIO NAMES xio PATHS
${
RDMA_ROOT
}
/thirdparty/output/accelio
)
find_library
(
RDMA_LIB_EVENT NAMES event PATHS
${
RDMA_ROOT
}
/thirdparty/output/libevent
)
find_library
(
RDMA_LIB_EVENT_CORE NAMES event_core PATHS
${
RDMA_ROOT
}
/thirdparty/output/libevent
)
find_library
(
RDMA_LIB_EVENT_EXTRA NAMES event_extra PATHS
${
RDMA_ROOT
}
/thirdparty/output/libevent
)
find_library
(
RDMA_LIB_EVENT_PTHREADS NAMES event_pthreads PATHS
${
RDMA_ROOT
}
/thirdparty/output/libevent
)
find_library
(
RDMA_LIB_NUMA NAMES numa PATHS
${
RDMA_ROOT
}
/thirdparty/output/libnuma
)
if
(
RDMA_INC_SXISOCK AND
RDMA_INC_XIO AND
RDMA_INC_EVENT AND
RDMA_INC_NUMA AND
RDMA_LIB_SXISOCK AND
RDMA_LIB_XIO AND
RDMA_LIB_EVENT AND
RDMA_LIB_EVENT_CORE AND
RDMA_LIB_EVENT_EXTRA AND
RDMA_LIB_EVENT_PTHREADS AND
RDMA_LIB_NUMA
)
set
(
RDMA_INC_DIR
${
RDMA_INC_SXISOCK
}
${
RDMA_INC_XIO
}
${
RDMA_INC_EVENT
}
${
RDMA_INC_NUMA
}
)
set
(
RDMA_LIBS
${
RDMA_LIB_SXISOCK
}
${
RDMA_LIB_XIO
}
${
RDMA_LIB_EVENT
}
${
RDMA_LIB_EVENT_CORE
}
${
RDMA_LIB_EVENT_EXTRA
}
${
RDMA_LIB_EVENT_PTHREADS
}
${
RDMA_LIB_NUMA
}
)
set
(
RDMA_LD_FLAGS
"-L./librdma -libverbs -lrdmacm -Xlinker -rpath ./librdma"
)
return
()
endif
()
#if this module is not called, RDMA_INC_DIR RDMA_LIBS will be null, so top module always refer this variable
message
(
FATAL_ERROR,
"RDMA libraries are not found, try to set RDMA_ROOT or check all related libraries."
)
cmake/util.cmake
浏览文件 @
744dba4a
...
...
@@ -67,6 +67,10 @@ endmacro()
#
# It will handle WITH_PYTHON/WITH_GLOG etc.
function
(
link_paddle_exe TARGET_NAME
)
if
(
WITH_RDMA
)
generate_rdma_links
()
endif
()
if
(
WITH_METRIC
)
if
(
WITH_GPU
)
set
(
METRIC_LIBS paddle_metric_learning paddle_dserver_lib metric metric_cpu
)
...
...
@@ -109,6 +113,12 @@ function(link_paddle_exe TARGET_NAME)
${
ZLIB_LIBRARIES
}
${
INTERAL_LIBS
}
${
CMAKE_DL_LIBS
}
)
if
(
WITH_RDMA
)
target_link_libraries
(
${
TARGET_NAME
}
${
RDMA_LD_FLAGS
}
${
RDMA_LIBS
}
)
endif
()
if
(
WITH_PYTHON
)
target_link_libraries
(
${
TARGET_NAME
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录