<?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>Thomas Brox R&#248;st &#187; SimpleParse</title>
	<atom:link href="http://thomas.broxrost.com/category/simpleparse/feed/" rel="self" type="application/rss+xml" />
	<link>http://thomas.broxrost.com</link>
	<description></description>
	<lastBuildDate>Tue, 04 May 2010 13:55:12 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>How to compile SimpleParse 2.1.0a1 for Python 2.6 on Windows Vista</title>
		<link>http://thomas.broxrost.com/2009/06/01/how-to-compile-simpleparse-210a1-for-python-26-on-windows-vista/#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed</link>
		<comments>http://thomas.broxrost.com/2009/06/01/how-to-compile-simpleparse-210a1-for-python-26-on-windows-vista/#comments</comments>
		<pubDate>Mon, 01 Jun 2009 12:20:36 +0000</pubDate>
		<dc:creator>Thomas Brox Røst</dc:creator>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[SimpleParse]]></category>
		<category><![CDATA[cygwin]]></category>
		<category><![CDATA[parsing]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://thomas.broxrost.com/?p=235</guid>
		<description><![CDATA[SimpleParse is a fast Python single-pass parser generator that I use regularly. When I finally made the move onto Python 2.6 it turned out that there is no pre-compiled package for 2.6 on Windows. So, here is my procedure for compiling the source package on Windows Vista. 1. Install Cygwin if you don&#8217;t already have [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://simpleparse.sourceforge.net/">SimpleParse</a> is a fast Python single-pass parser generator that I use regularly. When I finally made the move onto <a href="http://www.python.org/download/releases/2.6/">Python 2.6</a> it turned out that there is no pre-compiled package for 2.6 on Windows. So, here is my procedure for compiling the source package on Windows Vista.</p>
<p>1. Install <a href="http://www.cygwin.com/">Cygwin</a> if you don&#8217;t already have it on your system, and make sure that the version of Python you are installing SimpleParse for is on either the system or the Cygwin path.</p>
<p>2. Download and install <a href="http://www.microsoft.com/express/download/">Microsoft Visual C++ 2008 Express Edition</a>. You should ensure that you have the latest Vista service packs installed before attempting this. If the installer quits on you then just reboot the computer and try again. Without this installed, you wil get an &#8216;Unable to find vcvarsall.bat&#8217; error.</p>
<p>3. Download and unpack the <a href="http://sourceforge.net/project/showfiles.php?group_id=55673&#038;package_id=50682&#038;release_id=394687">SimpleParse 2.1.0a1 source</a>. Using the Cygwin shell, place yourself in the root source directory.</p>
<p>4. If we try to run <code>python setup.py install</code> at this point, the Visual C++ compiler will complain:</p>
<pre class="brush: python">
stt/TextTools/mxTextTools/mxTextTools.c(149) : error C2133:
&#039;mxTextSearch_Methods&#039; : unknown size
stt/TextTools/mxTextTools/mxTextTools.c(920) : error C2133:
&#039;mxCharSet_Methods&#039;: unknown size
stt/TextTools/mxTextTools/mxTextTools.c(2103) : error C2133:
&#039;mxTagTable_Methods&#039; : unknown size
error: command &#039;&amp;amp;amp;quot;C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\cl.exe&amp;amp;amp;quot;&#039;
failed with exit status 2
</pre>
<p>We have to add the following lines to <code>stt/TextTools/mxTextTools/mxTextTools.c</code>, starting at line 148 (before <code>staticforward</code> is used for the first time):</p>
<pre class="brush: cpp">
#ifdef _MSC_VER
#define staticforward extern
#endif
</pre>
<p>5. <code>with</code> is a Python 2.6 keyword, meaning it can&#8217;t be used as a variable, as is the case in the SimpleParse source code. So, we have to replace it with something else:</p>
<pre class="brush: python">
$ sed -r &#039;s/with/with_t/g&#039; &amp;amp;amp;lt; stt/TextTools/TextTools.py &amp;amp;amp;gt; tmp.txt
$ cp tmp.txt stt/TextTools/TextTools.py
</pre>
<p>6. Finally, run <code>python setup.py install</code> as usual.</p>
<div id="wherego_related"><h3>Readers who viewed this page, also viewed:</h3><ul><li><a href="http://thomas.broxrost.com/2009/05/27/on-the-sadness-of-nouns/" rel="bookmark" class="wherego_title">On the sadness of nouns</a></li><li><a href="http://thomas.broxrost.com/2009/03/12/why-amazon-web-services-just-became-a-competitive-web-hosting-provider/" rel="bookmark" class="wherego_title">Why Amazon Web Services just became a competitive web hosting provider</a></li><li><a href="http://thomas.broxrost.com/2008/08/21/persistent-django-on-amazon-ec2-and-ebs-the-easy-way/" rel="bookmark" class="wherego_title">Persistent Django on Amazon EC2 and EBS &#8211; The easy way</a></li><li><a href="http://thomas.broxrost.com/2008/04/08/django-on-google-app-engine/" rel="bookmark" class="wherego_title">Django on Google App Engine in 13 simple steps</a></li><li>Powered by <a href="http://ajaydsouza.com/wordpress/plugins/where-did-they-go-from-here/">Where did they go from here?</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://thomas.broxrost.com/2009/06/01/how-to-compile-simpleparse-210a1-for-python-26-on-windows-vista/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
