Skip to content

Commit

Permalink
LoadGen: Fix pybind include dirs.
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian C. Anderson committed Apr 11, 2019
1 parent fae96bf commit dcce465
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 7 deletions.
3 changes: 2 additions & 1 deletion loadgen/BUILD.gn
Expand Up @@ -60,7 +60,8 @@ loadable_module("mlperf_loadgen_pymodule_lib") {
sources = [ "bindings/python_api.cc" ]
deps = [ ":mlperf_loadgen", "../third_party:pybind11" ]
configs += [ "//build/config/compiler:rtti",
"//build/config/compiler:exceptions" ]
"//build/config/compiler:exceptions",
"../third_party:pybind11_include", ]
cflags = [ "-Wno-macro-redefined" ]
include_dirs = [ "." ] + py_include_dirs
ldflags = py_ld_flags
Expand Down
8 changes: 4 additions & 4 deletions loadgen/bindings/python_api.cc
Expand Up @@ -3,10 +3,10 @@

#include <functional>

#include "third_party/pybind/include/pybind11/functional.h"
#include "third_party/pybind/include/pybind11/pybind11.h"
#include "third_party/pybind/include/pybind11/stl.h"
#include "third_party/pybind/include/pybind11/stl_bind.h"
#include "pybind11/functional.h"
#include "pybind11/pybind11.h"
#include "pybind11/stl.h"
#include "pybind11/stl_bind.h"

#include "../loadgen.h"
#include "../query_sample.h"
Expand Down
2 changes: 1 addition & 1 deletion loadgen_pymodule_setup_lib.py
Expand Up @@ -12,7 +12,7 @@
('MINOR_VERSION', '5')],
library_dirs = ['obj/loadgen'],
libraries = ['mlperf_loadgen'],
include_dirs = [ 'gen' ],
include_dirs = [ 'gen', 'gen/third_party/pybind/include' ],
sources = [ 'gen/loadgen/bindings/python_api.cc' ])

setup (name = 'mlperf_loadgen_lib',
Expand Down
2 changes: 1 addition & 1 deletion loadgen_pymodule_setup_src.py
Expand Up @@ -16,7 +16,7 @@
mlperf_loadgen_module = Extension('mlperf_loadgen',
define_macros = [('MAJOR_VERSION', '0'),
('MINOR_VERSION', '5')],
include_dirs = [ 'gen' ],
include_dirs = [ 'gen', 'gen/third_party/pybind/include' ],
sources = [ "gen/loadgen/" + s for s in sources ])

setup (name = 'mlperf_loadgen',
Expand Down
4 changes: 4 additions & 0 deletions third_party/BUILD.gn
Expand Up @@ -29,6 +29,10 @@ source_set("pybind11") {
sources = pybind11_sources
}

config("pybind11_include") {
include_dirs = [ "pybind/include" ]
}

copy("pybind_src") {
sources = pybind11_sources
outputs = [ get_path_info("//", "gen_dir") + "/{{source}}" ]
Expand Down

0 comments on commit dcce465

Please sign in to comment.