我正在尝试在MacOS 11.4上构建TensorFlow Lite库。我需要构建的库能够在MacOS 10.13或更高版本上运行。但是,构建工具链中的某些内容将目标OS设置为11.3,因此-s
打印的完整编译命令如下所示
(cd /private/var/tmp/_bazel_ojs/8ce6bb5f0f6d53a52ea9c48238c2c3a8/execroot/org_tensorflow && \
exec env - \
APPLE_SDK_PLATFORM=MacOSX \
APPLE_SDK_VERSION_OVERRIDE=11.3 \
PATH=/Users/ojs/Library/Caches/bazelisk/downloads/bazelbuild/bazel-3.7.2-darwin-x86_64/bin:/Users/ojs/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Users/ojs/Library/Android/sdk/platform-tools \
TF2_BEHAVIOR=1 \
XCODE_VERSION_OVERRIDE=12.5.0.12E262 \
external/local_config_cc/wrapped_clang '-D_FORTIFY_SOURCE=1' -fstack-protector -fcolor-diagnostics -Wall -Wthread-safety -Wself-assign -fno-omit-frame-pointer -g0 -O2 '-D_FORTIFY_SOURCE=1' -DNDEBUG '-DNS_BLOCK_ASSERTIONS=1' '-std=c++11' -iquote external/ruy -iquote bazel-out/darwin-opt/bin/external/ruy -iquote external/cpuinfo -iquote bazel-out/darwin-opt/bin/external/cpuinfo -iquote external/clog -iquote bazel-out/darwin-opt/bin/external/clog -Ibazel-out/darwin-opt/bin/external/cpuinfo/_virtual_includes/cpuinfo -Ibazel-out/darwin-opt/bin/external/clog/_virtual_includes/clog -MD -MF bazel-out/darwin-opt/bin/external/ruy/ruy/_objs/frontend/frontend.d '-DCLOG_VISIBILITY=' '-frandom-seed=bazel-out/darwin-opt/bin/external/ruy/ruy/_objs/frontend/frontend.o' -isysroot __BAZEL_XCODE_SDKROOT__ -F__BAZEL_XCODE_SDKROOT__/System/Library/Frameworks -F__BAZEL_XCODE_DEVELOPER_DIR__/Platforms/MacOSX.platform/Developer/Library/Frameworks '-mmacosx-version-min=11.3' -DGRPC_BAZEL_BUILD -w -mavx '-std=c++14' -Wall -Wextra -Wc++14-compat -Wundef -O3 -no-canonical-prefixes -Wno-builtin-macro-redefined '-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' -c external/ruy/ruy/frontend.cc -o bazel-out/darwin-opt/bin/external/ruy/ruy/_objs/frontend/frontend.o)
在命令行上使用--copt='-mmacosx-version-min=10.13'
生成的编译器命令在参数列表中同时具有'-mmacosx-version-min=11.3'
和'-mmacosx-version-min=10.13'
,并且生成的二进制文件似乎具有更高的要求。将APPLE_SDK_VERSION_OVERRIDE
设置为环境变量或使用--action_env
都不会更改构建日志中显示的值。我在项目的bazel构建文件中找不到任何APPLE_SDK_VERSION_OVERRIDE
实例。如何设置目标平台?
发布于 2021-07-02 23:37:42
它的工作方式是Bazel命令行选项--macos_minimum_os
(或相关的--macos_minimum_os
)。
如果你知道要搜索什么,它就在文档中,但显然不能被Google发现。我是通过阅读Bazel源码找到的。
https://stackoverflow.com/questions/68222241
复制相似问题