tesseract-ocr / tesseract

Tesseract Open Source OCR Engine (main repository)

Home Page:https://tesseract-ocr.github.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Failed dependency : liblept.so.5()

priyankasabharwal81 opened this issue · comments

Current Behavior

I am build a leptonica RPM. (Spec file) Using their latest version 1.83.1 from https://github.com/DanBloomberg/leptonica
Now I am building tesseract (version 5.3.3) rpm the similar way and adding leptonica as "BuildRequires" in tesseract spc file. The rpm is build successfully. But when I try to install tesseract rpm I get this error:

Failed dependency :liblept.so.5()(64bit)

There is no such file that leptonica creates, rather i can see libleptonica.so.6.

Is these version of leptonica/tesseract not compatible wih each other?

Expected Behavior

No response

Suggested Fix

No response

tesseract -v

No response

Operating System

RHEL 9

Other Operating System

No response

uname -a

No response

Compiler

No response

CPU

No response

Virtualization / Containers

No response

Other Information

No response

It is compatible. Please check why the wrong Leptonica library is requested and try to fix your build environment.

This is not Tesseract issue (as we do not produce binary packages).
This is more about the packager who should know how to correctly handle dependencies and manage the linking process.

@zdenop @stweil
Thanks for the comment. Let me re-frame my question.
How should I build tesseract, if leptonica is installed at a different location and not in folder /usr/lib64 ?
I have set these variables, but still I am getting error.

LIBLEPT_HEADERSDIR=/opt/mylocation/platform/include
LDFLAGS=/opt/mylocation/platform/lib/
CFLAGS=/opt/mylocation/platform/include/leptonica
LEPTONICA_CFLAGS=/opt/mylocation/platform/include/leptonica
LEPTONICA_LIBS=/opt/mylocation/platform/lib/

Error

/opt/rh/gcc-toolset-12/root/usr/libexec/gcc/x86_64-redhat-linux/12/ld: ./.libs/libtesseract.so: undefined reference to findFileFormatBuffer' /opt/rh/gcc-toolset-12/root/usr/libexec/gcc/x86_64-redhat-linux/12/ld: ./.libs/libtesseract.so: undefined reference to pixGetColormap'
/opt/rh/gcc-toolset-12/root/usr/libexec/gcc/x86_64-redhat-linux/12/ld: ./.libs/libtesseract.so: undefined reference to pixCreateTemplate' /opt/rh/gcc-toolset-12/root/usr/libexec/gcc/x86_64-redhat-linux/12/ld: ./.libs/libtesseract.so: undefined reference to pixRenderBoxArb'
/opt/rh/gcc-toolset-12/root/usr/libexec/gcc/x86_64-redhat-linux/12/ld: ./.libs/libtesseract.so: undefined reference to pixSeedfillBinary' /opt/rh/gcc-toolset-12/root/usr/libexec/gcc/x86_64-redhat-linux/12/ld: ./.libs/libtesseract.so: undefined reference to pixSauvolaBinarizeTiled'
/opt/rh/gcc-toolset-12/root/usr/libexec/gcc/x86_64-redhat-linux/12/ld: ./.libs/libtesseract.so: undefined reference to pixaGetBox' /opt/rh/gcc-toolset-12/root/usr/libexec/gcc/x86_64-redhat-linux/12/ld: ./.libs/libtesseract.so: undefined reference to pixaCreate'
/opt/rh/gcc-toolset-12/root/usr/libexec/gcc/x86_64-redhat-linux/12/ld: ./.libs/libtesseract.so: undefined reference to pixGetYRes' /opt/rh/gcc-toolset-12/root/usr/libexec/gcc/x86_64-redhat-linux/12/ld: ./.libs/libtesseract.so: undefined reference to pixGetDepth'
/opt/rh/gcc-toolset-12/root/usr/libexec/gcc/x86_64-redhat-linux/12/ld: ./.libs/libtesseract.so: undefined reference to `zlibCompress'

tesseract use standard build tools (autotools and cmake). Please read their manuals how to include nonstandard installation location to your build.