<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Seek Nuance &#187; PyLucene</title>
	<atom:link href="http://seeknuance.com/tag/pylucene/feed/" rel="self" type="application/rss+xml" />
	<link>http://seeknuance.com</link>
	<description>Python, Django, technology, Seattle, careers, life, et cetera...</description>
	<lastBuildDate>Sun, 05 Feb 2012 17:11:16 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='seeknuance.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Seek Nuance &#187; PyLucene</title>
		<link>http://seeknuance.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://seeknuance.com/osd.xml" title="Seek Nuance" />
	<atom:link rel='hub' href='http://seeknuance.com/?pushpress=hub'/>
		<item>
		<title>Building PyLucene for Review Board on Ubuntu Hardy</title>
		<link>http://seeknuance.com/2008/12/09/building-pylucene-for-review-board-on-ubuntu-hardy/</link>
		<comments>http://seeknuance.com/2008/12/09/building-pylucene-for-review-board-on-ubuntu-hardy/#comments</comments>
		<pubDate>Tue, 09 Dec 2008 20:04:22 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[PyLucene]]></category>

		<guid isPermaLink="false">http://seeknuance.com/?p=1219</guid>
		<description><![CDATA[My team (well, there&#8217;s just two of us now) is creating the development infrastructure for our big project, which is building my company&#8217;s new CMS on Plone. We&#8217;ll be Agile, of course, but without zealotry. It fell to me to install Review Board on our Ubuntu 8.04 (Hardy) administrative server, to evaluate it for our online code reviews. This should [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=seeknuance.com&amp;blog=2611216&amp;post=1219&amp;subd=seeknuance&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>My team (well, there&#8217;s just two of us now) is creating the development infrastructure for our big project, which is building my company&#8217;s new CMS on <a href="http://plone.org/" target="_self">Plone</a>. We&#8217;ll be <a href="http://en.wikipedia.org/wiki/Agile_software_development" target="_self">Agile</a>, of course, but without zealotry.</p>
<p>It fell to me to install <a href="http://www.review-board.org/" target="_self">Review Board</a> on our <a href="http://www.ubuntu.com/" target="_self">Ubuntu</a> <a href="https://wiki.ubuntu.com/HardyHeron" target="_self">8.04 (Hardy)</a> administrative server, to evaluate it for our online code reviews. This should have been a snap, because:</p>
<ol>
<li>The server is a clean installation, administered by yours truly. I install only necessary software, and use <code>apt-get</code> for all of them.</li>
<li>I read installation instructions before installing software.</li>
<li>I&#8217;m smart.</li>
</ol>
<p>I installed Review Board and hooked it up to <a href="http://httpd.apache.org/docs/2.2/" target="_self">Apache 2.2</a> without too much trouble. (I had a mental block on the <code><a href="http://httpd.apache.org/docs/2.2/mod/mod_alias.html" target="_self">&lt;Alias&gt;</a></code> directive, but never mind that.)</p>
<p>All went well, until I got to the end of <a href="http://code.google.com/p/reviewboard/wiki/GettingStarted" target="_self">Review Board&#8217;s installation instructions</a>. There I found:</p>
<blockquote><p><strong> Set Up Search</strong><br />
This isn&#8217;t strictly necessary (and might be hard on some platforms), but it&#8217;ll make your users love you. See <a href="http://code.google.com/p/reviewboard/wiki/SettingUpSearch">SettingUpSearch</a> for details.</p></blockquote>
<p>I want my team to love me. So, I took the bait.</p>
<p><span id="more-1219"></span>ReviewBoard search uses <a href="http://pylucene.osafoundation.org/" target="_self">PyLucene</a>. There&#8217;s no PyLucene package for Hardy. This should have told me something. But it had build instructions, so it should be no big deal. Right? I plunged ahead.</p>
<p><code>apt-get install gcc g++ sun-java6-jdk ant</code> worked fine. Looking good.</p>
<p>I went for the final install, and it blew up.</p>
<blockquote><p>root:~/PyLucene-2.4.0-2/jcc# python setup.py build<br />
running build<br />
running build_py<br />
copying jcc/config.py -&gt; build/lib.linux-x86_64-2.5/jcc<br />
copying jcc/classes/org/osafoundation/jcc/PythonVM.class -&gt; build/lib.linux-x86_64-2.5/jcc/classes/org/osafoundation/jcc<br />
copying jcc/classes/org/osafoundation/jcc/PythonException.class -&gt; build/lib.linux-x86_64-2.5/jcc/classes/org/osafoundation/jcc<br />
running build_ext<br />
building &#8216;jcc&#8217; extension<br />
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -D_jcc_lib -I/usr/lib/jvm/java-6-openjdk/include -I/usr/lib/jvm/java-6-openjdk/include/linux -I_jcc -Ijcc/sources -I/usr/include/python2.5 -c jcc/sources/jcc.cpp -o build/temp.linux-x86_64-2.5/jcc/sources/jcc.o -DPYTHON -fno-strict-aliasing -Wno-write-strings<br />
cc1plus: warning: command line option &#8220;-Wstrict-prototypes&#8221; is valid for Ada/C/ObjC but not for C++<br />
jcc/sources/jcc.cpp:20:17: error: jni.h: No such file or directory<br />
In file included from jcc/sources/JObject.h:21,<br />
                 from jcc/sources/jcc.cpp:28:<br />
jcc/sources/JCCEnv.h:73: error: ‘jobject’ does not name a type<br />
jcc/sources/JCCEnv.h:79: error: ‘jclass’ does not name a type<br />
[...snip...]</p></blockquote>
<p>Ruh roh, <code>jni.h</code> was nowhere to be found!</p>
<p>After a bit of sleuthing, here&#8217;s what the problem turned out to be. The installation instructions — which had been tested and verified to be correct, right? guess not — had me install the <code>sun-java6-jdk</code> package, which created <code>/usr/lib/jvm/java-6-sun-1.6.0.07</code> and an associated <code>/usr/lib/jvm/java-6-sun</code> symlink.</p>
<p>But, gee whiz, the <code>gcc</code> command looked for includes in <code>/usr/lib/jvm/java-6-openjdk</code>.</p>
<p>The Sun JDK and Open JDK are supposed to now be functionally identical, with the latter one just having a more friendly open-source license. So, I edited <code>setup.py</code> and changed the <code>INCLUDES</code> to be:</p>
<blockquote><p><code>INCLUDES = {<br />
[snip]<br />
'linux2': ['/usr/lib/jvm/java-6-sun/include', '/usr/lib/jvm/java-6-sun/include/linux'],<br />
[snip]</code></p></blockquote>
<p>Rebuild.</p>
<p><em>Bam</em>, crash and burn with a <code>g++</code> error.</p>
<blockquote><p><code>g++ -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions build/temp.linux-x86_64-2.5/jcc/sources/jcc.o build/temp.linux-x86_64-2.5/jcc/sources/JCCEnv.o -o build/lib.linux-x86_64-2.5/libjcc.so -L/usr/lib/jvm/java-6-openjdk/jre/lib/amd64 -ljava -L/usr/lib/jvm/java-6-openjdk/jre/lib/amd64/server -ljvm -Wl,-rpath=/usr/lib/jvm/java-6-openjdk/jre/lib/amd64:/usr/lib/jvm/java-6-openjdk/jre/lib/amd64/server -Wl,-S -lpython2.5<br />
/usr/bin/ld: cannot find -ljava<br />
collect2: ld returned 1 exit status<br />
error: command 'g++' failed with exit status 1</code></p></blockquote>
<p>Ah, the pesky &#8220;openjdk&#8221; again. Turns out the link flags were also broken. I changed the <code>LFLAGS</code> to also point to <code>/usr/lib/jvm/java-6-sun</code>.</p>
<p>Rebuild.</p>
<p>Success! Finishing the installation required some fiddling with my <code>sys.path</code>, but that was trivial.</p>
<br /> Tagged: Linux, PyLucene <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/seeknuance.wordpress.com/1219/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/seeknuance.wordpress.com/1219/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/seeknuance.wordpress.com/1219/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/seeknuance.wordpress.com/1219/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/seeknuance.wordpress.com/1219/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/seeknuance.wordpress.com/1219/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/seeknuance.wordpress.com/1219/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/seeknuance.wordpress.com/1219/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/seeknuance.wordpress.com/1219/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/seeknuance.wordpress.com/1219/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/seeknuance.wordpress.com/1219/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/seeknuance.wordpress.com/1219/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/seeknuance.wordpress.com/1219/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/seeknuance.wordpress.com/1219/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=seeknuance.com&amp;blog=2611216&amp;post=1219&amp;subd=seeknuance&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://seeknuance.com/2008/12/09/building-pylucene-for-review-board-on-ubuntu-hardy/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/06e11035cfdfa379361211795b43f87e?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=X" medium="image">
			<media:title type="html">John</media:title>
		</media:content>
	</item>
	</channel>
</rss>
