tensorflow/text

Can't build from source on M1

dlwh opened this issue · 5 comments

dlwh commented

Hi,

I'm on an M1 back. I've installed tensorflow-macos and would like to build this from scratch, which I think should be possible (as per #756). However, I'm getting issues building dependencies namely com_google_sentencepiece:

ERROR: /private/var/tmp/_bazel_dlwh/5b5343ed274731dd03bb9e218576ebef/external/com_google_sentencepiece/BUILD.bazel:51:11: Compiling src/model_interface.cc failed: (Exit 1): cc_wrapper.sh failed: error executing command external/local_config_cc/cc_wrapper.sh -U_FORTIFY_SOURCE -fstack-protector -Wall -Wthread-safety -Wself-assign -Wunused-but-set-parameter -Wno-free-nonheap-object -fcolor-diagnostics ... (remaining 70 arguments skipped)
external/com_google_sentencepiece/src/model_interface.cc:20:10: error: module @com_google_sentencepiece//:sentencepiece_processor does not depend on a module exporting 'absl/strings/str_format.h'
#include "absl/strings/str_format.h"

Due to a race I sometimes get errors about not depending on darts_clone instead. I've tried master and v2.9.0

Am I doing something wrong?

Here is my pre-compiled whl file, and you can check if yours is different from the tutorial. There has been a problem similar to yours, and you can discuss it here.

dlwh commented

Did anyone get this to work on a more recent tree or with Python 3.10? tensorflow_text-2.9.0-cp310-cp310-macosx_11_0_arm64.whl - I didn't try a recent tree with Python 3.9.

ImportError: dlopen(...python3.10/site-packages/tensorflow_text/core/pybinds/tflite_registrar.so, 0x0002): tried: '...lib/python3.10/site-packages/tensorflow_text/core/pybinds/tflite_registrar.so' (mach-o file, but is an incompatible architecture (have (x86_64), need (arm64e)))