This repository has been archived by the owner on Feb 15, 2021. It is now read-only.
forked from mlcommons/inference
-
Notifications
You must be signed in to change notification settings - Fork 2
/
BUILD.gn
61 lines (57 loc) · 1.96 KB
/
BUILD.gn
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
group("gn_all") {
deps = [
"loadgen:docs",
"loadgen:mlperf_loadgen",
"loadgen:mlperf_loadgen_pymodule_lib",
"loadgen/docs/src:generate_doxygen_html",
"loadgen/demos:loadgen_demos_python",
"loadgen/tests:docs",
"loadgen/tests:mlperf_loadgen_perftests",
"loadgen/tests:mlperf_loadgen_tests_basic",
]
}
# This is the only approach to creating the python module that works currently.
# It compiles the entire library using whatever python's toolchain is.
# To change which python binary compiles the module, change gn's
# python_path built-in variable via "gn args <outdir>" for existing out
# directories or via 'gn gen --agrs="python_path=..."' for new out directories.
action("loadgen_pymodule_wheel_src") {
script = get_path_info(".", "gen_dir") + "/loadgen_pymodule_setup_src.py"
deps = [
"loadgen:c_api_src",
"loadgen:lib_src",
"loadgen:public_headers_src",
"loadgen:python_api_src",
"third_party:pybind_src",
":loadgen_pymodule_setup_src",
]
outputs = [
get_path_info(".", "out_dir") + "/dist/mlperf_loadgen-0.5a0.tar.gz"
]
args = [ "bdist_wheel" ]
}
copy("loadgen_pymodule_setup_src") {
sources = [ "loadgen_pymodule_setup_src.py" ]
outputs = [ get_path_info(".", "gen_dir") + "/{{source_file_part}}" ]
}
# Include the loadgen as a static lib in the python module.
# Python only compiles the lib bindings from source.
action("loadgen_pymodule_wheel_lib") {
script = get_path_info(".", "gen_dir") + "/loadgen_pymodule_setup_lib.py"
deps = [
"loadgen:c_api_src",
"loadgen:public_headers_src",
"loadgen:python_api_src",
"loadgen:mlperf_loadgen",
"third_party:pybind_src",
":loadgen_pymodule_setup_lib",
]
outputs = [
get_path_info(".", "out_dir") + "/dist/mlperf_loadgen_lib-0.5a0.tar.gz"
]
args = [ "bdist_wheel" ]
}
copy("loadgen_pymodule_setup_lib") {
sources = [ "loadgen_pymodule_setup_lib.py" ]
outputs = [ get_path_info(".", "gen_dir") + "/{{source_file_part}}" ]
}