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

text2image needs pango_training.so which in turn is not installed #4232

Closed
leleliu008 opened this issue May 1, 2024 · 7 comments
Closed

Comments

@leleliu008
Copy link
Contributor

Current Behavior

text2image needs pango_training.so which in turn is not installed

Expected Behavior

pango_training.so installed.

Suggested Fix

https://github.com/tesseract-ocr/tesseract/blob/main/src/training/CMakeLists.txt#L405-L412

TARGETS text2image

change to:

TARGETS text2image pango_training

tesseract -v

No response

Operating System

Ubuntu 22.04 Jammy

Other Operating System

Android

uname -a

Linux leleliu008 6.5.0-28-generic #29-Ubuntu SMP PREEMPT_DYNAMIC Thu Mar 28 23:46:48 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux

Compiler

Android NDK r26d (clang version 17.0.2)

CPU

aarch64

Virtualization / Containers

No response

Other Information

source: https://github.com/tesseract-ocr/tesseract/archive/refs/tags/5.3.4.tar.gz

@stweil
Copy link
Contributor

stweil commented May 1, 2024

Did you build text2image yourself (if yes: how)? And how did you install it?

@leleliu008
Copy link
Contributor Author

@stweil

Yes, I build it for Android.

I din't give you the reproduce steps, because it is very clear if you look at the source code https://github.com/tesseract-ocr/tesseract/blob/main/src/training/CMakeLists.txt#L405-L412

My build instuctions:

cmake \
        -Wno-dev \
        -DBUILD_TESTING=OFF \
        -DCMAKE_INSTALL_LIBDIR='/github/home/.ndk-pkg/installed/android-21-arm64-v8a/e485a3cff7749b1b6d89b185304b1ff469c336fb646f1b164b65578e9bad7ccd/lib' \
        -DCMAKE_INSTALL_PREFIX='/github/home/.ndk-pkg/installed/android-21-arm64-v8a/e485a3cff7749b1b6d89b185304b1ff469c336fb646f1b164b65578e9bad7ccd' \
        -DCMAKE_TOOLCHAIN_FILE='/github/home/.ndk-pkg/run/750/android-21-arm64-v8a/tesseract/android.toolchain.cmake' \
        -DCMAKE_VERBOSE_MAKEFILE='ON' \
        -DCMAKE_COLOR_MAKEFILE='ON' \
        -S /github/home/.ndk-pkg/run/750/android-21-arm64-v8a/tesseract/src \
        -B /github/home/.ndk-pkg/run/750/android-21-arm64-v8a/tesseract/src/_ \
        -DENABLE_LTO=OFF \
        -DUSE_SYSTEM_ICU=ON \
        -DDISABLE_ARCHIVE=OFF \
        -DDISABLE_CURL=OFF \
        -DBUILD_TESTS=OFF \
        -DBUILD_TRAINING_TOOLS=ON \
        -DOPENMP_BUILD=ON \
        -DLEPT_TIFF_RESULT=0

libtesseract-dependencies

@stweil
Copy link
Contributor

stweil commented May 1, 2024

I am curious:

Are there useful applications for training on Android?
And how did you create that nice dependency diagram?

@leleliu008
Copy link
Contributor Author

Are there useful applications for training on Android?

I found this when I built it for Android, I think this problem is nothing to do with specific platform.

And how did you create that nice dependency diagram?

I create it in dot https://graphviz.org/doc/info/command.html

@zdenop
Copy link
Contributor

zdenop commented May 1, 2024

I found this when I built it for Android, I think this problem has nothing to do with a specific platform.

Why do you try to build training tools if you are not able/want to use them on your platform? Just to get extra issues?

I din't give you the reproduce steps, because it is very clear if you look at the source code https://github.com/tesseract-ocr/tesseract/blob/main/src/training/CMakeLists.txt#L405-L412

I see no reason why to install pango_training:

$ ldd build/bin/text2image | grep -i pango
        libpangocairo-1.0.so.0 => /lib/arm-linux-gnueabihf/libpangocairo-1.0.so.0 (0xb6660000)
        libpango-1.0.so.0 => /lib/arm-linux-gnueabihf/libpango-1.0.so.0 (0xb65f0000)
        libpangoft2-1.0.so.0 => /lib/arm-linux-gnueabihf/libpangoft2-1.0.so.0 (0xb3980000)

The reason is very simple - the official build process for training tools uses static linking.

@leleliu008
Copy link
Contributor Author

If you want to static linking, you should change add_library(pango_training ${pango_training_src}) to add_library(pango_training STATIC ${pango_training_src})

@leleliu008
Copy link
Contributor Author

It a feature not a bug, so I'm closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants