ladidaaa
Posts: 11
Joined: Tue Jan 22, 2013 8:11 am

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

Mon Mar 18, 2013 10:07 am

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!
Last edited by ladidaaa on Tue Mar 19, 2013 9:05 am, edited 1 time in total.

User avatar
topguy
Posts: 6143
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: "illegal instruction" when trying to use tesseract

Mon Mar 18, 2013 10:18 am

How have you installed tesseract ?

ladidaaa
Posts: 11
Joined: Tue Jan 22, 2013 8:11 am

Re: "illegal instruction" when trying to use tesseract

Mon Mar 18, 2013 11:28 am

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

amacater
Posts: 9
Joined: Sun Apr 15, 2012 7:29 pm

Re: "illegal instruction" when trying to use tesseract

Mon Mar 18, 2013 11:50 am

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.

Spid
Posts: 525
Joined: Sat Jan 19, 2013 12:47 pm

Re: "illegal instruction" when trying to use tesseract

Mon Mar 18, 2013 6:11 pm

liblept3 version 1.69-3.1 is in the Raspbian "wheezy" repository, therefore you should of not installed the ARM v7 Debian version....
I will always assume you are running Raspbian for desktop and Raspbmc for XMBC !

ladidaaa
Posts: 11
Joined: Tue Jan 22, 2013 8:11 am

Re: "illegal instruction" when trying to use tesseract

Tue Mar 19, 2013 9:04 am

@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!

Return to “Advanced users”