File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,13 @@ IF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
27
27
SET (CMAKE_INSTALL_PREFIX ${TORCHCHAT_ROOT} /${ET_BUILD_DIR}/install CACHE PATH "Setting it to a default value" FORCE )
28
28
ENDIF (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT )
29
29
30
+ # Building for Android. Since Android overwrites CMAKE_FIND_ROOT_PATH normal
31
+ # CMAKE_INSTALL_PREFIX won't work. Redirect CMAKE_FIND_ROOT_PATH to it.
32
+ # This should check any cross compilation but let's do Android for now
33
+ if (ANDROID )
34
+ set (CMAKE_FIND_ROOT_PATH "${CMAKE_INSTALL_PREFIX} " )
35
+ endif ()
36
+
30
37
include (CMakePrintHelpers )
31
38
include (runner/Utils.cmake )
32
39
@@ -76,7 +83,7 @@ if(executorch_FOUND)
76
83
endif ()
77
84
78
85
target_link_libraries (et_run PRIVATE
79
- "$<LINK_LIBRARY:WHOLE_ARCHIVE,${TORCHCHAT_ROOT} /${ET_BUILD_DIR} /install/libcustom_ops.a>" )
86
+ "$<LINK_LIBRARY:WHOLE_ARCHIVE,${TORCHCHAT_ROOT} /${ET_BUILD_DIR} /install/lib/ libcustom_ops.a>" )
80
87
# This one is needed for cpuinfo where it uses android specific log lib
81
88
if (ANDROID )
82
89
target_link_libraries (et_run PRIVATE log )
@@ -97,4 +104,6 @@ if(executorch_FOUND)
97
104
# This works on mac, but appears to run into issues on linux
98
105
# It is needed to solve:
99
106
# E 00:00:00.055965 executorch:method.cpp:536] Missing operator: [8] llama::sdpa_with_kv_cache.out
107
+ else ()
108
+ MESSAGE (WARNING "ExecuTorch package not found" )
100
109
endif ()
Original file line number Diff line number Diff line change 76
76
cmake -S . -B ./cmake-out -DCMAKE_PREFIX_PATH=` python -c ' import torch;print(torch.utils.cmake_prefix_path)' ` -G Ninja
77
77
cmake --build ./cmake-out --target " ${TARGET} " _run
78
78
79
- printf " Build finished. Please run: \n./cmake-out model.<pte|so> -z tokenizer.model -i <prompt>"
79
+ printf " Build finished. Please run: \n./cmake-out/ ${TARGET} _run model.<pte|so> -z tokenizer.model -i <prompt>"
You can’t perform that action at this time.
0 commit comments