Installing on Ubuntu 14.04, tesseract not found.

2,527 views
Skip to first unread message

cmmash

unread,
Sep 17, 2014, 3:22:28 AM9/17/14
to open...@googlegroups.com
I already have Tesseract installed.
I get the version of tesseract and leptonica if I do:
tesseract -v

But on running the cmake command,
sudo cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr ..

 I get this:


Tesseract_INCLUDE_BASEAPI_DIR=Tesseract_INCLUDE_BASEAPI_DIR-NOTFOUND
Tesseract_INCLUDE_CCSTRUCT_DIR=Tesseract_INCLUDE_CCSTRUCT_DIR-NOTFOUND
Tesseract_INCLUDE_CCMAIN_DIR=Tesseract_INCLUDE_CCMAIN_DIR-NOTFOUND
Tesseract_INCLUDE_CCUTIL_DIR=Tesseract_INCLUDE_CCUTIL_DIR-NOTFOUND
Tesseract_INCLUDE_DIRS=
Tesseract_LIB=Tesseract_LIB-NOTFOUND
Leptonica_LIB=Leptonica_LIB-NOTFOUND
Tesseract_LIBRARIES=
CMake Error at cmake_modules/LibFindMacros.cmake:74 (message):
 
Required library Tesseract NOT FOUND.


 
Install the library (dev version) and try again.  If the library is already
  installed
, use ccmake to set the missing variables manually.
Call Stack (most recent call first):
  cmake_modules
/FindTesseract.cmake:80 (libfind_process)
 
CMakeLists.txt:19 (FIND_PACKAGE)

 I'm not really well versed with the workings of CMake, so, if anyone could help me go in the right direction to get my fix and build OpenALPR for my machine, that would be great.


cmmash

unread,
Sep 17, 2014, 3:27:34 AM9/17/14
to open...@googlegroups.com
EDIT: More info.

Also, when I do
whereis tesseract

, I get these locations:

tesseract: /usr/bin/tesseract /usr/bin/X11/tesseract /usr/share/man/man1/tesseract.1.gz

Matt

unread,
Sep 17, 2014, 8:59:38 AM9/17/14
to open...@googlegroups.com
You need the Tesseract libraries (libtesseract.so) and the headers (tesseract/baseapi.h).  Just having the binary doesn't necessarily mean that you'll also have the libraries and the headers.  These are usually separate packages (e.g., On Ubuntu: apt-get install tesseract versus apt-get install tesseract-dev).  OpenALPR needs to link against the libs.

-Matt

Joaquín

unread,
Sep 17, 2014, 9:14:22 AM9/17/14
to open...@googlegroups.com
Hi all, i get the same error when try to compile the last version and with libtesseract-dev installed
I think that is an error in the find_tesseract.cmake file

Maybe it's a typo in Tesseract_LIBRARIES and Tesseract_LIBS?

I can compile if set the tesseract dirs with the ones that are in the old cMakeLists

Anyway I'm not an expert on cmake, sorry if I'm wrong.

Matt

unread,
Sep 17, 2014, 9:18:40 AM9/17/14
to open...@googlegroups.com
You could be right.  The Tesseract script tries to find the libraries in a number of locations.  It's possible that it's installed somewhere that's not being checked.  That's surprising that the tesseract-dev package would put it somewhere other than /usr/lib/

Can you send the output for the following commands:

find / -name "baseapi.h" 2>/dev/null
find / -name "*tesseract*.so" 2>/dev/null
find / -name "*tesseract*.a" 2>/dev/null
find / -name "*lept*.so" 2>/dev/null
find / -name "publictypes.h" 2>/dev/null

-Matt

Joaquín

unread,
Sep 17, 2014, 9:25:10 AM9/17/14
to open...@googlegroups.com
This is the output i get:

pat@pat-server:~$ find / -name "baseapi.h" 2>/dev/null
/usr/include/tesseract/baseapi.h
pat@pat-server:~$ find / -name "*tesseract*.so" 2>/dev/null
/usr/lib/libtesseract.so
pat@pat-server:~$ find / -name "*tesseract*.a" 2>/dev/null
/usr/lib/libtesseract.a
pat@pat-server:~$ find / -name "*lept*.so" 2>/dev/null
pat@pat-server:~$ find / -name "publictypes.h" 2>/dev/null
/usr/include/tesseract/publictypes.h

Can't find leptonica?

Matt

unread,
Sep 17, 2014, 9:34:20 AM9/17/14
to open...@googlegroups.com
Try running this command: sudo apt-get install libleptonica-dev

And then cmake again.  

-Matt

Joaquín

unread,
Sep 17, 2014, 9:57:40 AM9/17/14
to open...@googlegroups.com
Hi Matt, after installing the libleptonica-dev it compiles without errors.

Maybe you can add the libleptonica-dev to the packages lists for the easy way to compile in ubuntu.

Thanks, Joaquín.
Reply all
Reply to author
Forward
0 new messages