-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
【第三方库离线编译】add submodule pybind11 #54322
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
a95d8af
to
dfcd011
Compare
270077c
to
fa08d99
Compare
fa08d99
to
e885d4b
Compare
@risemeup1 待 review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
# 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} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
在这里保留了 ${THIRD_PARTY}/pybind/src/extern_pybind/include
目录,并且将 ${SOURCE_DIR}/include
中的内容复制过去。
Lines 146 to 156 in 2f0b4ad
# third_party | |
install_dir = re.sub( | |
env_dict.get("THIRD_PARTY_PATH"), 'third_party', header | |
) | |
patterns = [ | |
'install/mkldnn/include/', | |
'pybind/src/extern_pybind/include/', | |
'third_party/xpu/src/extern_xpu/xpu/include/', | |
] | |
for pattern in patterns: | |
install_dir = re.sub(pattern, '', install_dir) |
因为 setup.py
中需要对该目录('pybind/src/extern_pybind/include/'
)进行处理,并将之安装到 site-packages
中,所以在不大幅改动 setup.py
逻辑的情况下,先采用该方法。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
在这里保留了
${THIRD_PARTY}/pybind/src/extern_pybind/include
目录,并且将${SOURCE_DIR}/include
中的内容复制过去。Lines 146 to 156 in 2f0b4ad
# third_party install_dir = re.sub( env_dict.get("THIRD_PARTY_PATH"), 'third_party', header ) patterns = [ 'install/mkldnn/include/', 'pybind/src/extern_pybind/include/', 'third_party/xpu/src/extern_xpu/xpu/include/', ] for pattern in patterns: install_dir = re.sub(pattern, '', install_dir) 因为
setup.py
中需要对该目录('pybind/src/extern_pybind/include/'
)进行处理,并将之安装到site-packages
中,所以在不大幅改动setup.py
逻辑的情况下,先采用该方法。
ok,的确。
PR types
Others
PR changes
Others
Description
将 pybind11 作为子模块引入,以支持离线编译。