Issue 1 in ocropus: OCRopus only works on Ubuntu or Linux (no Windows, MacOS support)

2 views
Skip to first unread message

codesite...@google.com

unread,
Jun 2, 2009, 1:42:24 PM6/2/09
to ocropus...@googlegroups.com

Comment #18 on issue 1 by jtraviswebb: OCRopus only works on Ubuntu or
Linux (no Windows, MacOS support)
http://code.google.com/p/ocropus/issues/detail?id=1

has anyone tried building on os x recently? when i try to use scons it
tells me i need libtiff4-dev or equivalent.
fink only has libtiff3.something and installing libtiff4.beta doesnt seem
to work either. if i use configure it fails
because it can't find Makefile.in. i have it working just fine on ubuntu,
but i would really like it to run on os x.
any thoughts, help for os x?

--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

codesite...@google.com

unread,
Jun 4, 2009, 8:01:20 PM6/4/09
to ocropus...@googlegroups.com

Comment #20 on issue 1 by jtraviswebb: OCRopus only works on Ubuntu or

os x:
i don't know how much of this is actually required. i simply tried
to install everything that would be installed on an ubunutu machine
via the recommended install procces. this worked for me:
o install os x (10.5.6)
o install xcode and dev tools (3.2.1)
o install mercurial from source (1.2.1)
$ sudo python setup.py install
o install scons from source (1.2.0)
$ sudo python setup.py install
o install libpng from source (1.2.37)
$ ./configure
$ make check
$ sudo make install
o install libtool from source (2.2.6)
$ ./configure
$ sudo make install
o install libjpeg from source (6b)
-copy libtool (the executable) from the directory
-where you compiled it (.../libtool-2.2.6/) into the
-root folder of libjpeg (.../jpeg-6b/)
$ ./configure --enable-static --enable-shared
$ sudo make install
o install giflib from source (4.1.6)
$ ./configure
$ sudo make install
o install libtiff from source (4.0.0.beta3)
-safari does not seem to be able to open the ftp site
-to download the file, but firfox works just fine
$ ./configure
$ sudo make install
o install SDL from source (1.2.13)
$ ./configure
$ sudo make install
o install SDL_image from source (1.2.7)
$ ./configure
$ sudo make install
o install SDL_gfx from source (2.0.19)
$ ./configure
$ sudo make install
o install ImageMagick from source (6.5.3-2)
-again my safari does not like their ftp
-but firefox works fine
-this one takes a while to build
$ ./configure
$ sudo make install
o install tesseract from source (2.03)
-download language data packs of your choosing from
-the tesseract website (i picked english) and dump
-the contents into the .../tesseract-2.03/tessdata
-folder. i should ask you if you want to replace some
-files
$ ./configure
$ sudo make install
o install leptonica from source (1.61)
$ ./configure
$ sudo make install
o install ffmpeg from source (revision 29349)
-i did not need to install svn, but your
-system may not have had it preinstalled
-this one takes a while to build
$ svn checkout svn://svn.ffmpeg.org/ffmpeg/trunk ffmpeg
$ ./configure
$ sudo make install
o install gsl from source (1.9)
-this one takes a while to build
$ ./configure
$ sudo make install

now the fun begins

o install iulib from source
$ hg clone http://mercurial.iupr.org/iulib
-change line 63 of SConstruct in the root folder (.../iulib/)
-from:
if not conf.CheckLibWithHeader('tiff', 'tiff.h', 'C', 'inflate();', 1):
-to:
if not conf.CheckLibWithHeader('tiff', 'tiff.h', 'C', 'autoadd=1):
$ scons
$ sudo scons install
o install ocropus from source
$ hg clone http://mercurial.iupr.org/ocropus
-1 change line 115 of SConstruct in the root folder (.../ocropus/)
-from:
assert conf.CheckLibWithHeader('SDL', 'SDL/SDL.h', 'C')
to:
assert conf.CheckLib('SDL')
-2 change line 116 of SConstruct in the root folder (.../ocropus/)
-from:
assert conf.CheckLibWithHeader('SDL_gfx', 'SDL/SDL_gfxPrimitives.h', 'C')
-to:
assert conf.CheckLib('SDL_gfx')
-3 in my install of osx my /usr/bin/ folder contained g++-4.0, g++-4.2
-and g++ which was a soft link to g++-4.0 in order to use the -fopenmp
-(specified on lines 150 and 151) i had to delete old soft link
-(sudo rm /usr/bin/g++) and replace it with a link to g++-4.2
-(sudo ln -s /usr/bin/g++-4.2 /usr/bin/g++)
-4 add a line containing:
#include <liblept/environ.h>
-to .../ocropus/ocr-utils/compoenents.h
-i added it on line 28 but anywhere sensible is fine
-5 add a line containing
#include "../ocr-utils/queue.h"
-to .../ocropus/ocr-line/glcuts.cc
-i added it on line 38 but anywhere sensible is fine
-6 add a line containing
#include "../ocr-utils/queue.h"
-to .../ocropus/ocr-linedeg/seg-cuts.cc
-i added it on line 37 but anywhere sensible is fine
-7 add a line containing
extern char** environ;
-to .../ocropus/ocr-utils/components.cc
-i added it on line 32 but anywhere sensible is fine
-8 in .../ocropus/ocr-voronoi/read_image.cc change line 105
-from:
TIFFHeader hdr;
-to:
TIFFHeaderClassic hdr;
-9 in .../ocropus/ocr-voronoi/read_image.cc change line 122
-from:
if(hdr.tiff_version != TIFF_VERSION &&
-to:
if(hdr.tiff_version != TIFF_VERSION_CLASSIC &&
-10 finally and this is VERY important. it will not effect
-whether or not your ocropus builds but it will effect whether
-or not it works: delete the -O3 in the qutoes on on the opt
-line... i.e. change line 67
-from:
opts.Add('opt', 'Compiler flags for optimization/debugging', "-O3")
to:
opts.Add('opt', 'Compiler flags for optimization/debugging', "")
-i do not know why have the optimization in there is a problem
-if i leave it in i get:
terminate called after throwing an instance of 'char*'
Abort trap
$ scons
$ sudo scons install

codesite...@google.com

unread,
Jun 4, 2009, 10:22:54 AM6/4/09
to ocropus...@googlegroups.com

Comment #19 on issue 1 by mike.lwrnc: OCRopus only works on Ubuntu or Linux

For those interested in a simple droplet interface to OCRopus on Mac OS X,
check out
TakOCR:

http://stuporglue.org/tako/

Reply all
Reply to author
Forward
0 new messages