Arduino on 64-bit Linux

UPDATE: The official release of Arduino now includes a 64-bit version, I suggest you use that one.

After bemoaning the lack of a 64-bit version of the last few Arduino releases, and the subsequent hoops that had to be followed to make the 32-bit version work in Ubuntu, I finally decided to get off of my laurels and just build the thing. You can get the package here, or build your own following the directions after the break.

Here is a brief outline of how to build the package. This basically comes down to building the rxtx library and avrdude program in the 64-bit environment, copying them into the arduino source tree, then building the Arduino library itself using the 64-bit environment.

Navigate to some directory that you like and pull version 16 of the Arduino source code from SVN:

svn checkout http://arduino.googlecode.com/svn/tags/0016 arduino-release-16

Grab the arduino-blessed version of avrdude and compile it:

wget http://www.arduino.cc/files/avrdude-5.4-arduino-src.tgz
tar -xf avrdude-5.4-arduino-src.tgz
cd avrdude-5-4-arduino
./configure
make

Among other things, this should create the files avrdude and avrdude.conf. Copy them into the arduino source tree, overwriting the 32-bit versions:

cp avrdude avrdude.conf ../arduino-release-16/build/linux/dist/tools/
cd ..

Next, grab the latest binary release of the rxtx library and extract the serial library from it. The latest version fixes a problem that caused the Serial Monitor function to crash the program. It would probably be better to build this from source, however I ran into a bunch of issues with it and this was easier.

wget http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip
unzip rxtx-2.2pre2-bins.zip
cp rxtx-2.2pre2-bins/x86_64-unknown-linux-gnu/librxtxSerial.so arduino-release-16/build/linux/dist/lib/
cp rxtx-2.2pre2-bins/RXTXcomm.jar arduino-release-16/build/shared/lib/

Now, all that remains is to build the Arduino distribution, which will create a nice tarball package:

cd arduino-release-16/build/linux/
./dist.sh
cp arduino-0016.tgz ../../../arduino-0016-linux-amd64.tgz
cd ../../../

Copy this wherever you would like and use like a regular Arduino package:

tar -xf arduino-0016-linux-amd64.tgz
cd arduino-0016
./arduino

Enjoy!

This entry was posted in tech. Bookmark the permalink.

13 Responses to Arduino on 64-bit Linux

  1. Nate says:

    Awesome! thanks for the effort — I look forward to giving this a go this weekend :)

    • mahto says:

      @Nate: Thanks! Sorry for the late reply, I just realized that I had messed up email notifications for comments. Let me know if you got it working!

  2. so, the build-process does not work for me.
    the package does….

    ERRORS
    Exception in thread “main” java.lang.NoClassDefFoundError: processing/app/Base
    Caused by: java.lang.ClassNotFoundException: processing.app.Base
    at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:323)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:268)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:336)
    Could not find the main class: processing.app.Base. Program will exit.

  3. mahto says:

    Hi Thomas,

    How are you running the arduino startup script? I get that message when I try to execute it from a different working directory then where it is located. Could this be the case?

  4. Roma says:

    I also got errors :(

    Exception in thread “main” java.lang.NoClassDefFoundError: processing/app/Base
    Caused by: java.lang.ClassNotFoundException: processing.app.Base
    at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)

  5. Richard Sharpe says:

    I am seeing the same problems as Thomas and Roma.

    • mahto says:

      Hi Richard, how are you running the Arduino script? Through the shell, or via the file manager? I think that only occurs if the working directory is incorrect. Let me know if it doesn’t work, it was the only way I could reproduce the error.

  6. Richard Sharpe says:

    @mahto

    cd /path/to/just/build/arduino/dir
    ./arduino

  7. Richard Sharpe says:

    I have a Vista laptop I can use to do Arduino work, but would like to get it running under Linux on my AMD64 laptop.

    What extra info can I provide to help track this down?

  8. spadger says:

    Just trying this to see if I can make it work with release 17 but having downloaded avrdude i see avrdude.conf but no avrdude file, there is avrdude.1, avrdude.h and avrdude.spec. Which one should I use? do I need to remove the extension? What am I doing wrong?

    Any help greatly appreciated

    Thanks

  9. Richard Sharpe says:

    Hmmm, no answers … Vista does the job it seems.

  10. Danno says:

    This was wonderful…thank you so much. Finally got the serial monitor to work! I am running Ubuntu 9.04 / amd64. Before today I could not run this sketch:

    * NewSerialServo
    * ————–
    * Servo control from the Serial port
    *
    * Alteration of the control interface to use keys
    * to slew the servo horn left and right. Works best with
    * the Linux/Mac terminal “screen” program.
    *
    * Created 10 December 2007
    * copyleft 2007 Brian D. Wendt
    * http://principialabs.com/
    *
    * Adapted from code by Tom Igoe
    * http://itp.nyu.edu/physcomp/Labs/Servo
    */
    etc., etc.

  11. James Hayward says:

    @Roma
    It took me a while too, but basically, it looks like you have installed and run Arduino-0017 before you realised it doesn’t work on AMD64 (me too!)

    The preferences in 17 are not compatible with 16, so you need to delete the .arduino folder in your home directory. Then re-run arduino16 you built with this tutorial – it will work!

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>