提交 31a1f538 编写于 作者: M Megvii Engine Team

feat(whl/opencl): enable OpenCL in python whl

GitOrigin-RevId: a1c34ef40b80b409d387698b52711533cf058f5d
上级 b07f3728
...@@ -101,6 +101,7 @@ BUILD_DIR=${SRC_DIR}/build_dir/host/MGE_WITH_CUDA_OFF/MGE_INFERENCE_ONLY_OFF/Rel ...@@ -101,6 +101,7 @@ BUILD_DIR=${SRC_DIR}/build_dir/host/MGE_WITH_CUDA_OFF/MGE_INFERENCE_ONLY_OFF/Rel
INCREMENT_KEY_WORDS="conv_bias.cpp.o is dirty" INCREMENT_KEY_WORDS="conv_bias.cpp.o is dirty"
IS_IN_FIRST_LOOP=TRUE IS_IN_FIRST_LOOP=TRUE
ORG_EXTRA_CMAKE_FLAG=${EXTRA_CMAKE_FLAG}
function do_build() { function do_build() {
for ver in ${ALL_PYTHON} for ver in ${ALL_PYTHON}
do do
...@@ -127,7 +128,7 @@ function do_build() { ...@@ -127,7 +128,7 @@ function do_build() {
echo "PYTHON_LIBRARY: ${PYTHON_LIBRARY}" echo "PYTHON_LIBRARY: ${PYTHON_LIBRARY}"
echo "PYTHON_INCLUDE_DIR: ${PYTHON_INCLUDE_DIR}" echo "PYTHON_INCLUDE_DIR: ${PYTHON_INCLUDE_DIR}"
#config build type to RelWithDebInfo to enable MGB_ENABLE_DEBUG_UTIL etc #config build type to RelWithDebInfo to enable MGB_ENABLE_DEBUG_UTIL etc
export EXTRA_CMAKE_ARGS="${EXTRA_CMAKE_ARGS} -DCMAKE_BUILD_TYPE=RelWithDebInfo" export EXTRA_CMAKE_ARGS="${ORG_EXTRA_CMAKE_FLAG} -DCMAKE_BUILD_TYPE=RelWithDebInfo"
#append cmake args for config python #append cmake args for config python
export EXTRA_CMAKE_ARGS="${EXTRA_CMAKE_ARGS} -DPYTHON_EXECUTABLE=${PYTHON_DIR}/bin/python3" export EXTRA_CMAKE_ARGS="${EXTRA_CMAKE_ARGS} -DPYTHON_EXECUTABLE=${PYTHON_DIR}/bin/python3"
export EXTRA_CMAKE_ARGS="${EXTRA_CMAKE_ARGS} -DPYTHON_LIBRARY=${PYTHON_LIBRARY}" export EXTRA_CMAKE_ARGS="${EXTRA_CMAKE_ARGS} -DPYTHON_LIBRARY=${PYTHON_LIBRARY}"
......
#!/bin/bash #!/bin/bash -e
set -ex set -x
CWD=$(dirname $0) CWD=$(dirname $0)
BASEDIR=$(readlink -f ${CWD}/../../..) BASEDIR=$(readlink -f ${CWD}/../../..)
OUTPUTDIR=$(readlink -f ${CWD}/output) OUTPUTDIR=$(readlink -f ${CWD}/output)
...@@ -265,7 +266,7 @@ if [ "$BUILD_GCC8" == "ON" ];then ...@@ -265,7 +266,7 @@ if [ "$BUILD_GCC8" == "ON" ];then
else else
run_cmd="/home/code/scripts/whl/manylinux2014/do_build_common.sh" run_cmd="/home/code/scripts/whl/manylinux2014/do_build_common.sh"
fi fi
set +x
docker run --rm -it $TMPFS_ARGS \ docker run --rm -it $TMPFS_ARGS \
-e UID=${USERID} \ -e UID=${USERID} \
-e PUBLIC_VERSION_POSTFIX=${PUBLIC_VERSION_POSTFIX} \ -e PUBLIC_VERSION_POSTFIX=${PUBLIC_VERSION_POSTFIX} \
......
#!/bin/bash -ex #!/bin/bash -e
function handle_strip() { function handle_strip() {
echo "now handle strip $1" echo "now handle strip $1"
...@@ -89,6 +89,7 @@ fi ...@@ -89,6 +89,7 @@ fi
INCREMENT_KEY_WORDS=".cu.o is dirty" INCREMENT_KEY_WORDS=".cu.o is dirty"
IS_IN_FIRST_LOOP=TRUE IS_IN_FIRST_LOOP=TRUE
ORG_EXTRA_CMAKE_FLAG=${EXTRA_CMAKE_FLAG}
for ver in ${ALL_PYTHON} for ver in ${ALL_PYTHON}
do do
# we want run a full clean build at the first loop # we want run a full clean build at the first loop
...@@ -103,8 +104,7 @@ do ...@@ -103,8 +104,7 @@ do
MAJOR=${python_ver:0:1} MAJOR=${python_ver:0:1}
MINOR=${ver:1} MINOR=${ver:1}
PYTHON_DIR=/opt/python/cp${python_ver}-cp${ver}/ PYTHON_DIR=/opt/python/cp${python_ver}-cp${ver}/
export EXTRA_CMAKE_ARGS="${EXTRA_CMAKE_ARGS} ${EXTRA_CMAKE_FLAG}" export EXTRA_CMAKE_ARGS="${ORG_EXTRA_CMAKE_FLAG} -DCMAKE_BUILD_TYPE=RelWithDebInfo"
export EXTRA_CMAKE_ARGS="${EXTRA_CMAKE_ARGS} -DCMAKE_BUILD_TYPE=RelWithDebInfo"
export EXTRA_CMAKE_ARGS="${EXTRA_CMAKE_ARGS} -DPYTHON_EXECUTABLE=${PYTHON_DIR}/bin/python3" export EXTRA_CMAKE_ARGS="${EXTRA_CMAKE_ARGS} -DPYTHON_EXECUTABLE=${PYTHON_DIR}/bin/python3"
export EXTRA_CMAKE_ARGS="${EXTRA_CMAKE_ARGS} -DPYTHON_LIBRARY=${PYTHON_DIR}lib/" export EXTRA_CMAKE_ARGS="${EXTRA_CMAKE_ARGS} -DPYTHON_LIBRARY=${PYTHON_DIR}lib/"
export EXTRA_CMAKE_ARGS="${EXTRA_CMAKE_ARGS} -DPYTHON_INCLUDE_DIR=${PYTHON_DIR}include/python${MAJOR}.${MINOR}" export EXTRA_CMAKE_ARGS="${EXTRA_CMAKE_ARGS} -DPYTHON_INCLUDE_DIR=${PYTHON_DIR}include/python${MAJOR}.${MINOR}"
......
...@@ -114,6 +114,7 @@ BUILD_DIR=${SRC_DIR}/build_dir/host/build/ ...@@ -114,6 +114,7 @@ BUILD_DIR=${SRC_DIR}/build_dir/host/build/
INCREMENT_KEY_WORDS=".cu.obj is dirty" INCREMENT_KEY_WORDS=".cu.obj is dirty"
IS_IN_FIRST_LOOP=TRUE IS_IN_FIRST_LOOP=TRUE
ORG_EXTRA_CMAKE_FLAG=${EXTRA_CMAKE_FLAG}
function do_build() { function do_build() {
for ver in ${ALL_PYTHON} for ver in ${ALL_PYTHON}
do do
...@@ -140,7 +141,7 @@ function do_build() { ...@@ -140,7 +141,7 @@ function do_build() {
echo "PYTHON_LIBRARY: ${PYTHON_LIBRARY}" echo "PYTHON_LIBRARY: ${PYTHON_LIBRARY}"
echo "PYTHON_INCLUDE_DIR: ${PYTHON_INCLUDE_DIR}" echo "PYTHON_INCLUDE_DIR: ${PYTHON_INCLUDE_DIR}"
#config build type to RelWithDebInfo to enable MGB_ENABLE_DEBUG_UTIL etc #config build type to RelWithDebInfo to enable MGB_ENABLE_DEBUG_UTIL etc
export EXTRA_CMAKE_ARGS="${EXTRA_CMAKE_ARGS} -DCMAKE_BUILD_TYPE=RelWithDebInfo " export EXTRA_CMAKE_ARGS="${ORG_EXTRA_CMAKE_FLAG} -DCMAKE_BUILD_TYPE=RelWithDebInfo "
#call build and install #call build and install
HOST_BUILD_ARGS=" -t -s" HOST_BUILD_ARGS=" -t -s"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册