[DRAFT] Allow compilation on Apple Silicon #212
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The changes here get most of the way to building a wheel for ml-metadata for MacOS on Apple Silicon. This currently does not succeed and I would ask for some help from the maintainers to understand what the way forward should be:
metadata_store_extension
.See the following sections for more details
Modifying the CC toolchain
The following manual steps need to be done to by modifying files directly in the
external
bazel directory.brew install libiconv
bazel_tools/tools/cpp/unix_cc_toolchain_config.bzl
to remove the-static -s
flag groupundefined dynamic_lookup
fromlocal_config_cc/BUILD
-L$(ICONV_PATH)/lib -liconv
tolink_libs
inlocal_config_cc/BUILD
USE_BAZEL_VERSION=6.1.0 ICONV_PATH=/opt/homebrew/opt/libiconv python setup.py build
What is the most bazel-like way to to embed these modifications?
Error during linking stage
The build fails at the very end due to some symbols not being found (see attached for the full output) with the salient part of the error posted here:
I'm guessing that this has something to do with the way that pybind11 prepends function names to objects, but I am definitely out of my depth on this one.
Does this problem arise from incorrect name mangling or does it require some other modification to the link instructions?
link_error.txt