<?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>Sat, 21 Apr 2012 17:58:15 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
	<atom:link rel="next" href="http://timony.com/mickzblog/category/programming/cplusplus/feed/?page=2" />

		<item>
		<title>Build &amp; Install Osra 1.3.8 on Ubuntu 11.10</title>
		<link>http://timony.com/mickzblog/2012/03/24/build-install-osra-1-3-8/</link>
		<comments>http://timony.com/mickzblog/2012/03/24/build-install-osra-1-3-8/#comments</comments>
		<pubDate>Sat, 24 Mar 2012 23:32:03 +0000</pubDate>
		<dc:creator>Mick</dc:creator>
				<category><![CDATA[Cplusplus]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[chemistry]]></category>
		<category><![CDATA[gocr]]></category>
		<category><![CDATA[HOWTO]]></category>
		<category><![CDATA[Igor Filippov]]></category>
		<category><![CDATA[NCI]]></category>
		<category><![CDATA[NIH]]></category>
		<category><![CDATA[ocra]]></category>
		<category><![CDATA[ocrad]]></category>
		<category><![CDATA[openbabel]]></category>
		<category><![CDATA[potrace]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://timony.com/mickzblog/?p=775</guid>
		<description><![CDATA[Summary Osra is a a utility designed to convert graphical representations of chemical structures create by Igor Filippov at the National Cancer Institute. This page documents how to compile and install Osra on Ubuntu Linux 11.10. These instructions may work on other versions of Ubuntu Linux and on Debian Linux.  Please leave a comment if [...]]]></description>
			<content:encoded><![CDATA[<h2>Summary</h2>
<p>Osra is a a utility designed to convert graphical representations of chemical structures create by Igor Filippov at the National Cancer Institute. This page documents how to compile and install Osra on Ubuntu Linux 11.10. These instructions may work on other versions of Ubuntu Linux and on Debian Linux.  Please leave a comment if you have compiled Osra using these instructions on a different version of Ubuntu, or on other Linux distributions.</p>
<h2>Overview</h2>
<p>At the time of writing this doc, March 2012, the Osra version is 1.3.8 and is available at:</p>
<ul>
<li><a title="Osra Docs" href="http://cactus.nci.nih.gov/osra/#6" target="_blank"> http://cactus.nci.nih.gov/osra/#6</a></li>
</ul>
<p>I copied all the source to a directory in /tmp. If you need the source code at some later point in time, don&#8217;t use /tmp as files in /tmp are deleted upon reboot (if they&#8217;re older than 14 days). Also, at the time of writing Osra requires a patched version of Gocr for Osra to work. You need to install Gocr before you try to compile and install Osra, you also need to install other packages required for Osra to compile. Most are listed below, but see the <a title="Osra Dependencies " href="http://cactus.nci.nih.gov/osra/#2" target="_blank">Osra Homepage</a> for more details.</p>
<p>An overview of the steps are:</p>
<ol>
<li>Install required Ubuntu packages</li>
<li>Compile and Install Gocr</li>
<li>Compile and Install Osra</li>
</ol>
<p>I&#8217;ve also written instructions on how to install Osra 1.2.1 on <a title="Compiling Osra in Ubuntu Jaunty" href="http://timony.com/mickzblog/2009/07/04/compiling-osra-on-ubuntu-jaunty/" target="_blank">Ubuntu 9.04</a>, however that was written in 2009.<span id="more-775"></span></p>
<h2>Install Ubuntu Packages</h2>
<p>These packages are required to build Osta. Install the following (you will also need some gaphicsmagick packages also, libgraphicsmagick1-dev libgraphicsmagick++3 and maybe some others).</p>
<p style="padding-left: 30px;">sudo apt-get install libtclap-dev libpotrace0  libpotrace-dev  libocrad-dev openbabel libopenbabel-dev  libgraphicsmagick++1-dev libgraphicsmagick++1-dev libgraphicsmagick++3 libgraphicsmagick1-dev libgraphicsmagick3 libnetpbm10-dev</p>
<h2>Quick Install</h2>
<p>Copy and paste the following line to make a directory in /tmp called OSRA, download the source, extract the packages, and build and install both:</p>
<blockquote><p>cd /tmp; mkdir OSRA; cd OSRA; wget http://cactus.nci.nih.gov/osra/osra-1.3.8.tgz ; wget http://cactus.nci.nih.gov/osra/gocr-0.50pre-patched.tgz ; tar xzvf osra-1.3.8.tgz; tar xzvf gocr-0.50pre-patched.tgz; cd /tmp/OSRA/gocr-0.50pre-patched; ./configure; make libs; sudo make all install; cd /tmp/OSRA/osra-1.3.8/; ./configure; make all; sudo make install</p></blockquote>
<p>Osra should be  installed in /usr/local/bin .</p>
<p>Below are the same steps, but with more detail so that you know what your doing:</p>
<h2>Create Directory to Build the Packages</h2>
<p style="padding-left: 30px;">mkdir /tmp/OSRA</p>
<h2>Download the Source</h2>
<p>If you have wget install you can download the source via the command line:</p>
<p style="padding-left: 30px;">cd /tmp/OSRA;</p>
<p style="padding-left: 30px;">wget http://cactus.nci.nih.gov/osra/osra-1.3.8.tgz ;</p>
<p style="padding-left: 30px;">wget http://cactus.nci.nih.gov/osra/gocr-0.50pre-patched.tgz</p>
<p>Otherwise go to the <a title="Download Osra" href="http://cactus.nci.nih.gov/osra/#6" target="_blank">Osar home page</a> and download the source code pacakge for both Osra and Gocr and save it in the directory you created.</p>
<h2>Extract both packages</h2>
<p style="padding-left: 30px;">tar xzvf osra-1.3.8.tgz<br />
tar xzvf gocr-0.50pre-patched.tgz</p>
<h2>Compile &amp; Install Gocr</h2>
<p>You need to make and install the patched Gocr before you try to build Osra:</p>
<p style="padding-left: 30px;">cd /tmp/OSRA/gocr-0.50pre-patched<br />
./configure;<br />
make libs;<br />
sudo make all install;</p>
<p>This will install the patched gocr into /usr/local and copy Gocr header files to /usr/local/include/gocr. This may cause conflicts if you&#8217;ve installed gocr using another methods for instance using apt-get or aptitude. The gocr binary will be in /usr/local . If you have any problems, remove any other version of Gocr you may have build.</p>
<p>Before you continue to the next step, make sure the Gocr header files are installed:</p>
<blockquote><p>$ ls /usr/local/include/gocr/<br />
config.h*  gocr.h*  list.h*  output.h*    pgm2asc.h*  pnm.h*  unicode.h*</p></blockquote>
<p>If you don&#8217;t see the header files, make sure you followed all the steps above.</p>
<h2>Compile &amp; Install Osra</h2>
<p>Next compile Osra:</p>
<p style="padding-left: 30px;">cd /tmp/OSRA/gocr-0.50pre-patched<br />
./configure<br />
make all</p>
<p>To install Osra on your system, run the following using sudo:</p>
<p style="padding-left: 30px;">sudo make install</p>
<p>Look for it in /usr/local/bin:</p>
<p style="padding-left: 30px;">/usr/local/bin/osra</p>
<p><em><strong>Note</strong>: If you break your system while following these instructions, it&#8217;s not my fault. These are give in good faith, but if I&#8217;ve typed something wrong, too bad, I am not responsible! <img src='http://timony.com/mickzblog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </em></p>
<p>/usr/local/bin/osra &#8211;version</p>
<p>/usr/local/bin/osra  version: 1.3.8</p>
<p>Updated April 12th 2012: Added libnetpbm10-dev to the list of required packaged to pre-install.<br />
Updated April 16th 2012: Added missing build steps to Gocr section. Was missing ./configure step<br />
Updated April 17th 2012: Added &#8220;make libs&#8221; to the Gocr build steps, and fixed typo in the quickie install section.<br />
Updated April 20th 2012: Added libocrad-dev to list of packages to add. Note: This package is not available for Lucid!<br />
Updated April 21st: Updated dependencies and cleaned up the document.</p>
]]></content:encoded>
			<wfw:commentRss>http://timony.com/mickzblog/2012/03/24/build-install-osra-1-3-8/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<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><em>Update</em>: I&#8217;ve a newer document that shows how to install Osra on Ubuntu 11.10 (Oneiric):</p>
<ul>
<li><a title="Build &amp; Install Osra 1.3.8 on Ubuntu 11.10" href="http://timony.com/mickzblog/2012/03/24/build-install-osra-1-3-8/" target="_blank">http://timony.com/mickzblog/2012/03/24/build-install-osra-1-3-8/</a></li>
</ul>
<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>10</slash:comments>
		</item>
	</channel>
</rss>

