Page 1 of 1

leptonica libs - building with tiff support

Posted: Wed 20 Jan 2010, 17:49
by Dingo
Dear puppians (I think this forum is proper for this question, but, if not, feel free to move to more proper location)

Few days ago I started compiling

*Jbig2enc*
- http://github.com/agl/jbig2enc
- http://en.wikipedia.org/wiki/JBIG2

requiring *leptonica libs*

I downloaded Jbig2enc 0.27 source code
http://github.com/agl/jbig2enc/tarball/0.27

needing
*leptonica libs 1.58*
- http://leptonica.googlecode.com/files/l ... .58.tar.gz

In order to build leptonica, We needs also three deps

libpng12-dev, libjpeg62-dev, libtiff4-dev

I downloaded and installed

started leptonica compiling, but config log shows a warning about tiff support

configure: WARNING: TIFF support is disabled

but libtiff exists in /usr/lib, so I started ./configure with this switch:

./configure --with-libtiff=/usr/lib

but, again:

checking for Leffler libtiff library... checking linking with /usr/lib/libtiff/lib/libtiff.a... no
configure: WARNING: TIFF support is disabled


I can build anyway leptonica libs (and then Jbi2enc), but without tiff support. Have anyone any idea to solve this problem? excuse me for annoying with my compilation tales 8)

Posted: Thu 21 Jan 2010, 22:03
by dsb
I assume you're doing ./configure, etc.

When you run .configure, if it finds the tiff library, it will write out
something like this:

checking for Leffler libtiff library... checking linking with -ltiff... ok
setting LIBTIFF_CFLAGS=
setting LIBTIFF_LIBS=-ltiff

If you then look at config_auto.h, you should find this:

/* Define if you have the www.libtiff.org LIBTIFF library. */
#define HAVE_LIBTIFF 1



Perhaps your libtiff or include files are not on your search path.

Posted: Fri 22 Jan 2010, 06:26
by disciple
:(
I had that problem or something extremely similar, I'm pretty sure it was with leptonica, although it could have been with ocropus or iulib or something else used by ocropus or tesseract.
IIRC it was a bug in whatever I was trying to compile, although I can't seem to find the bug report again.
I gave up :(

Please post a -dev package for leptonica if you do get it working, that way we can build other things that use it.

Posted: Fri 22 Jan 2010, 16:22
by dsb
Dingo, another thing you can do is build leptonica using the built-in makefile.

This doesn't use config_auto.h. Instead, configuration is done in the file environ.h. It is pre-set to use the tiff library. So just type 'make' in the src directory to build the library, and then try to build any (or all) of the programs in the prog directory (type 'make' there also). If the tiff library links, it should be obvious how to get your jbig2enc to link as well.

There have been some reports of people having problems linking leptonica with ocropus -- AFAIK, they are all due to ocropus configuration errors.

Finally, you can build jbig2enc with any recent version of leptonica and I'd suggest using the most recent, which is 1.64.

Posted: Fri 22 Jan 2010, 16:38
by Dingo
dsb, I tried as you suggested, and jbig2enc seems fully working also with tiff images so i attach liblept.a in 1.58 and 1.64 version (latest), even I'm not sure that I rightly built, but the fact that jbig2enc works encourages me

leptonica-libs 1.58
leptonica-libs 1.64

I built jbig2enc upon leptonica 1.58 since trying to build with 1.64 gives some errors (related to jbig2enc)