[go: nahoru, domu]

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

Linking with TFLite v2.5.0 fails due to undefined reference to rdft2d #50529

Open
psyhtest opened this issue Jun 30, 2021 · 0 comments
Open

Linking with TFLite v2.5.0 fails due to undefined reference to rdft2d #50529

psyhtest opened this issue Jun 30, 2021 · 0 comments
Assignees
Labels
subtype: ubuntu/linux Ubuntu/Linux Build/Installation Issues TF 2.5 Issues related to TF 2.5 type:build/install Build and install issues

Comments

@psyhtest
Copy link

Please make sure that this is a build/installation issue. As per our GitHub Policy, we only address code/doc bugs, performance issues, feature requests and build/installation issues on GitHub. tag:build_template

System information

  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): NVIDIA Xavier Jetson AGX, JetPack 4.5.1 (Ubuntu 18.04.5)
  • Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device: N/A
  • TensorFlow installed from (source or binary): TFLite installed from source
  • TensorFlow version: v2.5.0
  • Python version: v3.6.9
  • CMake version: v1.19.5
  • Installed using virtualenv? pip? conda?: no
  • Bazel version (if compiling from source): N/A
  • GCC/Compiler version (if compiling from source): 7.5.0
  • CUDA/cuDNN version: N/A
  • GPU model and memory: N/A

Describe the problem

Installing TensorFlow Lite via Collective Knowledge (which uses CMake), as described in this Jupyter notebook, with a new patch to support v2.5.0, would go fine but then fail with a linking error with rdft2d.

Provide the exact sequence of commands / steps that you executed before running into the problem

$ ck install package --tags=lib,tflite,via-cmake,with.ruy,v2.5.0
$ ck compile program:image-classification-tflite --dep_add_tags.library=tflite,v2.5.0
...
/home/katya/CK-TOOLS/lib-tflite-src-static-gcc-7.5.0-v2.5.0-with.ruy-linux-64/lib/libtensorflow-lite.a(rfft2d.cc.o): In function `tflite::ops::builtin::rfft2d::Rfft2dImpl(int, int, double**, int*, double*)':
rfft2d.cc:(.text+0x978): undefined reference to `rdft2d'
collect2: error: ld returned 1 exit status

Any other info / logs
What's weird is that despite the apparent intent to "export" fftsg2d which contains rdft2d, only fftsg.c.o would be linked against libtensorflow-lite.a. As a not completely logical workaround, I've managed just about to get it working with the following patch:

diff --git a/tensorflow/lite/tools/cmake/modules/fft2d/CMakeLists.txt b/tensorflow/lite/tools/cmake/modules/fft2d/CMakeLists.txt
index e7a5ed9b443..04c5b7c05db 100644
--- a/tensorflow/lite/tools/cmake/modules/fft2d/CMakeLists.txt
+++ b/tensorflow/lite/tools/cmake/modules/fft2d/CMakeLists.txt
@@ -37,7 +37,7 @@ target_include_directories(fft2d_alloc PUBLIC "${FFT2D_SOURCE_DIR}")
 add_library(fft2d_fft4f2d "${FFT2D_SOURCE_DIR}/fft4f2d.c")
 target_include_directories(fft2d_fft4f2d PRIVATE "${FFT2D_SOURCE_DIR}")

-add_library(fft2d_fftsg "${FFT2D_SOURCE_DIR}/fftsg.c")
+add_library(fft2d_fftsg "${FFT2D_SOURCE_DIR}/fftsg.c" "${FFT2D_SOURCE_DIR}/fftsg2d.c")

 # Requires implementation of fft2d_alloc.
 add_library(fft2d_fftsg2d "${FFT2D_SOURCE_DIR}/fftsg2d.c")
@psyhtest psyhtest added the type:build/install Build and install issues label Jun 30, 2021
@saikumarchalla saikumarchalla added the TF 2.5 Issues related to TF 2.5 label Jul 1, 2021
@saikumarchalla saikumarchalla removed their assignment Jul 1, 2021
@saikumarchalla saikumarchalla added the subtype: ubuntu/linux Ubuntu/Linux Build/Installation Issues label Jul 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
subtype: ubuntu/linux Ubuntu/Linux Build/Installation Issues TF 2.5 Issues related to TF 2.5 type:build/install Build and install issues
Projects
None yet
Development

No branches or pull requests

3 participants