{"id":874,"date":"2012-03-07T12:52:08","date_gmt":"2012-03-07T17:52:08","guid":{"rendered":"http:\/\/abrammorphew.com\/notes\/?p=874"},"modified":"2012-03-07T12:56:50","modified_gmt":"2012-03-07T17:56:50","slug":"arduino-setting-up-a-gentoo-development-environment","status":"publish","type":"post","link":"http:\/\/abrammorphew.com\/notes\/2012\/03\/07\/arduino-setting-up-a-gentoo-development-environment\/","title":{"rendered":"ARDUINO: Setting up a Gentoo development environment&#8230;"},"content":{"rendered":"<p>if you&#8217;re reading this post, most likely you&#8217;re having issues with setting up Crossdev as mentioned on the arduino.cc site. i tried countless times to configure my system for AVR compiling that way, but it always failed compiling avr-libc and would never compile avr-g++ no matter how i applied the USE flags. in short, i had to manually compile the necessary environment and this article is so i don&#8217;t forget how that&#8217;s done. it seems there are only a smattering ink blot&#8217;s worth of people developing Arduino sketches under the Gentoo distribution, but this should work (in theory) for most any Linux distro out there since it&#8217;s all manual installation. if anyone happens to hit a snag during their installation, feel free to let me know. <\/p>\n<h3>Download the tool chain&#8230;<\/h3>\n<p>getting the right version is the key. some newer versions don&#8217;t play nice with ATMEL&#8217;s chips for whatever reason. <\/p>\n<p>1) BinUtils 2.20.1a: <a href=\"http:\/\/ftp.gnu.org\/gnu\/binutils\/binutils-2.20.1a.tar.bz2\" target=\"_blank\">http:\/\/ftp.gnu.org\/gnu\/binutils\/binutils-2.20.1a.tar.bz2<\/a><br \/>\n2) GCC 4.3.6: <a href=\"http:\/\/gcc.petsads.us\/releases\/gcc-4.3.6\/gcc-g++-4.3.6.tar.bz2\" target=\"_blank\">http:\/\/gcc.petsads.us\/releases\/gcc-4.3.6\/gcc-g++-4.3.6.tar.bz2<\/a><br \/>\n3) AVR LibC 1.7.1: <a href=\"http:\/\/download.savannah.gnu.org\/releases\/avr-libc\/avr-libc-1.7.1.tar.bz2\" target=\"_blank\">http:\/\/download.savannah.gnu.org\/releases\/avr-libc\/avr-libc-1.7.1.tar.bz2<\/a><\/p>\n<p>these are the versions that both myself and Jose Moldonado in Spain have been able to run without problems. <\/p>\n<h3>Additional downloads&#8230;<\/h3>\n<p>you&#8217;ll need AVRDuDe. i installed it from source just to be safe, though i think the portage install is just as good. <\/p>\n<p><a href=\"http:\/\/download.savannah.gnu.org\/releases\/avrdude\/avrdude-5.11.tar.gz\" target=\"_blank\">http:\/\/download.savannah.gnu.org\/releases\/avrdude\/avrdude-5.11.tar.gz<\/a><\/p>\n<h3>PREFIX and PATH<\/h3>\n<p>this is how my system is setup. <\/p>\n<pre class=\"brush:bash\">\r\n#PREFIX=\/usr\/i686-pc-linux-gnu\/avr\r\n#export PREFIX\r\n#PATH=$PATH:$PREFIX\/bin\r\n#export PATH\r\n<\/pre>\n<p>make sure to do this FIRST. not modifying the PREFIX variable could potentially hose the whole system. <\/p>\n<h3>Compiling&#8230;<\/h3>\n<p>then you can start compiling binutils:<\/p>\n<pre class=\"brush:bash\">\r\n# cd binutils-2.20.1a\r\n# mkdir obj-avr\r\n# cd obj-avr\r\n# ..\/configure --prefix=\/usr\/x86_64-pc-linux-gnu\/avr --target=avr --disable-nls\r\n# make\r\n# make install\r\n<\/pre>\n<p>then onto gcc&#8230;<\/p>\n<pre class=\"brush:bash\">\r\n# cd gcc-4.3.6\r\n# mkdir obj-avr\r\n# cd obj-avr\r\n# ..\/configure --prefix=\/usr\/x86_64-pc-linux-gnu\/avr --target=avr --enable-languages=c,c++ --disable-nls --disable-libssp --with-dwarf2\r\n# make\r\n# make install\r\n<\/pre>\n<p>then avr-libc&#8230;<\/p>\n<pre class=\"brush:bash\">\r\n# cd avr-libc-1.7.1\r\n# .\/configure --prefix=\/usr\/x86_64-pc-linux-gnu\/avr --build=x86_64-pc-linux-gnu --host=avr\r\n# make\r\n# make install\r\n<\/pre>\n<h3>Symlinking your libs and includes&#8230;<\/h3>\n<p>now on my system, there was a \/usr\/avr folder that the Arduino IDE definitely looks in for the includes and additional libraries. i had to symlink two folders in order for the IDE to work. <\/p>\n<pre class=\"brush:bash\">\r\n# ln -s \/usr\/i686-pc-linux-gnu\/avr\/avr\/include \/usr\/avr\/include\r\n# ln -s \/usr\/i686-pc-linux-gnu\/avr\/avr\/lib \/usr\/avr\/lib\r\n<\/pre>\n<p>\n&#8230;and that was that. the latest Arduino IDE ran without a hitch.<\/p>\n<p>for more detailed information, go here: <a href=\"http:\/\/www.nongnu.org\/avr-libc\/user-manual\/install_tools.html\" target=\"_blank\">http:\/\/www.nongnu.org\/avr-libc\/user-manual\/install_tools.html<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>if you&#8217;re reading this post, most likely you&#8217;re having issues with setting up Crossdev as mentioned on the arduino.cc site. i tried countless times to configure my system for AVR compiling that way, but it always failed compiling avr-libc and would never compile avr-g++ no matter how i applied the USE flags. in short, i [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[102,103,143,116,145,141,140,142,84,144],"class_list":["post-874","post","type-post","status-publish","format-standard","hentry","category-notes","tag-arduino","tag-atmega328","tag-atmel","tag-avr","tag-chain","tag-crossdev","tag-development","tag-emerge","tag-gentoo","tag-tool"],"_links":{"self":[{"href":"http:\/\/abrammorphew.com\/notes\/wp-json\/wp\/v2\/posts\/874","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/abrammorphew.com\/notes\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/abrammorphew.com\/notes\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/abrammorphew.com\/notes\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/abrammorphew.com\/notes\/wp-json\/wp\/v2\/comments?post=874"}],"version-history":[{"count":4,"href":"http:\/\/abrammorphew.com\/notes\/wp-json\/wp\/v2\/posts\/874\/revisions"}],"predecessor-version":[{"id":878,"href":"http:\/\/abrammorphew.com\/notes\/wp-json\/wp\/v2\/posts\/874\/revisions\/878"}],"wp:attachment":[{"href":"http:\/\/abrammorphew.com\/notes\/wp-json\/wp\/v2\/media?parent=874"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/abrammorphew.com\/notes\/wp-json\/wp\/v2\/categories?post=874"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/abrammorphew.com\/notes\/wp-json\/wp\/v2\/tags?post=874"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}