<?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>/home/\/\ick &#187; Cplusplus</title>
	<atom:link href="http://timony.com/mickzblog/category/programming/cplusplus/feed/" rel="self" type="application/rss+xml" />
	<link>http://timony.com/mickzblog</link>
	<description>Things that interest me.</description>
	<lastBuildDate>Fri, 29 Jul 2011 04:08:35 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<atom:link rel="next" href="http://timony.com/mickzblog/category/programming/cplusplus/feed/?page=2" />

		<item>
		<title>Compiling Osra on Ubuntu Jaunty</title>
		<link>http://timony.com/mickzblog/2009/07/04/compiling-osra-on-ubuntu-jaunty/</link>
		<comments>http://timony.com/mickzblog/2009/07/04/compiling-osra-on-ubuntu-jaunty/#comments</comments>
		<pubDate>Sat, 04 Jul 2009 14:30:06 +0000</pubDate>
		<dc:creator>Mick</dc:creator>
				<category><![CDATA[Cplusplus]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[gocr]]></category>
		<category><![CDATA[HOWTO]]></category>
		<category><![CDATA[ocrad]]></category>
		<category><![CDATA[openbabel]]></category>
		<category><![CDATA[osra]]></category>
		<category><![CDATA[potrace]]></category>

		<guid isPermaLink="false">http://timony.com/mickzblog/?p=646</guid>
		<description><![CDATA[This is a brief HOWTO on compiling OSRA, (Optical Structure Recognition) on Ubuntu Jaunty. To quote the OSRA home page, OSRA is &#8230; is a utility designed to convert graphical representations of chemical structures, as they appear in journal articles, patent documents, textbooks, trade magazines etc., into SMILES (Simplified Molecular Input Line Entry Specification &#8211; [...]]]></description>
			<content:encoded><![CDATA[<p>This is a brief HOWTO on compiling <a title="OSRA Home Page" href="http://cactus.nci.nih.gov/osra/">OSRA</a>, (Optical Structure Recognition) on Ubuntu Jaunty. To quote the OSRA home page, OSRA is</p>
<blockquote><p>&#8230; is a utility designed to convert graphical representations of chemical structures, as they appear in journal articles, patent documents, textbooks, trade magazines etc., into SMILES (Simplified Molecular Input Line Entry Specification &#8211; see <a href="http://en.wikipedia.org/wiki/SMILES"> http://en.wikipedia.org/wiki/SMILES</a>) or SD file &#8211;  a computer recognizable molecular structure format.  OSRA can read a document  in any of the over 90 graphical formats parseable by ImageMagick &#8211; including  GIF, JPEG, PNG, TIFF, PDF, PS etc., and generate the SMILES or SDF representation of the molecular structure images encountered within that document &#8230;</p></blockquote>
<p><strong>Make a directory to compile the source:</strong></p>
<p><em>mkdir /tmp/OSRA; cd /tmp/OSRA;</em></p>
<p>Be careful doing this in /tmp is cleaned upon reboot the directory may be removed.</p>
<p><strong>Install dependencies needed by the OS:</strong></p>
<p><em>sudo apt-get install libgraphicsmagick1-dev libmagick++-dev libgraphicsmagick++1-dev potrace gocr  libtclap-dev libopenbabel-dev libopenbabel3 openbabel libnetpbm10 libnetpbm10-dev</em></p>
<p>Don&#8217;t install ocrad and remove it if it&#8217;s on your system (you can probably reinstall if you need to after you get Osra to compile):<br />
<em> sudo apt-get remove &#8211;purge ocrad;</em></p>
<p><strong>Source Code:</strong></p>
<p>Instead of manually getting the source packages download the sources used to build the packages for Ubuntu if available.  Make sure the src lines are commented in, in your /etc/apt/sources.list . This will automatically download and extract the code into the current directory:</p>
<p><em>cd /tmp/OSRA; apt-get source gocr ocrad potrace;</em></p>
<p>This downloads Gocr 0.46 which the OSRA docs say may not work:</p>
<blockquote><p>- GOCR/JOCR, optical character recognition library, version 0.43 or later (version 0.45 recommended, do not use 0.46! See special instructions for 0.47 compilation below)<span id="more-646"></span></p></blockquote>
<p><strong>Get the Osra Source and extract it</strong></p>
<p><em>cd /tmp/OSRA;</em></p>
<p><em>wget http://cactus.nci.nih.gov/osra/osra-1.2.1.tgz;</em></p>
<p><em>tar xzvf osra-1.2.1.tgz</em></p>
<p><em>cd /tmp/OSRA2/osra-1.2.1;</em></p>
<p><strong>Make a backup copy of the OSRA Makefile:</strong></p>
<p><em>cp Makefile Makefile.bak;</em></p>
<p><strong>Edit the Makefile<br />
</strong></p>
<p>Change the following lines:</p>
<p><em>GOCR=../gocr-0.45/</em><br />
to<br />
<em> GOCR=../gocr-0.46/</em></p>
<p><em>OPENBABEL=/usr/local/</em><br />
to<br />
<em>OPENBABEL=/usr/</em></p>
<p><em>TCLAPINC=-I/usr/local/include/tclap/</em><br />
to<br />
<em>TCLAPINC=-I/usr/include/tclap/</em></p>
<p><span style="text-decoration: line-through;"><em>GOCR=../gocr-0.46/</em><br />
to<br />
<em>GOCR=../gocr-0.45/</em></span></p>
<p><strong>Compiling</strong></p>
<p>Compile, but don&#8217;t install the potrace source:<br />
<em>cd /tmp/OSRA/potrace-1.8;<br />
./configure;<br />
make;</em></p>
<p>Compile the OSRA source:<br />
<em>cd /tmp/OSRA/osra-1.2.1;<br />
make;</em></p>
<p>This produces a working OSRA binary:</p>
<p><em>./osra<br />
./osra  [-f &lt;can/smi/sdf&gt;] [-g] [-p] [-s &lt;dimensions, 300x400&gt;] [-n] [-r<br />
&lt;default: auto&gt;] [-o &lt;filename prefix&gt;] [-t &lt;0.2..0.8&gt;] [--]<br />
[--version] [-h] &lt;filename&gt;</em></p>
<p>Now I just need a file to test it against to see if it will run correctly.</p>
<p>If you want to build with Gocr 0.47 this step is required:<br />
<em>cd /tmp/OSRA/gocr-0.47;<br />
./configure CPPFLAGS=-fPIC LDFLAGS=-fPIC;<br />
make libs;<br />
</em></p>
]]></content:encoded>
			<wfw:commentRss>http://timony.com/mickzblog/2009/07/04/compiling-osra-on-ubuntu-jaunty/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

