question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[package] Tesseract/5.0.0: GCC Requirement too restrictive

See original GitHub issue

I am working to compile the tesseract library into binaries for deployment on various Linux distros (with Ubuntu 18.04+ as my primary target right now).

The tesseract package (versions >=5.0.0) uses too restrictive of a GCC version (9+) to support C++17, when GCC 7 supports the C++17 standard (see references below). I have tried many different combinations of docker images/compilers and cannot produce a binary that “just works” on Ubuntu 18.04 due to GLIBC/CXX issues.

For reference:

I’ve tried a combination of different solutions to target Ubuntu 18.04 (with glibc 2.27):

  • Conanio/gcc9 - glibc (2.30)
  • Conanio/gcc8 - glibc (2.27) - fails to meet tesseract conanfile min gcc >=9 criteria, likely would work to meet needs
  • Conanio/gcc7 - glibc (2.26) - fails to meet tesseract conanfile min gcc >= 9 criteria, likely would work to meed needs
  • Conanio/clang7 - glibc (2.28), glibc too new and won’t be compatible with target glibc
  • Using various centos images with upgrading the gcc to version 9.0 (GLIBC compatibility issues gone, but GLIBCXX compatibility issues)

Package and Environment Details (include every applicable attribute)

  • Package Name/Version: tesseract/5.0.0
  • Operating System+version: Linux Ubuntu 18.04
  • Compiler+version: GCC 9
  • Docker image: conanio/gcc9
  • Conan version: conan 1.18.0
  • Python version: Python 3.7.4

Conan profile (output of conan profile show default or conan profile show <profile> if custom profile is in use)

Not using a custom profile

Steps to reproduce (Include if Applicable)

  1. Use docker to build lightweight project that uses tesseract in conanio/gcc9, builds against GLIBC 2.30
  2. docker cp the binaries to an ubuntu:18.04 image, uses GLIBC
  3. Run ldd /path/to/binary to confirm GLIBC/GLIBCXX compatiblity issues

Logs (Include/Attach if Applicable)

ldd result on Ubuntu 18.04 for binary built with conanio/gcc9
# ldd libocr.so
./libocr.so: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.29' not found (required by ./libocr.so)
./libocr.so: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.26' not found (required by ./libocr.so)
	linux-vdso.so.1 (0x00007fffb9d83000)
	libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f8c536f6000)
	libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f8c5336d000)
	libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f8c5314e000)
	libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f8c52db0000)
	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f8c529bf000)
	/lib64/ld-linux-x86-64.so.2 (0x00007f8c54de5000)
	libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f8c527a7000)

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
brandonmkunkelcommented, Mar 9, 2022
0reactions
brandonmkunkelcommented, Mar 9, 2022

Found Github Issue from the tesseract source repository talking about compiler constraints. Seems the maintainers accept gcc 7 as the minimal version for their build processes. Now I just need to confirm on my PR (work in progress) that this gcc version is compatible with the conan package’s dependencies with local testing.

https://github.com/tesseract-ocr/tesseract/issues/3210#issuecomment-774599019

Read more comments on GitHub >

github_iconTop Results From Across the Web

RFC: Supported Compilers, C++17 · Issue #3210 - GitHub
1810, today's tip of Tesseract master fails to compile with the latest gcc package, 4.8.5-44.el7 . The very long C++ error message begins...
Read more >
Can't install Tesseract-OCR on Mac - Stack Overflow
You need to install the tesseract itself. As it says in documentation https://github.com/tesseract-ocr/tesseract/wiki#homebrew
Read more >
Compilation guide for various platforms | tessdoc - GitHub Pages
Tesseract versions and the minimum version of Leptonica required: ... the Leptonica version may be too old, so you will need to build...
Read more >
Improving OCR Post Processing with Machine Learning Tools
Optical Character Recognition (OCR) Post Processing involves data cleaning steps for documents that were digitized, such as a book or a ...
Read more >
Package List — Spack 0.20.0.dev0 documentation
It is automatically generated based on the packages in this Spack version. ... and thus it can be used with LLVM/Clang, Intel OpenMP...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found