Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
2241c977
P
Paddle
项目概览
PaddlePaddle
/
Paddle
大约 1 年 前同步成功
通知
2299
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看板
未验证
提交
2241c977
编写于
7月 17, 2023
作者:
C
cyberslack_lee
提交者:
GitHub
7月 17, 2023
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[cmake] add rocksdb third party cache new (#54646)
* fix * fix * fix * fix
上级
f66a705f
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
29 addition
and
5 deletion
+29
-5
cmake/external/rocksdb.cmake
cmake/external/rocksdb.cmake
+29
-5
未找到文件。
cmake/external/rocksdb.cmake
浏览文件 @
2241c977
...
@@ -16,6 +16,9 @@ include(ExternalProject)
...
@@ -16,6 +16,9 @@ include(ExternalProject)
# find_package(jemalloc REQUIRED)
# find_package(jemalloc REQUIRED)
set
(
ROCKSDB_SOURCE_DIR
${
PADDLE_SOURCE_DIR
}
/third_party/rocksdb
)
set
(
ROCKSDB_TAG 6.19.fb
)
set
(
JEMALLOC_INCLUDE_DIR
${
THIRD_PARTY_PATH
}
/install/jemalloc/include
)
set
(
JEMALLOC_INCLUDE_DIR
${
THIRD_PARTY_PATH
}
/install/jemalloc/include
)
set
(
JEMALLOC_LIBRARIES
set
(
JEMALLOC_LIBRARIES
${
THIRD_PARTY_PATH
}
/install/jemalloc/lib/libjemalloc_pic.a
)
${
THIRD_PARTY_PATH
}
/install/jemalloc/lib/libjemalloc_pic.a
)
...
@@ -48,6 +51,29 @@ set(ROCKSDB_CMAKE_C_FLAGS
...
@@ -48,6 +51,29 @@ set(ROCKSDB_CMAKE_C_FLAGS
)
)
include_directories
(
${
ROCKSDB_INCLUDE_DIR
}
)
include_directories
(
${
ROCKSDB_INCLUDE_DIR
}
)
file
(
GLOB ROCKSDB_SOURCE_FILE_LIST
${
ROCKSDB_SOURCE_DIR
}
)
list
(
LENGTH ROCKSDB_SOURCE_FILE_LIST RES_LEN
)
if
(
RES_LEN EQUAL 0
)
execute_process
(
COMMAND
${
GIT_EXECUTABLE
}
clone -b
${
ROCKSDB_TAG
}
"https://github.com/Thunderbrook/rocksdb"
${
ROCKSDB_SOURCE_DIR
}
)
else
()
# check git tag
execute_process
(
COMMAND
${
GIT_EXECUTABLE
}
describe --abbrev=6 --always --tags
OUTPUT_VARIABLE VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_QUIET
WORKING_DIRECTORY
${
ROCKSDB_SOURCE_DIR
}
)
if
(
NOT
${
VERSION
}
STREQUAL
${
ROCKSDB_TAG
}
)
file
(
REMOVE_RECURSE
${
ROCKSDB_PREFIX_DIR
}
)
file
(
REMOVE_RECURSE
${
ROCKSDB_INSTALL_DIR
}
)
message
(
WARNING
"rocksdb version is not
${
VERSION
}
, checkout to
${
ROCKSDB_TAG
}
"
)
execute_process
(
COMMAND
${
GIT_EXECUTABLE
}
checkout
${
ROCKSDB_TAG
}
WORKING_DIRECTORY
${
ROCKSDB_SOURCE_DIR
}
)
endif
()
endif
()
set
(
CMAKE_CXX_LINK_EXECUTABLE
set
(
CMAKE_CXX_LINK_EXECUTABLE
"
${
CMAKE_CXX_LINK_EXECUTABLE
}
-pthread -Wl,--no-as-needed -ldl -lrt -lz"
)
"
${
CMAKE_CXX_LINK_EXECUTABLE
}
-pthread -Wl,--no-as-needed -ldl -lrt -lz"
)
if
(
WITH_ARM
)
if
(
WITH_ARM
)
...
@@ -63,8 +89,7 @@ ExternalProject_Add(
...
@@ -63,8 +89,7 @@ ExternalProject_Add(
extern_rocksdb
extern_rocksdb
${
EXTERNAL_PROJECT_LOG_ARGS
}
${
EXTERNAL_PROJECT_LOG_ARGS
}
PREFIX
${
ROCKSDB_PREFIX_DIR
}
PREFIX
${
ROCKSDB_PREFIX_DIR
}
GIT_REPOSITORY
"https://github.com/Thunderbrook/rocksdb"
SOURCE_DIR
${
ROCKSDB_SOURCE_DIR
}
GIT_TAG 6.19.fb
UPDATE_COMMAND
""
UPDATE_COMMAND
""
PATCH_COMMAND
${
ROCKSDB_PATCH_COMMAND
}
PATCH_COMMAND
${
ROCKSDB_PATCH_COMMAND
}
CMAKE_ARGS -DCMAKE_CXX_COMPILER=
${
CMAKE_CXX_COMPILER
}
CMAKE_ARGS -DCMAKE_CXX_COMPILER=
${
CMAKE_CXX_COMPILER
}
...
@@ -81,10 +106,9 @@ ExternalProject_Add(
...
@@ -81,10 +106,9 @@ ExternalProject_Add(
-DCMAKE_C_FLAGS=
${
CMAKE_C_FLAGS
}
-DCMAKE_C_FLAGS=
${
CMAKE_C_FLAGS
}
INSTALL_COMMAND
INSTALL_COMMAND
mkdir -p
${
ROCKSDB_INSTALL_DIR
}
/lib/ && cp
mkdir -p
${
ROCKSDB_INSTALL_DIR
}
/lib/ && cp
${
ROCKSDB_PREFIX_DIR
}
/src/extern_rocksdb
/librocksdb.a
${
ROCKSDB_LIBRARIES
}
${
ROCKSDB_PREFIX_DIR
}
/src/extern_rocksdb
-build/librocksdb.a
&& cp -r
${
ROCKSDB_PREFIX_DIR
}
/src/extern_rocksdb
/include
${
ROCKSDB_LIBRARIES
}
&& cp -r
${
ROCKSDB_SOURCE_DIR
}
/include
${
ROCKSDB_INSTALL_DIR
}
/
${
ROCKSDB_INSTALL_DIR
}
/
BUILD_IN_SOURCE 1
BUILD_BYPRODUCTS
${
ROCKSDB_LIBRARIES
}
)
BUILD_BYPRODUCTS
${
ROCKSDB_LIBRARIES
}
)
add_library
(
rocksdb STATIC IMPORTED GLOBAL
)
add_library
(
rocksdb STATIC IMPORTED GLOBAL
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录