Page 1 of 1

(SOLVED) "illegal instruction" when trying to use tesseract

Posted: Mon Mar 18, 2013 10:07 am
by ladidaaa
Hi,
I would like to create searchable PDF documents from scanned TIF files from the scanner attached to my RPI.

The Problem i am facing is that when i try to use tesseract-ocr it states:
illegal instrucion
Can somebody give me a hint what could be the problem?
Thanks a lot in advance!

Re: "illegal instruction" when trying to use tesseract

Posted: Mon Mar 18, 2013 10:18 am
by topguy
How have you installed tesseract ?

Re: "illegal instruction" when trying to use tesseract

Posted: Mon Mar 18, 2013 11:28 am
by ladidaaa
Hi,
Yes i have installed it with "sudo apt-get install tesseract-ocr"
I also manually added the liblept3 for armhf before installing tesseract with:

Code: Select all

wget http://ftp.de.debian.org/debian/pool/main/l/leptonlib/liblept3_1.69-3.1_armhf.deb
sudo dpkg -i liblept3_1.69-3.1_armhf.deb

Re: "illegal instruction" when trying to use tesseract

Posted: Mon Mar 18, 2013 11:50 am
by amacater
Remember: the Raspberry Pi and Raspbian are built for ARM v6 instructions with hard floating point - Debian and all other distributions are built for ARM v7 hard floating point(or some such).

If the Raspbian folk haven't built it - for whatever reason - then grabbing it straight form the Debian repositories may or may not work.

Tesseract probably uses floating point intensively so you hit this. You can try grabbing the source from Debian and the Debian build instructions and building it on a Raspberry Pi with a native toolchain. I have a similar problem with GNURadio, with the added complication that upstream changes very rapidly.

Alternatively, you could take the hit and use the soft floating point variant for Raspberry Pi - the "other download" for Debian Wheezy, update the whole thing and you will be compatible with Debian soft float packages (armel).

One of the downsides of the Raspberry Pi not being fully architecturally compatible with the mainstream hard floating point code and Peter Green and the Raspbian folks having to build all the packages again each time.

Re: "illegal instruction" when trying to use tesseract

Posted: Mon Mar 18, 2013 6:11 pm
by Spid
liblept3 version 1.69-3.1 is in the Raspbian "wheezy" repository, therefore you should of not installed the ARM v7 Debian version....

Re: "illegal instruction" when trying to use tesseract

Posted: Tue Mar 19, 2013 9:04 am
by ladidaaa
@all:
Thanks for your quick replies and useful tips!
@spid:
Your hint was the right one!
I installed liblept3 manually a few months ago, because i blindly followed a tutorial to install pyload which told me to do so.

I managed to reinstall liblebt3 with:

Code: Select all

sudo apt-get install liblebt3 --reinstall
which gave me a segmentation fault when i opened tesseract.
I removed tesseract and reinstalled it again and after a:

Code: Select all

export TESSDATA_PREFIX=/usr/share/tesseract-ocr
it works fine!

Thanks for all your help!