Configure error(configure: error: Leptonica 1.74 or higher is required. Try to install libleptonica-dev package.) in Amazon Linux

1,064 views
Skip to first unread message

khana...@vitalify.jp

unread,
Jan 3, 2019, 9:38:48 AM1/3/19
to tesseract-ocr
During configure, error occurs.

checking for LEPTONICA... no 

configure: error: Leptonica 1.74 or higher is required. Try to install libleptonica-dev package.

But, I have installed leptonica-1.77.0.
 
・Environment
  • Tesseract Version: master 4.0.0 (2019-01-03)
  • Commit Number: 3377ed2
  • Platform: Amazon Linux AMI release 2018.03

・Issue command

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
export LIBLEPT_HEADERSDIR=/usr/local/include/leptonica
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/

./configure --with-extra-libraries=/usr/local/lib


Please enlighten me on the specifics. 

Zdenko Podobny

unread,
Jan 3, 2019, 10:03:20 AM1/3/19
to tesser...@googlegroups.com


št 3. 1. 2019 o 15:38 <khana...@vitalify.jp> napísal(a):
During configure, error occurs.

checking for LEPTONICA... no 

configure: error: Leptonica 1.74 or higher is required. Try to install libleptonica-dev package.

But, I have installed leptonica-1.77.0.

What does it mean? 

 
・Environment
  • Tesseract Version: master 4.0.0 (2019-01-03)
  • Commit Number: 3377ed2
  • Platform: Amazon Linux AMI release 2018.03

・Issue command

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
export LIBLEPT_HEADERSDIR=/usr/local/include/leptonica
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/

./configure --with-extra-libraries=/usr/local/lib


/usr/local is standard lib path, so IMO there is not need to add it to configure (but maybe this is not true on each distribution ;-) ).

Anyway leptonica presence is detected by pkg-config.Check config.log why it failed to find leptonica. Do you have more leptonica installations (e.g /usr and /usr/local)?
 
Please enlighten me on the specifics. 

--
You received this message because you are subscribed to the Google Groups "tesseract-ocr" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tesseract-oc...@googlegroups.com.
To post to this group, send email to tesser...@googlegroups.com.
Visit this group at https://groups.google.com/group/tesseract-ocr.
To view this discussion on the web visit https://groups.google.com/d/msgid/tesseract-ocr/e573388c-5475-4cc4-8853-198258305243%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

khana...@vitalify.jp

unread,
Jan 3, 2019, 8:45:31 PM1/3/19
to tesseract-ocr
Thanks for the reply.

I explain how to install Tesserac to you.

At first, I installed leptonica-1.77.0.
```
[ec2-user@xxx ~]$ 
[ec2-user@xxx leptonica-1.77.0]$ cd leptonica-1.77.0/
[ec2-user@xxx leptonica-1.77.0]$ sudo ./autogen.sh 
[ec2-user@xxx leptonica-1.77.0]$ sudo ./configure
[ec2-user@xxx leptonica-1.77.0]$ sudo make
[ec2-user@xxx leptonica-1.77.0]$ sudo make install
```

Second, I tyried installing tesseract
But, configure error occurs at "sudo ./configure 
```

[ec2-user@xxx ~]$ cd lib/tesseract/

[ec2-user@xxx tesseract]$ sudo ./configure

checking for g++... g++

checking whether the C++ compiler works... yes

checking for C++ compiler default output file name... a.out

checking pkg-config is at least version 0.9.0... yes

checking for LEPTONICA... no

configure: error: Leptonica 1.74 or higher is required. Try to install libleptonica-dev package.

```

Installing  leptonica-1.77.0 was successful.
But, "configure: error" occurs...


2019年1月3日木曜日 23時38分48秒 UTC+9 khana...@vitalify.jp:

Zdenko Podobny

unread,
Jan 4, 2019, 2:36:16 AM1/4/19
to tesser...@googlegroups.com
As I wrote:
check config.log why pkg-config failed to find leptonica (or port somewhere config.log)

Zdenko


pi 4. 1. 2019 o 2:45 <khana...@vitalify.jp> napísal(a):
--
You received this message because you are subscribed to the Google Groups "tesseract-ocr" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tesseract-oc...@googlegroups.com.
To post to this group, send email to tesser...@googlegroups.com.
Visit this group at https://groups.google.com/group/tesseract-ocr.

khana...@vitalify.jp

unread,
Jan 4, 2019, 4:51:26 AM1/4/19
to tesseract-ocr
I solved ,thanks to you.
I checked  /home/ec2-user/lib/tesseract/config.log
In this file, PKG_CONFIG_PATH=''

When I issued sudo ./configure, OS can't keep environment variable of ec2-user.
Thus,  PKG_CONFIG_PATH=''.

So,
I issued sudo su
and,
export PKG_CONFIG_PATH='/usr/local/lib/pkgconfig'
./configure
make
make install
sudo ldconfig

Installing  tesseract 4.0.0-133-g3377was successful.

Thanks!!

2019年1月3日木曜日 23時38分48秒 UTC+9 khana...@vitalify.jp:
Reply all
Reply to author
Forward
0 new messages