Skip to content

Commit 9a5c409

Browse files
committed
Keep fixing CI
Summary: Test Plan: Reviewers: Subscribers: Tasks: Tags:
1 parent 7553b1b commit 9a5c409

File tree

5 files changed

+10
-2
lines changed

5 files changed

+10
-2
lines changed

.ci/scripts/build_llama_android.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,13 @@ install_executorch_and_backend_lib() {
1616
ANDROID_NDK=/opt/ndk
1717
BUCK2=buck2
1818
ANDROID_ABI=arm64-v8a
19+
PYTHON_EXECUTABLE=python3
1920
cmake -DBUCK2="${BUCK2}" \
2021
-DCMAKE_TOOLCHAIN_FILE="${ANDROID_NDK}/build/cmake/android.toolchain.cmake" \
2122
-DANDROID_ABI="${ANDROID_ABI}" \
2223
-DANDROID_PLATFORM=android-23 \
2324
-DCMAKE_INSTALL_PREFIX=cmake-android-out \
25+
-DCMAKE_PREFIX_PATH=$($PYTHON_EXECUTABLE -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())") \
2426
-DCMAKE_BUILD_TYPE=Release \
2527
-DEXECUTORCH_BUILD_EXTENSION_MODULE=ON \
2628
-DEXECUTORCH_BUILD_EXTENSION_DATA_LOADER=ON \

.ci/scripts/test_llama.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ cmake_build_llama_runner() {
7575
dir="examples/models/llama2"
7676
retry cmake -DBUCK2="$BUCK" \
7777
-DCMAKE_INSTALL_PREFIX=cmake-out \
78+
-DCMAKE_PREFIX_PATH=$($PYTHON_EXECUTABLE -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())") \
7879
-DCMAKE_BUILD_TYPE=Release \
7980
-DEXECUTORCH_BUILD_OPTIMIZED=ON \
8081
-DPYTHON_EXECUTABLE="$PYTHON_EXECUTABLE" \

CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,8 @@ cmake_dependent_option(EXECUTORCH_BUILD_CPUINFO "Build cpuinfo library." ON
187187

188188
if(EXECUTORCH_BUILD_CPUINFO)
189189
# --- cpuinfo
190+
set(ORIGINAL_CMAKE_POSITION_INDEPENDENT_CODE_FLAG ${CMAKE_POSITION_INDEPENDENT_CODE})
191+
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
190192
set(CPUINFO_SOURCE_DIR "backends/xnnpack/third-party/cpuinfo")
191193
set(CPUINFO_BUILD_TOOLS
192194
OFF
@@ -208,10 +210,13 @@ if(EXECUTORCH_BUILD_CPUINFO)
208210
CACHE STRING "")
209211
set(CLOG_SOURCE_DIR "${CPUINFO_SOURCE_DIR}/deps/clog")
210212
add_subdirectory("${CPUINFO_SOURCE_DIR}")
213+
set(CMAKE_POSITION_INDEPENDENT_CODE ${ORIGINAL_CMAKE_POSITION_INDEPENDENT_CODE_FLAG})
211214
endif()
212215

213216
if(EXECUTORCH_BUILD_PTHREADPOOL)
214217
# --- pthreadpool
218+
set(ORIGINAL_CMAKE_POSITION_INDEPENDENT_CODE_FLAG ${CMAKE_POSITION_INDEPENDENT_CODE})
219+
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
215220
set(PTHREADPOOL_SOURCE_DIR "backends/xnnpack/third-party/pthreadpool")
216221
set(PTHREADPOOL_BUILD_TESTS
217222
OFF
@@ -226,6 +231,7 @@ if(EXECUTORCH_BUILD_PTHREADPOOL)
226231
ON
227232
CACHE BOOL "")
228233
add_subdirectory("${PTHREADPOOL_SOURCE_DIR}")
234+
set(CMAKE_POSITION_INDEPENDENT_CODE ${ORIGINAL_CMAKE_POSITION_INDEPENDENT_CODE_FLAG})
229235
endif()
230236

231237
if(NOT PYTHON_EXECUTABLE)

backends/xnnpack/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ target_include_directories(
7272
xnnpack_schema INTERFACE ${_xnnpack_schema__include_dir}
7373
${EXECUTORCH_ROOT}/third-party/flatbuffers/include)
7474

75-
target_compile_options(pthreadpool PUBLIC ${_common_compile_options})
7675
set(xnnpack_third_party pthreadpool cpuinfo)
7776

7877
include(cmake/Dependencies.cmake)

examples/models/llama2/custom_ops/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ if(NOT TORCH_ROOT)
2525
set(TORCH_ROOT ${EXECUTORCH_ROOT}/third-party/pytorch)
2626
endif()
2727

28-
set(_common_compile_options -Wno-deprecated-declarations)
28+
set(_common_compile_options -Wno-deprecated-declarations -fPIC)
2929

3030
include(${EXECUTORCH_ROOT}/build/Utils.cmake)
3131
include(${EXECUTORCH_ROOT}/build/Codegen.cmake)

0 commit comments

Comments
 (0)