提交 99040dbe 编写于 作者: M Megvii Engine Team

feat(lite): make lite py dev happy

GitOrigin-RevId: 337c5d0c97037057f522fb75253a45522fb92075
上级 509607f5
......@@ -71,6 +71,20 @@ include_directories(
# define a shared lib
add_library(lite_shared SHARED $<TARGET_OBJECTS:lite_static>)
add_custom_command(
TARGET lite_shared
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E make_directory
${CMAKE_CURRENT_SOURCE_DIR}/pylite/megenginelite/libs
COMMAND
${CMAKE_COMMAND} -E remove -f
${CMAKE_CURRENT_SOURCE_DIR}/pylite/megenginelite/libs/$<TARGET_FILE_NAME:lite_shared>
COMMAND
${CMAKE_COMMAND} -E create_symlink
${CMAKE_CURRENT_BINARY_DIR}/$<TARGET_FILE_NAME:lite_shared>
${CMAKE_CURRENT_SOURCE_DIR}/pylite/megenginelite/libs/$<TARGET_FILE_NAME:lite_shared>
VERBATIM)
if(LITE_BUILD_WITH_MGE)
target_link_libraries(lite_shared PRIVATE megbrain megdnn ${MGE_CUDA_LIBS})
endif()
......
......@@ -99,3 +99,4 @@ If you do not want to create whl file when debug Python3 binding, you can call `
* cpu only with `RelWithDebInfo` mode: `EXTRA_CMAKE_ARGS="-DCMAKE_BUILD_TYPE=RelWithDebInfo" scripts/cmake-build/host_build.sh -t`
Start `Python3 ` with env for support `MegEngine` after build: `PYTHONPATH=imperative/python:$PYTHONPATH python3 `
Start `Python3 ` with env for support `MegEngineLite` after build: `PYTHONPATH=lite/pylite:$PYTHONPATH python3 `
......@@ -103,6 +103,8 @@ function do_build() {
# call real build
echo "host_build.sh HOST_BUILD_ARGS: ${HOST_BUILD_ARGS}"
bash ${SRC_DIR}/scripts/cmake-build/host_build.sh ${HOST_BUILD_ARGS}
# remove megenginelite py develop soft link create by lite_shared:POST_BUILD @ lite/CMakeLists.txt
rm -rf ${SRC_DIR}/lite/pylite/megenginelite/libs
# check python api call setup.py
cd ${BUILD_DIR}
......
......@@ -171,6 +171,8 @@ function do_build() {
# call real build
echo "host_build.sh HOST_BUILD_ARGS: ${HOST_BUILD_ARGS}"
${SRC_DIR}/scripts/cmake-build/host_build.sh ${HOST_BUILD_ARGS}
# remove megenginelite py develop soft link create by lite_shared:POST_BUILD @ lite/CMakeLists.txt
rm -rf ${SRC_DIR}/lite/pylite/megenginelite/libs
# check python api call setup.py
cd ${BUILD_DIR}
......
......@@ -148,6 +148,8 @@ do
# call real build
echo "host_build.sh HOST_BUILD_ARGS: ${HOST_BUILD_ARGS}"
${SRC_DIR}/scripts/cmake-build/host_build.sh ${HOST_BUILD_ARGS}
# remove megenginelite py develop soft link create by lite_shared:POST_BUILD @ lite/CMakeLists.txt
rm -rf ${SRC_DIR}/lite/pylite/megenginelite/libs
# check python api call setup.py
cd ${BUILD_DIR}
......
......@@ -185,6 +185,8 @@ function do_build() {
#call real build
${SRC_DIR}/scripts/cmake-build/host_build.sh ${HOST_BUILD_ARGS}
# remove megenginelite py develop soft link create by lite_shared:POST_BUILD @ lite/CMakeLists.txt
rm -rf ${SRC_DIR}/lite/pylite/megenginelite/libs
# check python api call setup.py
cd ${BUILD_DIR}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册