Skip to content

Commit 1446135

Browse files
committed
Fix more CI...
Summary: Test Plan: Reviewers: Subscribers: Tasks: Tags:
1 parent d29f875 commit 1446135

File tree

3 files changed

+14
-5
lines changed

3 files changed

+14
-5
lines changed

.ci/scripts/build_llama_android.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ install_executorch_and_backend_lib() {
2222
-DANDROID_ABI="${ANDROID_ABI}" \
2323
-DANDROID_PLATFORM=android-23 \
2424
-DCMAKE_INSTALL_PREFIX=cmake-android-out \
25-
-DCMAKE_PREFIX_PATH=$($PYTHON_EXECUTABLE -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())") \
2625
-DCMAKE_BUILD_TYPE=Release \
2726
-DEXECUTORCH_BUILD_EXTENSION_MODULE=ON \
2827
-DEXECUTORCH_BUILD_EXTENSION_DATA_LOADER=ON \
@@ -42,7 +41,6 @@ build_llama_runner() {
4241
-DANDROID_ABI="${ANDROID_ABI}" \
4342
-DANDROID_PLATFORM=android-23 \
4443
-DCMAKE_INSTALL_PREFIX=cmake-android-out \
45-
-DCMAKE_PREFIX_PATH=$($PYTHON_EXECUTABLE -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())") \
4644
-DCMAKE_BUILD_TYPE=Release -DPYTHON_EXECUTABLE=python \
4745
-DEXECUTORCH_BUILD_OPTIMIZED=ON \
4846
-Bcmake-android-out/examples/models/llama2 examples/models/llama2

.ci/scripts/test_llama.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,12 @@ else
116116
exit 1
117117
fi
118118

119+
# For cmake install custom ops before running
120+
if [[ "${BUILD_TOOL}" == "cmake" ]]; then
121+
echo "Installing executorch libraries"
122+
cmake_install_executorch_libraries
123+
fi
124+
119125
# Export model.
120126
EXPORTED_MODEL_NAME="${EXPORTED_MODEL_NAME}.pte"
121127
echo "Exporting ${EXPORTED_MODEL_NAME}"
@@ -142,7 +148,6 @@ if [[ "${BUILD_TOOL}" == "buck2" ]]; then
142148
# shellcheck source=/dev/null
143149
$BUCK run examples/models/llama2:main -- ${RUNTIME_ARGS} > result.txt
144150
elif [[ "${BUILD_TOOL}" == "cmake" ]]; then
145-
cmake_install_executorch_libraries
146151
cmake_build_llama_runner
147152
# Run llama runner
148153
NOW=$(date +"%H:%M:%S")

examples/models/llama2/CMakeLists.txt

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,9 @@ if(CMAKE_TOOLCHAIN_IOS OR ANDROID)
7474
endif()
7575

7676
# custom ops library
77-
add_subdirectory(custom_ops)
77+
if(EXECUTORCH_BUILD_CUSTOM)
78+
add_subdirectory(custom_ops)
79+
endif()
7880

7981
# llama_runner library
8082
add_subdirectory(runner)
@@ -107,7 +109,11 @@ else()
107109
target_link_options_shared_lib(portable_ops_lib)
108110
endif()
109111

110-
target_link_libraries(llama_main PUBLIC gflags llama_runner custom_ops)
112+
if(EXECUTORCH_BUILD_CUSTOM)
113+
list(APPEND link_libraries custom_ops)
114+
endif()
115+
116+
target_link_libraries(llama_main PUBLIC gflags llama_runner)
111117

112118
# XNNPACK pthreadpool cpuinfo
113119
if(TARGET xnnpack_backend)

0 commit comments

Comments
 (0)