Skip to content

Commit b087f84

Browse files
cccclaifacebook-github-bot
authored andcommitted
set env in buck file
Summary: Simply the the env path and no need to set `LD_LIBRARY_PATH` manually Differential Revision: D63556730
1 parent b4a6148 commit b087f84

File tree

2 files changed

+43
-37
lines changed

2 files changed

+43
-37
lines changed

backends/qualcomm/runtime/targets.bzl

Lines changed: 34 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -33,43 +33,40 @@ def define_common_targets():
3333
)
3434

3535
runtime.cxx_library(
36-
name = "runtime",
37-
srcs = glob(
38-
[
39-
"*.cpp",
40-
"backends/*.cpp",
41-
"backends/htpbackend/*.cpp",
42-
"backends/htpbackend/aarch64/*.cpp",
43-
],
44-
exclude = ["Logging.cpp"],
45-
),
46-
exported_headers = glob(
47-
[
48-
"*.h",
49-
"backends/*.h",
50-
"backends/htpbackend/*.h",
51-
],
52-
exclude = ["Logging.h"],
53-
),
54-
define_static_target = True,
55-
link_whole = True, # needed for executorch/examples/models/llama2:main to register QnnBackend
56-
platforms = [ANDROID],
57-
visibility = ["@EXECUTORCH_CLIENTS"],
58-
resources = {
59-
"qnn_lib": "fbsource//third-party/qualcomm/qnn/qnn-2.25:qnn_offline_compile_libs",
60-
},
61-
deps = [
62-
"fbsource//third-party/qualcomm/qnn:api",
63-
":logging",
64-
"//executorch/backends/qualcomm:schema",
65-
"//executorch/backends/qualcomm/aot/ir:qcir_utils",
66-
"//executorch/backends/qualcomm/aot/wrappers:wrappers",
67-
"//executorch/runtime/backend:interface",
68-
"//executorch/runtime/core:core",
69-
"//executorch/extension/tensor:tensor",
36+
name = "runtime",
37+
srcs = glob(
38+
[
39+
"*.cpp",
40+
"backends/*.cpp",
41+
"backends/htpbackend/*.cpp",
42+
"backends/htpbackend/aarch64/*.cpp",
7043
],
71-
exported_deps = [
72-
"//executorch/runtime/core/exec_aten/util:scalar_type_util",
73-
"//executorch/runtime/core:event_tracer",
44+
exclude = ["Logging.cpp"],
45+
),
46+
exported_headers = glob(
47+
[
48+
"*.h",
49+
"backends/*.h",
50+
"backends/htpbackend/*.h",
7451
],
52+
exclude = ["Logging.h"],
53+
),
54+
define_static_target = True,
55+
link_whole = True, # needed for executorch/examples/models/llama2:main to register QnnBackend
56+
platforms = [ANDROID],
57+
visibility = ["@EXECUTORCH_CLIENTS"],
58+
deps = [
59+
"fbsource//third-party/qualcomm/qnn:api",
60+
":logging",
61+
"//executorch/backends/qualcomm:schema",
62+
"//executorch/backends/qualcomm/aot/ir:qcir_utils",
63+
"//executorch/backends/qualcomm/aot/wrappers:wrappers",
64+
"//executorch/runtime/backend:interface",
65+
"//executorch/runtime/core:core",
66+
"//executorch/extension/tensor:tensor",
67+
],
68+
exported_deps = [
69+
"//executorch/runtime/core/exec_aten/util:scalar_type_util",
70+
"//executorch/runtime/core:event_tracer",
71+
],
7572
)

examples/models/llama2/TARGETS

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Any targets that should be shared between fbcode and xplat must be defined in
22
# targets.bzl. This file can contain fbcode-only targets.
33

4+
load("@fbsource//tools/build_defs:fb_native_wrapper.bzl", "fb_native")
45
load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime")
56
load(":targets.bzl", "define_common_targets")
67

@@ -65,6 +66,14 @@ runtime.python_binary(
6566
],
6667
)
6768

69+
fb_native.command_alias(
70+
name = "export_llama_qnn",
71+
env = {
72+
"LD_LIBRARY_PATH": "$(location fbsource//third-party/qualcomm/qnn/qnn-2.25:qnn_offline_compile_libs)",
73+
},
74+
exe = ":export_llama",
75+
)
76+
6877
runtime.python_library(
6978
name = "export_library",
7079
srcs = [

0 commit comments

Comments
 (0)