File tree Expand file tree Collapse file tree 5 files changed +7
-14
lines changed Expand file tree Collapse file tree 5 files changed +7
-14
lines changed Original file line number Diff line number Diff line change @@ -14,8 +14,7 @@ if [[ -z "${PYTHON_EXECUTABLE:-}" ]]; then
1414 PYTHON_EXECUTABLE=python3
1515fi
1616which " ${PYTHON_EXECUTABLE} "
17- SITE_PACKAGES=" $( ${PYTHON_EXECUTABLE} -c ' from distutils.sysconfig import get_python_lib; print(get_python_lib())' ) "
18- CMAKE_PREFIX_PATH=" ${SITE_PACKAGES} /torch"
17+ CMAKE_PREFIX_PATH=" $( python3 -c ' import torch as _; print(_.__path__[0])' ) "
1918
2019install_executorch_and_backend_lib () {
2120 echo " Installing executorch and xnnpack backend"
Original file line number Diff line number Diff line change @@ -50,8 +50,7 @@ prepare_artifacts_upload() {
5050
5151build_cmake_executor_runner () {
5252 echo " Building executor_runner"
53- SITE_PACKAGES=" $( ${PYTHON_EXECUTABLE} -c ' from distutils.sysconfig import get_python_lib; print(get_python_lib())' ) "
54- CMAKE_PREFIX_PATH=" ${SITE_PACKAGES} /torch"
53+ CMAKE_PREFIX_PATH=" $( python3 -c ' import torch as _; print(_.__path__[0])' ) "
5554 rm -rf ${CMAKE_OUTPUT_DIR}
5655 cmake -DCMAKE_BUILD_TYPE=Debug \
5756 -DEXECUTORCH_BUILD_KERNELS_OPTIMIZED=ON \
@@ -101,8 +100,7 @@ test_model() {
101100
102101build_cmake_xnn_executor_runner () {
103102 echo " Building xnn_executor_runner"
104- SITE_PACKAGES=" $( ${PYTHON_EXECUTABLE} -c ' from distutils.sysconfig import get_python_lib; print(get_python_lib())' ) "
105- CMAKE_PREFIX_PATH=" ${SITE_PACKAGES} /torch"
103+ CMAKE_PREFIX_PATH=" $( python3 -c ' import torch as _; print(_.__path__[0])' ) "
106104
107105 (rm -rf ${CMAKE_OUTPUT_DIR} \
108106 && mkdir ${CMAKE_OUTPUT_DIR} \
Original file line number Diff line number Diff line change @@ -22,8 +22,7 @@ NPROC=8
2222if hash nproc & > /dev/null; then NPROC=$( nproc) ; fi
2323
2424cmake_install_executorch_libraries () {
25- SITE_PACKAGES=" $( ${PYTHON_EXECUTABLE} -c ' from distutils.sysconfig import get_python_lib; print(get_python_lib())' ) "
26- CMAKE_PREFIX_PATH=" ${SITE_PACKAGES} /torch"
25+ CMAKE_PREFIX_PATH=" $( python3 -c ' import torch as _; print(_.__path__[0])' ) "
2726 cmake -DPYTHON_EXECUTABLE=python \
2827 -DCMAKE_INSTALL_PREFIX=${BUILD_DIR} \
2928 -DCMAKE_PREFIX_PATH=" ${CMAKE_PREFIX_PATH} " \
@@ -42,8 +41,7 @@ cmake_install_executorch_libraries() {
4241}
4342
4443cmake_build_phi_3_mini () {
45- SITE_PACKAGES=" $( ${PYTHON_EXECUTABLE} -c ' from distutils.sysconfig import get_python_lib; print(get_python_lib())' ) "
46- CMAKE_PREFIX_PATH=" ${SITE_PACKAGES} /torch"
44+ CMAKE_PREFIX_PATH=" $( python3 -c ' import torch as _; print(_.__path__[0])' ) "
4745 cmake -DPYTHON_EXECUTABLE=$PYTHON_EXECUTABLE \
4846 -DCMAKE_INSTALL_PREFIX=${BUILD_DIR} \
4947 -DCMAKE_PREFIX_PATH=" ${CMAKE_PREFIX_PATH} " \
Original file line number Diff line number Diff line change @@ -11,8 +11,7 @@ if [[ -z "${PYTHON_EXECUTABLE:-}" ]]; then
1111 PYTHON_EXECUTABLE=python3
1212fi
1313which " ${PYTHON_EXECUTABLE} "
14- SITE_PACKAGES=" $( ${PYTHON_EXECUTABLE} -c ' from distutils.sysconfig import get_python_lib; print(get_python_lib())' ) "
15- CMAKE_PREFIX_PATH=" ${SITE_PACKAGES} /torch"
14+ CMAKE_PREFIX_PATH=" $( python3 -c ' import torch as _; print(_.__path__[0])' ) "
1615
1716build_jar () {
1817 pushd extension/android
Original file line number Diff line number Diff line change @@ -32,8 +32,7 @@ build_executorch() {
3232 if [ -x " $( command -v glslc) " ]; then
3333 BUILD_VULKAN=" ON"
3434 fi
35- SITE_PACKAGES=" $( ${PYTHON_EXECUTABLE} -c ' from distutils.sysconfig import get_python_lib; print(get_python_lib())' ) "
36- CMAKE_PREFIX_PATH=" ${SITE_PACKAGES} /torch"
35+ CMAKE_PREFIX_PATH=" $( python3 -c ' import torch as _; print(_.__path__[0])' ) "
3736 cmake . \
3837 -DCMAKE_INSTALL_PREFIX=cmake-out \
3938 -DCMAKE_PREFIX_PATH=" ${CMAKE_PREFIX_PATH} " \
You can’t perform that action at this time.
0 commit comments