{"id":263,"date":"2017-02-11T03:08:07","date_gmt":"2017-02-11T03:08:07","guid":{"rendered":"http:\/\/weegreenblobbie.com\/?p=263"},"modified":"2017-02-11T03:09:40","modified_gmt":"2017-02-11T03:09:40","slug":"swig-is-broken-in-ubuntu-16-04-xenial","status":"publish","type":"post","link":"https:\/\/weegreenblobbie.com\/?p=263","title":{"rendered":"Swig is broken in Ubuntu 16.04 (xenial)"},"content":{"rendered":"<p>If you&#8217;re building a swig Python module and encounter errors like:<\/p>\n<pre class=\"lang:python decode:true \">AttributeError: 'Foobar' object has no attribute 'this'<\/pre>\n<p>where Foobar is some class that is being wrapped, then you are encountering a swig-3.08 bug. \u00a0Unfortunately this is still the official package in Ubuntu 16.04. \u00a0You can vote for the issue <a href=\"https:\/\/bugs.launchpad.net\/ubuntu\/+source\/swig\/+bug\/1628974\">here<\/a>.<\/p>\n<p>Until the package is updated, one can download and manually install an updated swig package by following the following recipe:<\/p>\n<pre class=\"lang:sh decode:true \"># install prerequisite \r\nsudo apt-get install libpcre3-dev\r\n\r\n# download swig 3.0.12\r\nwget -O swig-3.0.12.tar.gz https:\/\/downloads.sourceforge.net\/project\/swig\/swig\/swig-3.0.12\/swig-3.0.12.tar.gz?r=https%3A%2F%2Fsourceforge.net%2Fprojects%2Fswig%2Ffiles%2Fswig%2Fswig-3.0.12%2Fswig-3.0.12.tar.gz%2Fdownload&amp;ts=1486782132&amp;use_mirror=superb-sea2\r\n\r\n# extract and configure\r\ntar xf swig-3.0.12.tar.gz\r\ncd swig-3.0.12\r\n.\/configure --prefix=\/usr\r\n\r\n# build\r\nmake -j 4\r\n\r\n# install\r\nsudo make install\r\n\r\n# check version reported\r\nswig -version\r\n\r\nSWIG Version 3.0.12\r\n\r\nCompiled with g++ [x86_64-pc-linux-gnu]\r\n\r\nConfigured options: +pcre\r\n\r\nPlease see http:\/\/www.swig.org for reporting bugs and further information\r\n<\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you&#8217;re building a swig Python module and encounter errors like: AttributeError: &#8216;Foobar&#8217; object has no attribute &#8216;this&#8217; where Foobar is some class that is being wrapped, then you are encountering a swig-3.08 bug. \u00a0Unfortunately this is still the official &hellip; <a href=\"https:\/\/weegreenblobbie.com\/?p=263\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9,7],"tags":[],"class_list":["post-263","post","type-post","status-publish","format-standard","hentry","category-computing","category-programming"],"_links":{"self":[{"href":"https:\/\/weegreenblobbie.com\/index.php?rest_route=\/wp\/v2\/posts\/263","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/weegreenblobbie.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/weegreenblobbie.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/weegreenblobbie.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/weegreenblobbie.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=263"}],"version-history":[{"count":2,"href":"https:\/\/weegreenblobbie.com\/index.php?rest_route=\/wp\/v2\/posts\/263\/revisions"}],"predecessor-version":[{"id":265,"href":"https:\/\/weegreenblobbie.com\/index.php?rest_route=\/wp\/v2\/posts\/263\/revisions\/265"}],"wp:attachment":[{"href":"https:\/\/weegreenblobbie.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=263"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/weegreenblobbie.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=263"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/weegreenblobbie.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=263"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}