Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
3535049a
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看板
未验证
提交
3535049a
编写于
6月 07, 2023
作者:
R
RedContritio
提交者:
GitHub
6月 07, 2023
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add submodule pybind11 (#54322)
上级
f7747808
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
20 addition
and
7 deletion
+20
-7
.gitmodules
.gitmodules
+4
-0
cmake/external/pybind11.cmake
cmake/external/pybind11.cmake
+14
-6
cmake/third_party.cmake
cmake/third_party.cmake
+1
-1
third_party/pybind
third_party/pybind
+1
-0
未找到文件。
.gitmodules
浏览文件 @
3535049a
...
...
@@ -38,6 +38,10 @@
path = third_party/leveldb
url = https://github.com/google/leveldb
ignore = dirty
[submodule "third_party/pybind"]
path = third_party/pybind
url = https://github.com/pybind/pybind11.git
ignore = dirty
[submodule "third_party/threadpool"]
path = third_party/threadpool
url = https://github.com/progschj/ThreadPool.git
...
...
cmake/external/pybind11.cmake
浏览文件 @
3535049a
...
...
@@ -15,10 +15,12 @@
include
(
ExternalProject
)
set
(
PYBIND_PREFIX_DIR
${
THIRD_PARTY_PATH
}
/pybind
)
set
(
PYBIND_REPOSITORY
${
GIT_URL
}
/pybind/pybind11.git
)
set
(
PYBIND_SOURCE_DIR
${
PYBIND_PREFIX_DIR
}
/src/extern_pybind
)
set
(
PYBIND_INCLUDE_DIR
${
PYBIND_SOURCE_DIR
}
/include
)
set
(
PYBIND_TAG v2.10.3
)
set
(
SOURCE_DIR
${
PADDLE_SOURCE_DIR
}
/third_party/pybind
)
set
(
SOURCE_INCLUDE_DIR
${
SOURCE_DIR
}
/include
)
set
(
PYBIND_INCLUDE_DIR
${
THIRD_PARTY_PATH
}
/pybind/src/extern_pybind/include
)
include_directories
(
${
PYBIND_INCLUDE_DIR
}
)
set
(
PYBIND_PATCH_COMMAND
""
)
...
...
@@ -31,14 +33,13 @@ if(NOT WIN32)
# 2. Patch twice: the tag version of cache == PYBIND_TAG, but patch has already applied to cache.
set
(
PYBIND_PATCH_COMMAND
git checkout -- . && git checkout
${
PYBIND_TAG
}
&& patch -Nd
${
PYBIND
_INCLUDE_DIR
}
/pybind11 <
${
native_dst
}
)
${
SOURCE
_INCLUDE_DIR
}
/pybind11 <
${
native_dst
}
)
endif
()
ExternalProject_Add
(
extern_pybind
${
EXTERNAL_PROJECT_LOG_ARGS
}
${
SHALLOW_CLONE
}
GIT_REPOSITORY
${
PYBIND_REPOSITORY
}
GIT_TAG
${
PYBIND_TAG
}
SOURCE_DIR
${
SOURCE_DIR
}
PREFIX
${
PYBIND_PREFIX_DIR
}
# If we explicitly leave the `UPDATE_COMMAND` of the ExternalProject_Add
# function in CMakeLists blank, it will cause another parameter GIT_TAG
...
...
@@ -48,7 +49,14 @@ ExternalProject_Add(
UPDATE_COMMAND
""
PATCH_COMMAND
${
PYBIND_PATCH_COMMAND
}
CONFIGURE_COMMAND
""
BUILD_COMMAND
""
# I intentionally preserved an extern_pybind/include/pybind11 directory
# to site-packages, so that you could discern that you intended to
# employ not only python, but also CPP and were ready to incorporate header files.
BUILD_COMMAND
COMMAND
${
CMAKE_COMMAND
}
-E remove_directory
${
PYBIND_SOURCE_DIR
}
COMMAND
${
CMAKE_COMMAND
}
-E make_directory
${
PYBIND_SOURCE_DIR
}
COMMAND
${
CMAKE_COMMAND
}
-E copy_directory
${
SOURCE_INCLUDE_DIR
}
${
PYBIND_INCLUDE_DIR
}
INSTALL_COMMAND
""
TEST_COMMAND
""
)
...
...
cmake/third_party.cmake
浏览文件 @
3535049a
...
...
@@ -305,7 +305,7 @@ endif()
if
(
NOT
((
NOT WITH_PYTHON
)
AND ON_INFER
))
include
(
external/python
)
# find python and python_module
include
(
external/pybind11
)
#
download
pybind11
include
(
external/pybind11
)
#
prepare submodule
pybind11
list
(
APPEND third_party_deps extern_pybind
)
endif
()
...
...
pybind
@
0bd8896a
Subproject commit 0bd8896a4010f2d91b2340570c24fa08606ec406
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录