{"id":26,"date":"2008-08-19T20:03:24","date_gmt":"2008-08-20T00:03:24","guid":{"rendered":"http:\/\/www.compdigitec.com\/labs\/?p=26"},"modified":"2009-04-15T18:12:16","modified_gmt":"2009-04-15T22:12:16","slug":"compiling-re2c-0135-on-ubuntu-804","status":"publish","type":"post","link":"http:\/\/www.compdigitec.com\/labs\/2008\/08\/19\/compiling-re2c-0135-on-ubuntu-804\/","title":{"rendered":"Compiling re2c 0.13.5 on Ubuntu 8.04+ (binaries available)"},"content":{"rendered":"<p>If you need the latest features of the <a rel=\"nofollow\" href=\"http:\/\/re2c.sf.net\/\">re2c compiler<\/a>, you would normally <strong>sudo apt-get install re2c<\/strong> to install the re2c compiler. However, the Ubuntu packaging team (again) has not updated their re2c package to the latest re2c v0.13.5, so here are some pre-compiled re2c binaries. <strong>Be sure to remove the official version in the repos before installing.<\/strong><\/p>\n<p><strong>Download pre-compiled packages of re2c 0.13.5<br \/>\n<\/strong><\/p>\n<ul>\n<li><a href=\"\/labs\/files\/re2c_0135_debian.deb\">Debian Package: 532K<\/a><\/li>\n<li><a href=\"\/labs\/files\/re2c_0135_redhat.rpm\">RPM Package: 532K<\/a><\/li>\n<\/ul>\n<p>If you still want to compile it yourself, make sure you install <a rel=\"nofollow\" href=\"http:\/\/www.gnu.org\/software\/bison\/\">GNU Bison<\/a>, GNU C Compiler and the build essentials &#8211; you can do all of this with <code><strong>sudo apt-get install bison gcc build-essential<\/strong><\/code>.<\/p>\n<ol>\n<li><a rel=\"nofollow\" href=\"http:\/\/internap.dl.sourceforge.net\/sourceforge\/re2c\/re2c-0.13.5.tar.gz\">Download re2c 0.13.5<\/a> and extract it to a temporary folder (\/usr\/src\/re2c in the logs).<\/li>\n<li>Configure re2c with <code><strong>.\/configure --prefix=\/re2c<\/strong><\/code>. If you require it, here are <a rel=\"nofollow\" href=\"\/labs\/files\/re2c_0135_config_log.log\">logs of an successful configure<\/a>.<\/li>\n<li>If successful, build re2c with <code><strong>make<\/strong><\/code>. Again, here are the <a rel=\"nofollow\" href=\"\/labs\/files\/re2c_0135_make_log.log\">make logs of a successful make<\/a> if you require it.<\/li>\n<li>If successful, copy re2c to \/re2c with <code><strong>make install<\/strong><\/code>. If you require it, here are <a rel=\"nofollow\" href=\"\/labs\/files\/re2c_0135_makeinst_log.log\">make install logs<\/a>. (Installation comes later).<\/li>\n<li>Test it by running <code><strong>\/re2c\/bin\/re2c --version<\/strong><\/code>. It should return &#8220;re2c 0.13.5&#8221;. If it does not, repeat all of the steps above and try again.<\/li>\n<li>Now build a Debian\/Ubuntu package: (stripped down version of <a href=\"\/labs\/2008\/07\/28\/building-deb-packages-on-ubuntudebian\/\">this article<\/a> &#8211; read it for more details)\n<ol>\n<li>Make a new folder called package<\/li>\n<li>Change into the package folder<\/li>\n<li>Make a new folder called DEBIAN<\/li>\n<li>Inside the DEBIAN folder, create a file called control. See http:\/\/www.debian.org\/doc\/debian-policy\/ch-controlfields.html#s-f-Package for more details. (Note: do not name the package re2c to avoid conflict with the existing one)<\/li>\n<li>Copy \/re2c to here and rename it usr<\/li>\n<li>(<span style=\"color: red;\">Important<\/span>) Create a dummy link with <code><strong>ln -s \/re2c \/usr<\/strong><\/code><\/li>\n<li>Change to the parent directory<\/li>\n<li>Build package with <code><strong>dpkg-deb --build package<\/strong><\/code>.<\/li>\n<li>If everything was successful, your new package is in package.deb!<\/li>\n<\/ol>\n<\/li>\n<li>Remove \/re2c and all sub-folders.<\/li>\n<li>You&#8217;re done! Install your package with <strong>dpkg -i package.deb<\/strong>.<\/li>\n<\/ol>\n<p>If this article was useful or helpful, please help Compdigitec spread the word or please leave a comment. Don&#8217;t forget to <a href=\"\/labs\/feed\/\">subscribe<\/a> to Compdigitec Labs for more interesting articles!<\/p>","protected":false},"excerpt":{"rendered":"<p>If you need the latest features of the re2c compiler, you would normally sudo apt-get install re2c to install the re2c compiler. However, the Ubuntu packaging team (again) has not updated their re2c package to the latest re2c v0.13.5, so here are some pre-compiled re2c binaries. Be sure to remove the official version in the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[3],"tags":[],"_links":{"self":[{"href":"http:\/\/www.compdigitec.com\/labs\/wp-json\/wp\/v2\/posts\/26"}],"collection":[{"href":"http:\/\/www.compdigitec.com\/labs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.compdigitec.com\/labs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.compdigitec.com\/labs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.compdigitec.com\/labs\/wp-json\/wp\/v2\/comments?post=26"}],"version-history":[{"count":0,"href":"http:\/\/www.compdigitec.com\/labs\/wp-json\/wp\/v2\/posts\/26\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.compdigitec.com\/labs\/wp-json\/wp\/v2\/media?parent=26"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.compdigitec.com\/labs\/wp-json\/wp\/v2\/categories?post=26"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.compdigitec.com\/labs\/wp-json\/wp\/v2\/tags?post=26"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}