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

Configure fails to get leptonica include dir #61

Closed
Enchufa2 opened this issue Sep 23, 2022 · 8 comments
Closed

Configure fails to get leptonica include dir #61

Enchufa2 opened this issue Sep 23, 2022 · 8 comments

Comments

@Enchufa2
Copy link

Tesseract 5.2 (in Fedora 37+) no longer requires leptonica in its .pc file. As a result, installation fails because the configure script does not get its include dir. Example:

** using staged installation
Found pkg-config cflags and libs!
Using PKG_CFLAGS=
Using PKG_LIBS=-L/usr/lib -ltesseract 
Using CXX11CPP: g++ -m64 -E -std=gnu++11
--------------------------- [ANTICONF] --------------------------------
Configuration failed to find 'tesseract' system library. Try installing:
 * deb: libtesseract-dev libleptonica-dev (Debian, Ubuntu, etc)
 * rpm: tesseract-devel leptonica-devel (Fedora, CentOS, RHEL)
 * brew: tesseract (Mac OSX)
If tesseract is already installed, check that 'pkg-config' is in your
PATH and PKG_CONFIG_PATH contains a tesseract.pc file. If pkg-config
is unavailable you can set INCLUDE_DIR and LIB_DIR manually via:
R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...'
-------------------------- [ERROR MESSAGE] ---------------------------
tools/test.cpp:2:10: fatal error: allheaders.h: No such file or directory
    2 | #include <allheaders.h>
      |          ^~~~~~~~~~~~~~
compilation terminated.
--------------------------------------------------------------------
ERROR: configuration failed for package 'tesseract'

An additional to pkg-config --cflags --silence-errors lept would be required.

@jeroen
Copy link
Member

jeroen commented Sep 23, 2022

Are you sure this not a bug in Fedora's tesseract package? On homebrew the leptonica.pc file still has this:

prefix=/usr/local/Cellar/tesseract/5.2.0
exec_prefix=${prefix}
bindir=${exec_prefix}/bin
datarootdir = /usr/local/share
datadir=${datarootdir}
libdir=${exec_prefix}/lib
includedir=${prefix}/include

Name: tesseract
Description: An OCR Engine that was developed at HP Labs between 1985 and 1995... and now at Google.
URL: https://github.com/tesseract-ocr/tesseract
Version: 5.2.0
Requires.private: lept
Libs: -L${libdir} -ltesseract -L/usr/local/Cellar/libarchive/3.6.1/lib -larchive -lcurl
Libs.private: -lpthread
Cflags: -I${includedir}

@Enchufa2
Copy link
Author

@manisandro I see in the changelog that you did the update. Any idea?

@jeroen
Copy link
Member

jeroen commented Sep 23, 2022

@Enchufa2
Copy link
Author

That's not the one that is used in cmake-based installations. This one is: https://github.com/tesseract-ocr/tesseract/blob/main/tesseract.pc.cmake

@jeroen
Copy link
Member

jeroen commented Sep 23, 2022

Ah did you switch the rpm to cmake? That looks like a bug upstream...

Let's see what they say: tesseract-ocr/tesseract#3930

@Enchufa2
Copy link
Author

It seems so. Here: https://src.fedoraproject.org/rpms/tesseract/c/622725d18425696cdca5447558fd9e3ca892f858?branch=rawhide

@jeroen Thanks for the quick patch.

@manisandro Do you think we could add this downstream until upstream fixes this?

@jeroen
Copy link
Member

jeroen commented Sep 23, 2022

Upstream has merged it already. Maybe you can cherry-pick this for the rpm: tesseract-ocr/tesseract@aee19fcf8eb832

@manisandro
Copy link

Done for tesseract-5.2.0-5.fc37 and tesseract-5.2.0-5.fc38.

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