<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Code-It &#187; ios6.0</title>
	<atom:link href="http://lois.di-qual.net/blog/tag/ios6-0/feed/" rel="self" type="application/rss+xml" />
	<link>http://lois.di-qual.net/blog</link>
	<description></description>
	<lastBuildDate>Tue, 30 Oct 2012 19:19:29 +0000</lastBuildDate>
	<language>fr-FR</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>Compile tesseract for iOS SDK 6.0</title>
		<link>http://lois.di-qual.net/blog/compile-tesseract-for-ios-sdk-6-0/</link>
		<comments>http://lois.di-qual.net/blog/compile-tesseract-for-ios-sdk-6-0/#comments</comments>
		<pubDate>Fri, 21 Sep 2012 19:00:34 +0000</pubDate>
		<dc:creator>Loïs Di Qual</dc:creator>
				<category><![CDATA[iOS]]></category>
		<category><![CDATA[ios]]></category>
		<category><![CDATA[ios6.0]]></category>
		<category><![CDATA[iphone-sdk]]></category>
		<category><![CDATA[ocr]]></category>

		<guid isPermaLink="false">http://lois.di-qual.net/blog/?p=141</guid>
		<description><![CDATA[Update 10/25/12 Added instructions to integrate an armv7s slice in liblept.a and libtesseract_all.a. Update 09/24/12 To make the iOS integration easier, I made a Github repo containing an Objective-C wrapper for Tesseract. It relies on an other repo containing tesseract &#038; leptonica libs. Feel free to improve them ! Objective-C wrapper: https://github.com/ldiqual/tesseract-ios Compiled libraries: https://github.com/ldiqual/tesseract-ios-lib [...]]]></description>
				<content:encoded><![CDATA[<h3>Update 10/25/12</h3>
<p>Added instructions to integrate an armv7s slice in <code class="codecolorer text default"><span class="text">liblept.a</span></code> and <code class="codecolorer text default"><span class="text">libtesseract_all.a</span></code>.</p>
<h3>Update 09/24/12</h3>
<p>To make the iOS integration easier, I made a Github repo containing an Objective-C wrapper for Tesseract. It relies on an other repo containing tesseract &#038; leptonica libs. Feel free to improve them !</p>
<ul>
<li>Objective-C wrapper: <a href="https://github.com/ldiqual/tesseract-ios">https://github.com/ldiqual/tesseract-ios</a></li>
<li>Compiled libraries: <a href="https://github.com/ldiqual/tesseract-ios-lib">https://github.com/ldiqual/tesseract-ios-lib</a></li>
</ul>
<p>More informations about these repos on my <a href="http://lois.di-qual.net/blog/install-and-use-tesseract-on-ios-with-tesseract-ios/">next article</a>.</p>
<h2>Introduction</h2>
<p>I had troubles while following the compiling guide from this blog: <a href="http://tinsuke.wordpress.com/2011/11/01/how-to-compile-and-use-tesseract-3-01-on-ios-sdk-5/">http://tinsuke.wordpress.com/2011/11/01/how-to-compile-and-use-tesseract-3-01-on-ios-sdk-5/</a>. Some dependencies are missing on a fresh Mountain Lion with Xcode 4.5, and more importantly: the <code class="codecolorer text default"><span class="text">build_dependencies.sh</span></code> won&#8217;t work.</p>
<p>Here is why: Xcode 4.5 and iOS SDK 6.0 don&#8217;t support armv6 anymore.</p>
<p>So here are the steps to build <a href="http://code.google.com/p/tesseract-ocr/">tesseract-ocr</a> for iOS SDK 6.0.</p>
<p><span id="more-141"></span></p>
<h2>Requirements</h2>
<p>If you don&#8217;t have HomeBrew already, that&#8217;s a shame. Run to <a href="http://mxcl.github.com/homebrew/">this website</a> and install it.</p>
<p>Then, install libtool and automake:</p>
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ brew install libtool automake</div></td></tr></tbody></table></div>
<p>You should have installed &#8216;Command Line Tools&#8217; after the Homebrew installation, but if you forgot: Open Xcode&#8217;s preferences, and install them from the &#8216;Downloads&#8217; tab.</p>
<p>The build process will need <code class="codecolorer text default"><span class="text">libtoolize</span></code>. Just make a symlink to <code class="codecolorer text default"><span class="text">glibtoolize</span></code>:</p>
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ ln -s /usr/local/bin/glibtoolize /usr/local/bin/libtoolize</div></td></tr></tbody></table></div>
<p>We&#8217;re good to go.</p>
<h2>Sources and compilation</h2>
<p>The steps will more or less follow the tinsuke&#8217;s article, except for one thing: the build script.</p>
<p>Get the following sources:</p>
<ul>
<li>tesseract: <a href="http://code.google.com/p/tesseract-ocr/downloads/detail?name=tesseract-3.01.tar.gz">http://code.google.com/p/tesseract-ocr/downloads/detail?name=tesseract-3.01.tar.gz</a></li>
<li>leptonica: <a href="http://www.leptonica.com/source/leptonica-1.69.tar.gz">http://www.leptonica.com/source/leptonica-1.69.tar.gz</a></li>
<li>build_dependencies.sh: <a href="https://gist.github.com/3763217">https://gist.github.com/3763217</a> (click on &#8220;raw&#8221; and save it to your computer)</li>
</ul>
<p>Then, organize your folder with the following structure:</p>
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">./build/<br />
&nbsp; dependencies/ <br />
&nbsp; leptonica-1.69/<br />
&nbsp; tesseract-3.01/<br />
&nbsp; build_dependencies.sh</div></td></tr></tbody></table></div>
<p>You might want to modify <code class="codecolorer text default"><span class="text">build_dependencies.sh</span></code> to make <code class="codecolorer text default"><span class="text">LEPTON_LIB</span></code> and <code class="codecolorer text default"><span class="text">TESSERACT_LIB</span></code> match the proper folders.</p>
<p>Now, you can build the libraries:</p>
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ chmod +x ./build_dependencies.sh<br />
$ ./build_dependencies</div></td></tr></tbody></table></div>
<p>In <code class="codecolorer text default"><span class="text">dependencies/lib/</span></code>, you&#8217;ll find <code class="codecolorer text default"><span class="text">liblept.a</span></code> and <code class="codecolorer text default"><span class="text">libtesseract_all.a</span></code>, these are the only libraries you need so you can remove other ones. Both contain armv7 and i386 slices only, but many iOS 5 projects require an armv7s slice.</p>
<p>Just <a href="http://www.galloway.me.uk/2012/09/hacking-up-an-armv7s-library/">follow this Matt Galloway&#8217;s blog post</a> to generate and put an armv7s slice into the libs.</p>
<p>Now you just have to copy <code class="codecolorer text default"><span class="text">dependencies/</span></code> in your Xcode Project, and follow <a href="http://lois.di-qual.net/blog/install-and-use-tesseract-on-ios-with-tesseract-ios/">my next article</a> on how to use tesseract.</p>
]]></content:encoded>
			<wfw:commentRss>http://lois.di-qual.net/blog/compile-tesseract-for-ios-sdk-6-0/feed/</wfw:commentRss>
		<slash:comments>25</slash:comments>
		</item>
	</channel>
</rss>
