My favorites | Sign in
Logo
                
New issue | Search
for
| Advanced search | Search tips
Issue 1: OCRopus only works on Ubuntu or Linux (no Windows, MacOS support)
8 people starred this issue and may be notified of changes. Back to list
Status:  Accepted
Owner:  tmb...@gmail.com
Type-Defect
Priority-Medium


Sign in to add a comment
 
Reported by tmb...@gmail.com, Apr 07, 2007
OCRopus probably doesn't compile and/or run on Windows or MacOS.

We are currently focussed on Linux support and are primarily developing on
Ubuntu Linux.

Please do not report missing platform support for other platforms as a bug
for the time being.  If you're seriously interested in supporting another
platform, please send a note to the mailing list.
Comment 1 by tmb...@gmail.com, Apr 07, 2007
(No comment was entered for this change.)
Labels: Milestone-Release2.0
Comment 2 by Bill.Janssen, Apr 10, 2007
What mailing list?
Comment 3 by b.heesakkers, Apr 11, 2007
Oke, I like this policy. Good point.
Comment 4 by dilbert.side, Apr 11, 2007
FYI MacOS
I just succeeded to compile both project tesseract-ocr and ocropus with latest svn
2007/04/12
I updated missing packages (aspell) with FINK, and that was done!
my system is 
  Machine Name:	PowerBook G4 12"
  Machine Model:	PowerBook6,8
  CPU Type:	PowerPC G4  (1.5)
  Number Of CPUs:	1
  CPU Speed:	1.5 GHz
  L2 Cache (per CPU):	512 KB
  Memory:	1.25 GB
-----
  System Version:	Mac OS X 10.4.9 (8P135)
  Kernel Version:	Darwin 8.9.0
-----
Fink 0.24.26
Comment 5 by tmb...@gmail.com, Apr 11, 2007
*What mailing list?*

http://groups.google.com/group/ocropus (it's also a mailing list)
Comment 6 by yus...@mac.com, Apr 15, 2007
I just want to let you know that I have successfully built / ran on Mac OSX with intel chip.
System detail is as following:
  Machine Name:	Mac
  Machine Model:	MacBookPro2,2
  Processor Name:	Intel Core 2 Duo
  Processor Speed:	2.16 GHz
  Number Of Processors:	1
  Total Number Of Cores:	2
  L2 Cache (per processor):	4 MB
  Memory:	2 GB
  Bus Speed:	667 MHz

Cheers
Comment 7 by halshura, Jan 26, 2008
compiling openfst however does not work on my Leopard Mac OS X:

$ make
( cd lib ; make all )
g++ -shared   -o libfst.so fst.o properties.o symbol-table.o compat.o
Undefined symbols:
  "_main", referenced from:
      start in crt1.10.5.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make[1]: *** [libfst.so] Error 1
make: *** [all] Error 2


Comment 8 by memetb, Mar 26, 2008
 On intel Leopard: 
confirming that ocropus and tesseract build.

 Halshura: 
 I have the same issue with OpenFST, am investigating libtool as mentionned here:

http://forums.macrumors.com/showthread.php?t=94571

Comment 10 by memetb, Mar 26, 2008
Adding to previous comment:

 You can indeed build OpenFST by modifying the makefiles. In ./lib/Makefile and ./bin/Makefile, there are 
several lines that have "on OSX" comments.

 E.g. (lib/Makefile)

LIBTYPE=so # "dylib" on macosx
SOFLAGS=-shared  # "-dynamiclib -flat_namespace -undefined suppress" on macosx

 Just make those lines:

LIBTYPE=dylib
SOFLAGS=-dynamiclib -flat_namespace -undefined suppress


 I'm currently building on OSX Leopard (intel). Haven't yet had any errors and it's been churning for 10 
minutes. Have not built ocropus with externals, but I'm pretty sure it will work.


Comment 11 by memetb, Mar 27, 2008
 Aside from the above building issues, there is an error generated in the OpenFST header file when trying to build ocropus. It 
claims there is an ambiguous template expansion. The ambiguous choices are between: colib::swap and 
colib::<unnamed>::swap

 I do not have the error code handy right now, but modifying this following line in statesort.h (in the openFST library) fixes the 
error:

line 64
    for (; !done[s1]; s1 = s2, final1 = final2, swap(arcs1, arcs2)) {

becomes:
    for (; !done[s1]; s1 = s2, final1 = final2, colib::swap(arcs1, arcs2)) {

 I will be notifying the OpenFST project about this.


 Once this is done, the system builds and runs. However it seems most tests are failing when running the smoke tests. 
(Failures are mainly in character recognition (recognized character capitalizations), and only one hard error (crash).

 My compiler version is: 
Target: i686-apple-darwin9
Configured with: /var/tmp/gcc/gcc-5465~16/src/configure --disable-checking -enable-werror --prefix=/usr --
mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-transform-name=/^[cg][^.-]*$/s/$/-4.0/ --
with-gxx-include-dir=/include/c++/4.0.0 --with-slibdir=/usr/lib --build=i686-apple-darwin9 --with-arch=apple --
with-tune=generic --host=i686-apple-darwin9 --target=i686-apple-darwin9
Thread model: posix
gcc version 4.0.1 (Apple Inc. build 5465)


Comment 12 by barroca, Jul 14, 2008
Used this changes :

LIBTYPE=so # "dylib" on macosx
SOFLAGS=-shared  # "-dynamiclib -flat_namespace -undefined suppress" on macosx

 Just make those lines:

LIBTYPE=dylib
SOFLAGS=-dynamiclib -flat_namespace -undefined suppress

and worked for me. thanks
Comment 13 by barroca, Jul 14, 2008
BTW

 i had this problem with a different software...
Comment 14 by fernabenso, Sep 05, 2008
I compiled it with cygwin under windows. 
Comment 15 by amita.cute04, Jan 13, 2009
what is the code or steps for installing ocropus or tessaract or OCR on the linux
(ununtu system?
hw it works on ununtu?

Comment 16 by saatyan.kfb, Apr 02, 2009
windows is a stupid OS. so the ocropus have no need to wast time for windows pakege  
Comment 17 by mrjcleaver, Apr 28, 2009
Given it compiles on a Mac, why not provide an executable in the downloads section?


Comment 18 by jtraviswebb, Jun 02, 2009
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?
Comment 19 by mike.lwrnc, Jun 04, 2009
For those interested in a simple droplet interface to OCRopus on Mac OS X, check out
TakOCR:

http://stuporglue.org/tako/
Comment 20 by jtraviswebb, Jun 04, 2009
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
Comment 21 by tmb...@gmail.com, Jun 09, 2009
(No comment was entered for this change.)
Labels: -Milestone-Release2.0
Comment 22 by bbrame, Jul 06, 2009
In addition to the above changes, I needed to do the following to get Ocropus0.4 working on OSX10.5.

-----< 1 >------
If using scons 1.2 comment out line 120:
replace 
env.Append(LIBS=["tiff","jpeg","png","gif"])
width
#env.Append(LIBS=["tiff","jpeg","png","gif"])

-----< 2 >------
Replace lines 102 and 103 with:
env.Append(LIBPATH=["${iulib}/lib", "/usr/local/lib", "/usr/lib"])
env.Append(CPPPATH=["${iulib}/include", "/usr/local/include", "/usr/include/"])

-----< 3 >------
Change line 94 of /usr/local/include/colib/rowarrays.h from 
        return (T)sqrt(rowdist_euclidean_squared(values,i,v));
to 
        return (T)sqrt((float)rowdist_euclidean_squared(values,i,v));

Sign in to add a comment

Hosted by Google Code