Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tensorflow-lite with Flex Delegates build fails for aarch64 source architecture using TF2.7 #54517

Closed
OAHLSTM opened this issue Feb 24, 2022 · 5 comments
Assignees
Labels
comp:lite TF Lite related issues stat:awaiting response Status - Awaiting response from author subtype:bazel Bazel related Build_Installation issues TF 2.7 Issues related to TF 2.7.0 type:build/install Build and install issues

Comments

@OAHLSTM
Copy link

OAHLSTM commented Feb 24, 2022

System information

  • Have I written custom code (as opposed to using a stock example script provided in TensorFlow): No
  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Linux 583dc6ac55ff 5.4.144+
  • Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device: No
  • TensorFlow installed from (source or binary): Source
  • TensorFlow version (use command below): 2.7.0
  • Python version: 3.7.12
  • Bazel version (if compiling from source): 3.7.2

Describe the current behavior
I'm trying to build a shared library for tensorflow-lite including the Flex Delegate by Modifying the BUILD to add following dependency:

"//tensorflow/lite/delegates/flex:delegate",

Since I'm targeting a Linux system running on my aarch64 board, the command I ran is the below:

bazel build --config=monolithic --config=noaws --config=nogcp --config=nohdfs \
 --config=nonccl --config=elinux_aarch64 \
 --experimental_ui_max_stdouterr_bytes=1073741819 -c opt --cxxopt=--std=c++14 \
 //tensorflow/lite:libtensorflowlite.so

I also made sure to hide my OpenSSL from my /usr/include as suggested in the following issue #48401. I noticed that the build fails at compiling icu external source code.

Describe the expected behavior
The expected behavior is a build completed successfully and a shared library libtensorflow-lite.so generated and supporting Flex Delegates with TF selected Ops.

Standalone code to reproduce the issue
Here is a Google Colab gist to reproduce the Build issue. All you need to do is to modify the tensorflow/lite/BUILD by adding the following line to the libtensorflow-lite.so deps.

"//tensorflow/lite/delegates/flex:delegate",

Other info / logs
Here is the full traceback of the error that shows in the middle of the build and makes it fail.

ERROR: /root/.cache/bazel/_bazel_root/889612a75a81b3d8b4ed860522ba4e34/external/icu/BUILD.bazel:33:11: C++ compilation of rule '@icu//:icuuc' failed (Exit 1): aarch64-linux-gnu-gcc failed: error executing command /root/.cache/bazel/_bazel_root/889612a75a81b3d8b4ed860522ba4e34/external/aarch64_linux_toolchain/bin/aarch64-linux-gnu-gcc -fstack-protector -g0 -O2 -DNDEBUG -ffunction-sections -fdata-sections ... (remaining 41 argument(s) skipped)
external/icu/icu4c/source/common/localebuilder.cpp: In member function 'icu_60::LocaleBuilder& icu_60::LocaleBuilder::setLanguageTag(icu_60::StringPiece)':
external/icu/icu4c/source/common/localebuilder.cpp:63:24: error: 'forLanguageTag' is not a member of 'icu_60::Locale'
     Locale l = Locale::forLanguageTag(tag, status_);
                        ^~~~~~~~~~~~~~
external/icu/icu4c/source/common/localebuilder.cpp: In function 'void icu_60::_copyExtensions(const icu_60::Locale&, icu_60::Locale*, bool, UErrorCode&)':
external/icu/icu4c/source/common/localebuilder.cpp:166:23: error: invalid use of incomplete type 'class icu_60::StringEnumeration'
     while ((key = iter->next(nullptr, errorCode)) != nullptr) {
                       ^~
In file included from external/icu/icu4c/source/common/unicode/uloc.h:27,
                 from external/icu/icu4c/source/common/ulocimp.h:14,
                 from external/icu/icu4c/source/common/localebuilder.cpp:9:
/usr/include/unicode/uenum.h:27:7: note: forward declaration of 'class icu_60::StringEnumeration'
 class StringEnumeration;
       ^~~~~~~~~~~~~~~~~
external/icu/icu4c/source/common/localebuilder.cpp:169:50: error: no matching function for call to 'icu_60::Locale::getKeywordValue(const char*&, icu_60::CharStringByteSink&, UErrorCode&) const'
         from.getKeywordValue(key, sink, errorCode);
                                                  ^
In file included from external/icu/icu4c/source/common/unicode/localebuilder.h:6,
                 from external/icu/icu4c/source/common/localebuilder.cpp:10:
/usr/include/unicode/locid.h:457:13: note: candidate: 'int32_t icu_60::Locale::getKeywordValue(const char*, char*, int32_t, UErrorCode&) const'
     int32_t getKeywordValue(const char* keywordName, char *buffer, int32_t bufferCapacity, UErrorCode &status) const;
             ^~~~~~~~~~~~~~~
/usr/include/unicode/locid.h:457:13: note:   candidate expects 4 arguments, 3 provided
external/icu/icu4c/source/common/localebuilder.cpp: In function 'void icu_60::_clearUAttributesAndKeyType(icu_60::Locale*, UErrorCode&)':
external/icu/icu4c/source/common/localebuilder.cpp:191:55: error: 'class icu_60::Locale' has no member named 'createUnicodeKeywords'; did you mean 'createKeywords'?
     LocalPointer<icu::StringEnumeration> iter(locale->createUnicodeKeywords(errorCode));
                                                       ^~~~~~~~~~~~~~~~~~~~~
                                                       createKeywords
external/icu/icu4c/source/common/localebuilder.cpp:194:23: error: invalid use of incomplete type 'class icu_60::StringEnumeration'
     while ((key = iter->next(nullptr, errorCode)) != nullptr) {
                       ^~
In file included from external/icu/icu4c/source/common/unicode/uloc.h:27,
                 from external/icu/icu4c/source/common/ulocimp.h:14,
                 from external/icu/icu4c/source/common/localebuilder.cpp:9:
/usr/include/unicode/uenum.h:27:7: note: forward declaration of 'class icu_60::StringEnumeration'
 class StringEnumeration;
       ^~~~~~~~~~~~~~~~~
external/icu/icu4c/source/common/localebuilder.cpp:195:17: error: 'class icu_60::Locale' has no member named 'setUnicodeKeywordValue'; did you mean 'setKeywordValue'?
         locale->setUnicodeKeywordValue(key, nullptr, errorCode);
                 ^~~~~~~~~~~~~~~~~~~~~~
                 setKeywordValue
external/icu/icu4c/source/common/localebuilder.cpp: In function 'void icu_60::_setUnicodeExtensions(icu_60::Locale*, const icu_60::CharString&, UErrorCode&)':
external/icu/icu4c/source/common/localebuilder.cpp:206:17: error: 'forLanguageTag' is not a member of 'icu_60::Locale'
         Locale::forLanguageTag(locale_str.data(), errorCode),
                 ^~~~~~~~~~~~~~
external/icu/icu4c/source/common/localebuilder.cpp: In member function 'icu_60::LocaleBuilder& icu_60::LocaleBuilder::setExtension(char, icu_60::StringPiece)':
external/icu/icu4c/source/common/localebuilder.cpp:235:45: error: no matching function for call to 'icu_60::Locale::setKeywordValue(icu_60::StringPiece, char*, UErrorCode&)'
                                      status_);
                                             ^
In file included from external/icu/icu4c/source/common/unicode/localebuilder.h:6,
                 from external/icu/icu4c/source/common/localebuilder.cpp:10:
/usr/include/unicode/locid.h:473:10: note: candidate: 'void icu_60::Locale::setKeywordValue(const char*, const char*, UErrorCode&)'
     void setKeywordValue(const char* keywordName, const char* keywordValue, UErrorCode &status);
          ^~~~~~~~~~~~~~~
/usr/include/unicode/locid.h:473:10: note:   no known conversion for argument 1 from 'icu_60::StringPiece' to 'const char*'
external/icu/icu4c/source/common/localebuilder.cpp: In member function 'icu_60::LocaleBuilder& icu_60::LocaleBuilder::setUnicodeLocaleKeyword(icu_60::StringPiece, icu_60::StringPiece)':
external/icu/icu4c/source/common/localebuilder.cpp:263:18: error: 'class icu_60::Locale' has no member named 'setUnicodeKeywordValue'; did you mean 'setKeywordValue'?
     extensions_->setUnicodeKeywordValue(key, type, status_);
                  ^~~~~~~~~~~~~~~~~~~~~~
                  setKeywordValue
external/icu/icu4c/source/common/localebuilder.cpp: In member function 'icu_60::LocaleBuilder& icu_60::LocaleBuilder::addUnicodeLocaleAttribute(icu_60::StringPiece)':
external/icu/icu4c/source/common/localebuilder.cpp:290:69: error: no matching function for call to 'icu_60::Locale::getKeywordValue(const char*&, icu_60::CharStringByteSink&, UErrorCode&)'
     extensions_->getKeywordValue(kAttributeKey, sink, localErrorCode);
                                                                     ^
In file included from external/icu/icu4c/source/common/unicode/localebuilder.h:6,
                 from external/icu/icu4c/source/common/localebuilder.cpp:10:
/usr/include/unicode/locid.h:457:13: note: candidate: 'int32_t icu_60::Locale::getKeywordValue(const char*, char*, int32_t, UErrorCode&) const'
     int32_t getKeywordValue(const char* keywordName, char *buffer, int32_t bufferCapacity, UErrorCode &status) const;
             ^~~~~~~~~~~~~~~
/usr/include/unicode/locid.h:457:13: note:   candidate expects 4 arguments, 3 provided
external/icu/icu4c/source/common/localebuilder.cpp: In member function 'icu_60::LocaleBuilder& icu_60::LocaleBuilder::removeUnicodeLocaleAttribute(icu_60::StringPiece)':
external/icu/icu4c/source/common/localebuilder.cpp:344:69: error: no matching function for call to 'icu_60::Locale::getKeywordValue(const char*&, icu_60::CharStringByteSink&, UErrorCode&)'
     extensions_->getKeywordValue(kAttributeKey, sink, localErrorCode);
                                                                     ^
In file included from external/icu/icu4c/source/common/unicode/localebuilder.h:6,
                 from external/icu/icu4c/source/common/localebuilder.cpp:10:
/usr/include/unicode/locid.h:457:13: note: candidate: 'int32_t icu_60::Locale::getKeywordValue(const char*, char*, int32_t, UErrorCode&) const'
     int32_t getKeywordValue(const char* keywordName, char *buffer, int32_t bufferCapacity, UErrorCode &status) const;
             ^~~~~~~~~~~~~~~
/usr/include/unicode/locid.h:457:13: note:   candidate expects 4 arguments, 3 provided
Target //tensorflow/lite:libtensorflowlite.so failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 11557.297s, Critical Path: 288.22s
INFO: 5169 processes: 1657 internal, 3512 local.
FAILED: Build did NOT complete successfully
@OAHLSTM OAHLSTM added the type:bug Bug label Feb 24, 2022
@mohantym mohantym added comp:lite TF Lite related issues type:build/install Build and install issues TF 2.7 Issues related to TF 2.7.0 subtype:bazel Bazel related Build_Installation issues and removed type:bug Bug labels Feb 24, 2022
@mohantym mohantym assigned gadagashwini and unassigned mohantym Feb 24, 2022
@jvishnuvardhan jvishnuvardhan added the stat:awaiting tensorflower Status - Awaiting response from tensorflower label Feb 25, 2022
@OAHLSTM
Copy link
Author

OAHLSTM commented Feb 28, 2022

Hello @teijeong
Have you been able to take a look at this ?

@OAHLSTM
Copy link
Author

OAHLSTM commented Mar 16, 2022

Hello @teijeong @jvishnuvardhan @mohantym,
Has anyone took a look at this issue ? is it about some missing arguments ?
Thank you for your cooperation.
Othmane,

@terryheo
Copy link
Member

I've verified the issue. Will take a look.

@mohantym mohantym self-assigned this May 11, 2022
@mohantym
Copy link
Contributor

Hi @ahlzouao ! This issue is not replicating in 2.9 with Bazel 5.0.0 and Ubuntu 18 .Attaching gist for reference. Thank you!

@mohantym mohantym added stat:awaiting response Status - Awaiting response from author and removed stat:awaiting tensorflower Status - Awaiting response from tensorflower labels May 11, 2022
@OAHLSTM OAHLSTM closed this as completed May 11, 2022
@google-ml-butler
Copy link

Are you satisfied with the resolution of your issue?
Yes
No

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp:lite TF Lite related issues stat:awaiting response Status - Awaiting response from author subtype:bazel Bazel related Build_Installation issues TF 2.7 Issues related to TF 2.7.0 type:build/install Build and install issues
Projects
None yet
Development

No branches or pull requests

6 participants