fix tflite python whl package pybind11 build fail

This commit is contained in:
Leslie-Fang 2020-04-26 03:48:51 +08:00
parent 64c32cf510
commit b7b0761566
2 changed files with 5 additions and 2 deletions

View File

@ -9,6 +9,7 @@ To build a binary wheel run this script:
```sh ```sh
sudo apt install swig libjpeg-dev zlib1g-dev python3-dev python3-numpy sudo apt install swig libjpeg-dev zlib1g-dev python3-dev python3-numpy
pip install numpy pybind11
sh tensorflow/lite/tools/make/download_dependencies.sh sh tensorflow/lite/tools/make/download_dependencies.sh
sh tensorflow/lite/tools/pip_package/build_pip_package.sh sh tensorflow/lite/tools/pip_package/build_pip_package.sh
``` ```

View File

@ -33,6 +33,7 @@ import sysconfig
from distutils.command.build_ext import build_ext from distutils.command.build_ext import build_ext
import numpy import numpy
import pybind11
from setuptools import Extension from setuptools import Extension
from setuptools import find_packages from setuptools import find_packages
@ -178,8 +179,9 @@ ext = Extension(
'pip_package'), 'pip_package'),
numpy.get_include(), numpy.get_include(),
os.path.join(DOWNLOADS_DIR, 'flatbuffers', 'include'), os.path.join(DOWNLOADS_DIR, 'flatbuffers', 'include'),
os.path.join(DOWNLOADS_DIR, 'absl') os.path.join(DOWNLOADS_DIR, 'absl'),
] + get_pybind_include(), pybind11.get_include()
],
libraries=[LIB_TFLITE], libraries=[LIB_TFLITE],
library_dirs=[LIB_TFLITE_DIR]) library_dirs=[LIB_TFLITE_DIR])