Skip to content

Commit 09ff0d0

Browse files
committed
Cmake
1 parent 1e9bb6e commit 09ff0d0

File tree

3 files changed

+20
-3
lines changed

3 files changed

+20
-3
lines changed

examples/models/llama/runner/CMakeLists.txt

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,18 @@ add_subdirectory(
7777
${EXECUTORCH_ROOT}/extension/llm/tokenizers/third-party/re2
7878
${CMAKE_CURRENT_BINARY_DIR}/re2
7979
)
80+
add_subdirectory(
81+
${EXECUTORCH_ROOT}/extension/llm/tokenizers/third-party/json
82+
${CMAKE_CURRENT_BINARY_DIR}/json
83+
)
84+
target_include_directories(llama_runner
85+
PRIVATE ${CMAKE_INSTALL_PREFIX}/include
86+
${CMAKE_CURRENT_SOURCE_DIR}/../tokenizers/third-party/llama.cpp-unicode
87+
)
8088
set(CMAKE_POSITION_INDEPENDENT_CODE ${_pic_flag})
8189

8290
set(llama_runner_deps executorch extension_data_loader extension_module
83-
extension_tensor re2::re2
91+
extension_tensor re2::re2 nlohmann_json::nlohmann_json
8492
)
8593

8694
target_link_libraries(llama_runner PUBLIC ${llama_runner_deps})

examples/models/llama/runner/targets.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def define_common_targets():
4949
"//executorch/runtime/core/exec_aten/util:tensor_util" + aten_suffix,
5050
"//executorch/examples/models/llama/tokenizer:tiktoken",
5151
"//pytorch/tokenizers:llama2c_tokenizer",
52-
"//pytorch/tokenizers:hf_tokenizer",
52+
"//pytorch/tokenizers:hf_tokenizer",
5353
] + (_get_operator_lib(aten)) + ([
5454
# Vulkan API currently cannot build on some platforms (e.g. Apple, FBCODE)
5555
# Therefore enable it explicitly for now to avoid failing tests

extension/llm/tokenizer/CMakeLists.txt

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,15 @@ add_subdirectory(
2828
${CMAKE_CURRENT_SOURCE_DIR}/../tokenizers/third-party/re2
2929
${CMAKE_CURRENT_BINARY_DIR}/re2
3030
)
31+
# add_subdirectory(
32+
# ${CMAKE_CURRENT_SOURCE_DIR}/../tokenizers/third-party/json
33+
# ${CMAKE_CURRENT_BINARY_DIR}/json
34+
# )
35+
# target_include_directories(extension_llm_tokenizer
36+
# PRIVATE ${CMAKE_INSTALL_PREFIX}/include
37+
# ${CMAKE_CURRENT_SOURCE_DIR}/../tokenizers/third-party/llama.cpp-unicode
38+
# )
39+
3140
set(CMAKE_POSITION_INDEPENDENT_CODE ${_pic_flag})
3241

3342
list(TRANSFORM _extension_llm_tokenizer__srcs PREPEND "${EXECUTORCH_ROOT}/")
@@ -38,7 +47,7 @@ target_include_directories(
3847
${CMAKE_CURRENT_SOURCE_DIR}/../tokenizers/include
3948
)
4049

41-
target_link_libraries(extension_llm_tokenizer re2::re2)
50+
# target_link_libraries(extension_llm_tokenizer re2::re2 nlohmann_json::nlohmann_json )
4251
target_compile_options(
4352
extension_llm_tokenizer PUBLIC ${_common_compile_options}
4453
)

0 commit comments

Comments
 (0)