File tree Expand file tree Collapse file tree 4 files changed +15
-0
lines changed
Expand file tree Collapse file tree 4 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -38,6 +38,8 @@ install_executorch_and_backend_lib() {
3838build_llama_runner () {
3939 echo " Building llama runner for Android..."
4040 ANDROID_ABI=arm64-v8a
41+ SITE_PACKAGES=" $( ${PYTHON_EXECUTABLE} -c ' from distutils.sysconfig import get_python_lib; print(get_python_lib())' ) "
42+ CMAKE_PREFIX_PATH=" ${SITE_PACKAGES} /torch"
4143 cmake -DBUCK2=" ${BUCK2} " \
4244 -DCMAKE_TOOLCHAIN_FILE=" $ANDROID_NDK " /build/cmake/android.toolchain.cmake \
4345 -DANDROID_ABI=" ${ANDROID_ABI} " \
@@ -47,6 +49,7 @@ build_llama_runner() {
4749 -DEXECUTORCH_BUILD_KERNELS_OPTIMIZED=ON \
4850 -DEXECUTORCH_BUILD_KERNELS_QUANTIZED=ON \
4951 -DEXECUTORCH_BUILD_KERNELS_CUSTOM=ON \
52+ -DCMAKE_PREFIX_PATH=" ${CMAKE_PREFIX_PATH} " \
5053 -Bcmake-android-out/examples/models/llama examples/models/llama
5154
5255 cmake --build cmake-android-out/examples/models/llama -j4 --config Release
Original file line number Diff line number Diff line change @@ -50,10 +50,13 @@ 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"
5355 rm -rf ${CMAKE_OUTPUT_DIR}
5456 cmake -DCMAKE_BUILD_TYPE=Debug \
5557 -DEXECUTORCH_BUILD_KERNELS_OPTIMIZED=ON \
5658 -DPYTHON_EXECUTABLE=" $PYTHON_EXECUTABLE " \
59+ -DCMAKE_PREFIX_PATH=" $CMAKE_PREFIX_PATH " \
5760 -B${CMAKE_OUTPUT_DIR} .
5861
5962 cmake --build ${CMAKE_OUTPUT_DIR} -j4 --config Debug
Original file line number Diff line number Diff line change @@ -22,8 +22,11 @@ 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"
2527 cmake -DPYTHON_EXECUTABLE=python \
2628 -DCMAKE_INSTALL_PREFIX=${BUILD_DIR} \
29+ -DCMAKE_PREFIX_PATH=" ${CMAKE_PREFIX_PATH} " \
2730 -DEXECUTORCH_ENABLE_LOGGING=1 \
2831 -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
2932 -DEXECUTORCH_BUILD_EXTENSION_DATA_LOADER=ON \
@@ -39,8 +42,11 @@ cmake_install_executorch_libraries() {
3942}
4043
4144cmake_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"
4247 cmake -DPYTHON_EXECUTABLE=$PYTHON_EXECUTABLE \
4348 -DCMAKE_INSTALL_PREFIX=${BUILD_DIR} \
49+ -DCMAKE_PREFIX_PATH=" ${CMAKE_PREFIX_PATH} " \
4450 -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
4551 -DEXECUTORCH_BUILD_KERNELS_CUSTOM=ON \
4652 -DEXECUTORCH_BUILD_KERNELS_OPTIMIZED=ON \
Original file line number Diff line number Diff line change @@ -27,8 +27,11 @@ build_executorch() {
2727 if [ -x " $( command -v glslc) " ]; then
2828 BUILD_VULKAN=" ON"
2929 fi
30+ SITE_PACKAGES=" $( ${PYTHON_EXECUTABLE} -c ' from distutils.sysconfig import get_python_lib; print(get_python_lib())' ) "
31+ CMAKE_PREFIX_PATH=" ${SITE_PACKAGES} /torch"
3032 cmake . \
3133 -DCMAKE_INSTALL_PREFIX=cmake-out \
34+ -DCMAKE_PREFIX_PATH=" ${CMAKE_PREFIX_PATH} " \
3235 -DEXECUTORCH_USE_CPP_CODE_COVERAGE=ON \
3336 -DEXECUTORCH_BUILD_KERNELS_OPTIMIZED=ON \
3437 -DEXECUTORCH_BUILD_KERNELS_QUANTIZED=ON \
You can’t perform that action at this time.
0 commit comments