New Ticket     Tickets     Wiki     Browse Source     Timeline     Roadmap     Ticket Reports     Search

Ticket #32907 (closed enhancement: fixed)

Opened 16 months ago

Last modified 16 months ago

tesseract @3.00_2+eng Not using leptonica

Reported by: jack@… Owned by: emer@…
Priority: Normal Milestone:
Component: ports Version: 2.0.3
Keywords: Cc: ryandesign@…
Port: tesseract

Description (last modified by ryandesign@…) (diff)

TL;DR version: tesseract isn't building with leptonica. Long version:

If install tesseract using:

$ sudo port selfupdate
$ sudo port install tesseract

... I get an install in /opt/local that gives me this on invocation:

Tesseract Open Source OCR Engine with LibTiff

... and fails to handle any PNG I pass it, telling me something like this:

name_to_image_type:Error:Unrecognized image type:fe-1.png
IMAGE::read_header:Error:Can't read this image type:fe-1.png
Read of file fe-1.png failed.

When I look in the configure script, I see that the leptonica check looks like:

 16433  # Check location of leptonica/liblept headers.
 16434  have_lept=no
 16435  for incd in /usr/local/include /usr/include
 16436  do
 16437    for lept in . leptonica liblept
 16438    do
 16439      if test -r "$incd/$lept/allheaders.h" ; then
 16440        CPPFLAGS="$CPPFLAGS -I$incd/$lept"
 16441        have_lept=yes
 16442      fi
 16443    done
 16444  done

... and adding /opt/local/include to line 16435, then re-building, gets me a binary that gives me this on invocation:

Tesseract Open Source OCR Engine with Leptonica

... which happily processes whatever PNG I pass it.

Change History

comment:1 Changed 16 months ago by ryandesign@…

  • Owner changed from macports-tickets@… to emer@…
  • Type changed from defect to enhancement
  • Description modified (diff)
  • Port set to tesseract

Please remember WikiFormatting.

comment:2 follow-up: ↓ 3 Changed 16 months ago by ryandesign@…

  • Cc ryandesign@… added

I believe we solved this in the process of updating tesseract to 3.01. Can you please check?

comment:3 in reply to: ↑ 2 Changed 16 months ago by jack@…

Replying to ryandesign@…:

I believe we solved this in the process of updating tesseract to 3.01. Can you please check?

I'm not seeing that version in ports:

$ sudo port selfupdate
--->  Updating MacPorts base sources using rsync
MacPorts base version 2.0.3 installed,
MacPorts base version 2.0.3 downloaded.
--->  Updating the ports tree
--->  MacPorts base is already the latest version
$ port list | grep tesser
py26-tesser                    @0.0.1          python/py26-tesser
tesseract                      @3.00           textproc/tesseract

... maybe it hasn't been checked in?

comment:4 Changed 16 months ago by ryandesign@…

Commits are synced to the rsync server every 30 minutes. So wait 30 minutes from the time of my message, then "sudo port selfupdate", then try again.

comment:5 Changed 16 months ago by jack@…

--->  Configuring tesseract
Error: Target org.macports.configure returned: automake failure: shell command failed (see log for details)
Log for tesseract is at: /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_ports_textproc_tesseract/tesseract/main.log
Error: Status 1 encountered during processing.
:notice:configure --->  Configuring tesseract
:debug:configure Using compiler 'Mac OS X gcc 4.2'
:debug:configure Executing org.macports.configure (tesseract)
:debug:configure Environment: CPATH='/opt/local/include' CC_PRINT_OPTIONS_FILE='/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_textproc_tesseract/tesseract/work/.CC_PRINT_OPTIONS' LIBRARY_PATH='/opt/local/lib' CC_PRINT_OPTIONS='YES' MACOSX_DEPLOYMENT_TARGET='10.6'
:debug:configure Assembled command: 'cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_textproc_tesseract/tesseract/work/tesseract-3.01" && automake'
:debug:configure Executing command line:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_textproc_tesseract/tesseract/work/tesseract-3.01" && automake 
:info:configure aclocal.m4:16: warning: this file was generated for autoconf 2.65.
:info:configure You have another version of autoconf.  It may work, but is not guaranteed to.
:info:configure If you have problems, you may need to regenerate the build system entirely.
:info:configure To do so, use the procedure documented by the package, typically `autoreconf'.
:info:configure configure.ac:146: warning: AC_LANG_CONFTEST: no AC_LANG_SOURCE call detected in body
:info:configure ../../lib/autoconf/lang.m4:194: AC_LANG_CONFTEST is expanded from...
:info:configure ../../lib/autoconf/general.m4:2662: _AC_LINK_IFELSE is expanded from...
:info:configure ../../lib/autoconf/general.m4:2679: AC_LINK_IFELSE is expanded from...
:info:configure aclocal.m4:1037: _LT_SYS_MODULE_PATH_AIX is expanded from...
:info:configure aclocal.m4:4185: _LT_LINKER_SHLIBS is expanded from...
:info:configure aclocal.m4:5268: _LT_LANG_C_CONFIG is expanded from...
:info:configure aclocal.m4:159: _LT_SETUP is expanded from...
:info:configure aclocal.m4:88: LT_INIT is expanded from...
:info:configure aclocal.m4:123: AC_PROG_LIBTOOL is expanded from...
:info:configure configure.ac:146: the top level
:info:configure configure.ac:146: warning: AC_LANG_CONFTEST: no AC_LANG_SOURCE call detected in body
:info:configure ../../lib/autoconf/lang.m4:194: AC_LANG_CONFTEST is expanded from...
:info:configure ../../lib/autoconf/general.m4:2662: _AC_LINK_IFELSE is expanded from...
:info:configure ../../lib/autoconf/general.m4:2679: AC_LINK_IFELSE is expanded from...
:info:configure aclocal.m4:4185: _LT_LINKER_SHLIBS is expanded from...
:info:configure aclocal.m4:5268: _LT_LANG_C_CONFIG is expanded from...
:info:configure aclocal.m4:159: _LT_SETUP is expanded from...
:info:configure aclocal.m4:88: LT_INIT is expanded from...
:info:configure aclocal.m4:123: AC_PROG_LIBTOOL is expanded from...
:info:configure configure.ac:146: the top level
:info:configure configure.ac:146: warning: AC_LANG_CONFTEST: no AC_LANG_SOURCE call detected in body
:info:configure ../../lib/autoconf/lang.m4:194: AC_LANG_CONFTEST is expanded from...
:info:configure ../../lib/autoconf/general.m4:2662: _AC_LINK_IFELSE is expanded from...
:info:configure ../../lib/autoconf/general.m4:2679: AC_LINK_IFELSE is expanded from...
:info:configure aclocal.m4:1037: _LT_SYS_MODULE_PATH_AIX is expanded from...
:info:configure aclocal.m4:5371: _LT_LANG_CXX_CONFIG is expanded from...
:info:configure aclocal.m4:800: _LT_LANG is expanded from...
:info:configure aclocal.m4:783: LT_LANG is expanded from...
:info:configure aclocal.m4:811: _LT_LANG_DEFAULT_CONFIG is expanded from...
:info:configure aclocal.m4:159: _LT_SETUP is expanded from...
:info:configure aclocal.m4:88: LT_INIT is expanded from...
:info:configure aclocal.m4:123: AC_PROG_LIBTOOL is expanded from...
:info:configure configure.ac:146: the top level
:info:configure configure.ac:156: version mismatch.  This is Automake 1.11.2,
:info:configure configure.ac:156: but the definition used by this AM_INIT_AUTOMAKE
:info:configure configure.ac:156: comes from Automake 1.11.1.  You should recreate
:info:configure configure.ac:156: aclocal.m4 with aclocal and run automake again.
:info:configure shell command " cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_textproc_tesseract/tesseract/work/tesseract-3.01" && automake " returned error 63
:error:configure Target org.macports.configure returned: automake failure: shell command failed (see log for details)
:debug:configure Backtrace: automake failure: shell command failed (see log for details)
    while executing
"$procedure $targetname"
:info:configure Warning: the following items did not execute (for tesseract): org.macports.activate org.macports.configure org.macports.build org.macports.destroot org.macports.install

comment:6 Changed 16 months ago by jack@…

Argh, it ate the formatting in my reply, sorry.

comment:7 Changed 16 months ago by ryandesign@…

I've fixed your WikiFormatting. Yes, unfortunately between the time we developed the patch to update the port to 3.01, and the time I committed it, a new version of automake 1.11.2 was released which tesseract does not like. As a workaround for now, you could downgrade to automake 1.11.1.

comment:8 Changed 16 months ago by ryandesign@…

  • Status changed from new to closed
  • Resolution set to fixed

This ticket was about tesseract not using leptonica. As I said above, I believe that issue is resolved. The new issue of tesseract not building with automake 1.11.2 is tracked in #32913.

comment:9 Changed 16 months ago by jack@…

Works a treat with automake 1.11.1.

Note: See TracTickets for help on using tickets.