diff options
author | Pete Warden <pete@petewarden.com> | 2017-10-10 23:50:29 -0700 |
---|---|---|
committer | gunan <gunan@google.com> | 2017-10-10 23:50:29 -0700 |
commit | 1ad5e692e2fc218ca0b2a9a461c19762fdc9674b (patch) | |
tree | 724734c940a94af002b6780137450474d9c9925f /third_party/toolchains/cpus | |
parent | 48be6a56d5c49d019ca049f8c48b2df597594343 (diff) |
Added support for Python3 Raspberry Pi CI builds (#13612)
* Fix for RTLD_GLOBAL breakage of Pi builds, and removed Eigen version change for Pi that's no longer needed
* Fixed Pi Zero OpenBLAS build problems and tidied up directories used
* More robust checks in Pi build script
* Changed output directory for Pi CI build to fix permissions problem
* Added support for Python3 Raspberry Pi CI builds
* Tidied up comments and updated Python tool template
* Cleaned up Python include path logic
Diffstat (limited to 'third_party/toolchains/cpus')
-rw-r--r-- | third_party/toolchains/cpus/arm/CROSSTOOL.tpl | 2 | ||||
-rw-r--r-- | third_party/toolchains/cpus/arm/arm_compiler_configure.bzl | 11 |
2 files changed, 12 insertions, 1 deletions
diff --git a/third_party/toolchains/cpus/arm/CROSSTOOL.tpl b/third_party/toolchains/cpus/arm/CROSSTOOL.tpl index ad7f5596d0..f0e17d1fe0 100644 --- a/third_party/toolchains/cpus/arm/CROSSTOOL.tpl +++ b/third_party/toolchains/cpus/arm/CROSSTOOL.tpl @@ -87,7 +87,7 @@ toolchain { cxx_flag: "-isystem" cxx_flag: "/usr/include/arm-linux-gnueabihf" cxx_flag: "-isystem" - cxx_flag: "/usr/include/python2.7" + cxx_flag: "%{PYTHON_INCLUDE_PATH}%" cxx_flag: "-isystem" cxx_flag: "/usr/include/" linker_flag: "-lstdc++" diff --git a/third_party/toolchains/cpus/arm/arm_compiler_configure.bzl b/third_party/toolchains/cpus/arm/arm_compiler_configure.bzl index 5eb3b7bb1c..ab6eac115c 100644 --- a/third_party/toolchains/cpus/arm/arm_compiler_configure.bzl +++ b/third_party/toolchains/cpus/arm/arm_compiler_configure.bzl @@ -11,9 +11,20 @@ def _tpl(repository_ctx, tpl, substitutions={}, out=None): def _arm_compiler_configure_impl(repository_ctx): + # We need to find a cross-compilation include directory for Python, so look + # for an environment variable. Be warned, this crosstool template is only + # regenerated on the first run of Bazel, so if you change the variable after + # it may not be reflected in later builds. Doing a shutdown and clean of Bazel + # doesn't fix this, you'll need to delete the generated file at something like: + # external/local_config_arm_compiler/CROSSTOOL in your Bazel install. + if "CROSSTOOL_PYTHON_INCLUDE_PATH" in repository_ctx.os.environ: + python_include_path = repository_ctx.os.environ["CROSSTOOL_PYTHON_INCLUDE_PATH"] + else: + python_include_path = "/usr/include/python2.7" _tpl(repository_ctx, "CROSSTOOL", { "%{ARM_COMPILER_PATH}%": str(repository_ctx.path( repository_ctx.attr.remote_config_repo)), + "%{PYTHON_INCLUDE_PATH}%": python_include_path, }) repository_ctx.symlink(repository_ctx.attr.build_file, "BUILD") |