Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Crayon鑫
Paddle
提交
afce32f3
P
Paddle
项目概览
Crayon鑫
/
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看板
未验证
提交
afce32f3
编写于
10月 16, 2020
作者:
L
lilong12
提交者:
GitHub
10月 16, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
build gloo from source code instead of using the pre-compiled library (#27930)
* build gloo from source code , test=develop
上级
5bcb4c7b
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
29 addition
and
44 deletion
+29
-44
cmake/external/gloo.cmake
cmake/external/gloo.cmake
+29
-44
未找到文件。
cmake/external/gloo.cmake
浏览文件 @
afce32f3
...
@@ -14,55 +14,40 @@
...
@@ -14,55 +14,40 @@
INCLUDE
(
ExternalProject
)
INCLUDE
(
ExternalProject
)
execute_process
(
COMMAND bash -c
"gcc -dumpversion"
OUTPUT_VARIABLE GCC_VERSION
)
SET
(
GLOO_PROJECT
"extern_gloo"
)
SET
(
GLOO_PROJECT
"extern_gloo"
)
IF
((
NOT DEFINED GLOO_VER
)
OR
(
NOT DEFINED GLOO_URL
))
SET
(
GLOO_PREFIX_DIR
${
THIRD_PARTY_PATH
}
/gloo
)
MESSAGE
(
STATUS
"use pre defined download url"
)
SET
(
GLOO_SOURCE_DIR
${
THIRD_PARTY_PATH
}
/gloo/src/extern_gloo/gloo
)
SET
(
GLOO_VER
"master"
CACHE STRING
""
FORCE
)
SET
(
GLOO_INSTALL_DIR
${
THIRD_PARTY_PATH
}
/install/gloo
)
SET
(
GLOO_NAME
"gloo"
CACHE STRING
""
FORCE
)
SET
(
GLOO_INCLUDE_DIR
"
${
GLOO_INSTALL_DIR
}
/include"
CACHE PATH
"gloo include directory."
FORCE
)
SET
(
GLOO_LIBRARY_DIR
"
${
GLOO_INSTALL_DIR
}
/lib"
CACHE PATH
"gloo library directory."
FORCE
)
if
(
${
GCC_VERSION
}
VERSION_EQUAL
"8.2.0"
)
SET
(
GLOO_REPOSITORY https://github.com/sandyhouse/gloo.git
)
SET
(
GLOO_URL
"https://fleet.bj.bcebos.com/gloo/gloo.tar.gz.gcc8"
CACHE STRING
""
FORCE
)
SET
(
GLOO_TAG v0.0.2
)
else
()
SET
(
GLOO_LIBRARIES
"
${
GLOO_INSTALL_DIR
}
/lib/libgloo.a"
CACHE FILEPATH
"gloo library."
FORCE
)
SET
(
GLOO_URL
"https://fleet.bj.bcebos.com/gloo/gloo.tar.gz.gcc482"
CACHE STRING
""
FORCE
)
endif
()
INCLUDE_DIRECTORIES
(
${
GLOO_INCLUDE_DIR
}
)
ENDIF
()
cache_third_party
(
extern_gloo
MESSAGE
(
STATUS
"GLOO_NAME:
${
GLOO_NAME
}
, GLOO_URL:
${
GLOO_URL
}
"
)
REPOSITORY
${
GLOO_REPOSITORY
}
SET
(
GLOO_SOURCE_DIR
"
${
THIRD_PARTY_PATH
}
/gloo"
)
TAG
${
GLOO_TAG
}
SET
(
GLOO_DOWNLOAD_DIR
"
${
GLOO_SOURCE_DIR
}
/src/
${
GLOO_PROJECT
}
"
)
DIR GLOO_SOURCE_DIR
)
SET
(
GLOO_DST_DIR
"gloo"
)
SET
(
GLOO_INSTALL_ROOT
"
${
THIRD_PARTY_PATH
}
/install"
)
SET
(
GLOO_INSTALL_DIR
${
GLOO_INSTALL_ROOT
}
/
${
GLOO_DST_DIR
}
)
SET
(
GLOO_ROOT
${
GLOO_INSTALL_DIR
}
)
SET
(
GLOO_INC_DIR
${
GLOO_ROOT
}
/include
)
SET
(
GLOO_LIB_DIR
${
GLOO_ROOT
}
/lib
)
SET
(
GLOO_LIB
${
GLOO_LIB_DIR
}
/libgloo.a
)
#SET(GLOO_IOMP_LIB ${GLOO_LIB_DIR}/libiomp5.so) #todo what is this
SET
(
CMAKE_INSTALL_RPATH
"
${
CMAKE_INSTALL_RPATH
}
"
"
${
GLOO_ROOT
}
/lib"
)
INCLUDE_DIRECTORIES
(
${
GLOO_INC_DIR
}
)
FILE
(
WRITE
${
GLOO_DOWNLOAD_DIR
}
/CMakeLists.txt
"PROJECT(GLOO)
\n
"
"cmake_minimum_required(VERSION 3.0)
\n
"
"install(DIRECTORY
${
GLOO_NAME
}
/include
${
GLOO_NAME
}
/lib
\n
"
" DESTINATION
${
GLOO_DST_DIR
}
)
\n
"
)
ExternalProject_Add
(
ExternalProject_Add
(
${
GLOO_PROJECT
}
extern_gloo
${
EXTERNAL_PROJECT_LOG_ARGS
}
${
EXTERNAL_PROJECT_LOG_ARGS
}
PREFIX
${
GLOO_SOURCE_DIR
}
${
SHALLOW_CLONE
}
DOWNLOAD_DIR
${
GLOO_DOWNLOAD_DIR
}
"
${
GLOO_DOWNLOAD_CMD
}
"
DOWNLOAD_COMMAND wget --no-check-certificate
${
GLOO_URL
}
-c -q -O
${
GLOO_NAME
}
.tar.gz
PREFIX
"
${
GLOO_PREFIX_DIR
}
"
&& tar zxvf
${
GLOO_NAME
}
.tar.gz
SOURCE_DIR
"
${
GLOO_SOURCE_DIR
}
"
DOWNLOAD_NO_PROGRESS 1
UPDATE_COMMAND
""
UPDATE_COMMAND
""
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=
${
GLOO_INSTALL_ROOT
}
CONFIGURE_COMMAND
""
CMAKE_CACHE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=
${
GLOO_INSTALL_ROOT
}
BUILD_COMMAND mkdir -p
${
GLOO_SOURCE_DIR
}
/build
&& cd
${
GLOO_SOURCE_DIR
}
/build && cmake .. && make
&& mkdir -p
${
GLOO_LIBRARY_DIR
}
${
GLOO_INCLUDE_DIR
}
/gloo
INSTALL_COMMAND
${
CMAKE_COMMAND
}
-E copy
${
GLOO_SOURCE_DIR
}
/build/gloo/libgloo.a
${
GLOO_LIBRARY_DIR
}
COMMAND
${
CMAKE_COMMAND
}
-E copy_directory
"
${
GLOO_SOURCE_DIR
}
/gloo/"
"
${
GLOO_INCLUDE_DIR
}
/gloo"
)
)
ADD_LIBRARY
(
gloo SHARED IMPORTED GLOBAL
)
SET_PROPERTY
(
TARGET gloo PROPERTY IMPORTED_LOCATION
${
GLOO_LIB
}
)
ADD_LIBRARY
(
gloo STATIC IMPORTED GLOBAL
)
SET_PROPERTY
(
TARGET gloo PROPERTY IMPORTED_LOCATION
${
GLOO_LIBRARIES
}
)
ADD_DEPENDENCIES
(
gloo
${
GLOO_PROJECT
}
)
ADD_DEPENDENCIES
(
gloo
${
GLOO_PROJECT
}
)
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录