Installing the arduino software on Fedora 15

I had a relatively smooth time setting up the arduino software under fedora 14, so I thought it would be easy with the more recent versions of arduino and the avr tools on fedora 15. Boy, was I wrong. The first step was easy:
yum install arduino
This brings in the necessary packages including avr-gcc and such. Then when I try to run arduino (by typing arduino at the command line), I get a bunch of java sniveling. I can hardly begin to tell you how much I dislike java, it always makes my life difficult:
cannot initialize Look and Feel: com.sun.java.swing.plaf.gtk.GTKLookAndFeel
error: java.lang.ClassNotFoundException: com.sun.java.swing.plaf.gtk.GTKLookAndFeel not found in gnu.gcj.runtime.SystemClassLoader{urls=[file:/usr/share/java/ecj.jar,file:/usr/share/java/jna.jar,file:/usr/share/java/RXTXcomm.jar,file:./,file:/usr/share/arduino/core.jar,file:/usr/share/arduino/pde.jar], parent=gnu.gcj.runtime.ExtensionClassLoader{urls=[], parent=null}}
java.lang.ClassNotFoundException: com.sun.java.swing.plaf.gtk.GTKLookAndFeel not found in gnu.gcj.runtime.SystemClassLoader{urls=[file:/usr/share/java/ecj.jar,file:/usr/share/java/jna.jar,file:/usr/share/java/RXTXcomm.jar,file:./,file:/usr/share/arduino/core.jar,file:/usr/share/arduino/pde.jar], parent=gnu.gcj.runtime.ExtensionClassLoader{urls=[], parent=null}}
   at java.net.URLClassLoader.findClass(libgcj.so.12)
   at java.lang.ClassLoader.loadClass(libgcj.so.12)
   at java.lang.ClassLoader.loadClass(libgcj.so.12)
   at java.lang.Class.forName(libgcj.so.12)

I do a yum list | grep java to get some clue about what java I have installed:

java-1.5.0-gcj.x86_64                    1.5.0.0-35.fc15                @fedora 
java-1.5.0-gcj-devel.x86_64              1.5.0.0-35.fc15                @fedora 
java-1.5.0-gcj-javadoc.x86_64            1.5.0.0-35.fc15                @fedora 
java-1.6.0-openjdk.x86_64                1:1.6.0.0-59.1.10.3.fc15       @updates
java_cup.noarch                          1:0.11a-6.fc15                 @fedora 
I get a bad feeling about having "gcj" of version 1.5.0 alongside openjdk 1.6.0, so I try to yum erase it. It wants to take arduino along with it, so I don't. The "sun.java" paths in the error traceback above make me suspect that I would be better off with sun java.

I use the alternatives utility to try to find out which java I am set up to use (of the two I have installed). I type the command: alternatives --config java

There are 2 programs which provide 'java'.

  Selection    Command
  -----------------------------------------------
     1           /usr/lib/jvm/jre-1.5.0-gcj/bin/java
  *+ 2           /usr/lib/jvm/jre-1.6.0-openjdk.x86_64/bin/java
This is the usual arduino -- java hell scenario. If nothing else, I guess this indicates that arduino and openjdk don't play nice together. Maybe it would be better with "gcj" (gomer's crummy java?). So many javas to choose from, and they all suck.

OK, after a good nights sleep, I am ready to have at it again. I could try gcj - and the dependency in the RPM on gcj sort of encourages this, but I decide to go the whole hog and install the latest sun(oracle) java jdk. See my notes on installing java on my fedora system. In particular, it takes more than whacking in the RPM.

After this, the arduino GUI starts nicely and asks me where I want to put my sketches. Then when I try to upload a demo, it blows up with errors like this:

In file included from /usr/share/arduino/hardware/arduino/cores/arduino/Tone.cpp:37:0:
/usr/share/arduino/hardware/arduino/cores/arduino/pins_arduino.h:66:48: error: variable 'port_to_mode_PGM' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
/usr/share/arduino/hardware/arduino/cores/arduino/pins_arduino.h:67:49: error: variable 'port_to_input_PGM' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
/usr/share/arduino/hardware/arduino/cores/arduino/pins_arduino.h:68:50: error: variable 'port_to_output_PGM' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
/usr/share/arduino/hardware/arduino/cores/arduino/pins_arduino.h:70:54: error: variable 'digital_pin_to_port_PGM' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
/usr/share/arduino/hardware/arduino/cores/arduino/pins_arduino.h:72:58: error: variable 'digital_pin_to_bit_mask_PGM' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
/usr/share/arduino/hardware/arduino/cores/arduino/pins_arduino.h:73:55: error: variable 'digital_pin_to_timer_PGM' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
/usr/share/arduino/hardware/arduino/cores/arduino/Tone.cpp:108:45: error: variable 'tone_pin_to_timer_PGM' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
Looks like Arduino-0022 shipped with some broken header files. Actually, it would seem that this cropped up when the avr-gcc compiler did an upgrade from 4.5.3 to 4.6.1 -- the recommendation is to do
yum downgrade avr-gcc avr-gcc-c++
This is predicted to be fixed in avr-gcc 4.7, see this rather nasty thread. The choice is to either downgrade to the previous version of the compiler, or build a new version for yourself. I chose to down the downgrade and put up with the compiler bugs in the 4.5.3 compiler that I already know about.

Arduino starts with the messages:

Error parsing gtk-icon-sizes string: ''
WARNING:  RXTX Version mismatch
    Jar version = RXTX-2.2
    native lib Version = RXTX-2.2pre2
I am getting used to seeing the RXTX mismatch messages. The "Error parsing" message is new, but the GUI seems to run.

And it now seems to upload the blink demo, but I get the all too familiar avrdude: stk500_recv(): programmer is not responding error after the upload seems to work.

On a hunch (having watched the messages via dmesg when I plug in my arduino) I get rid of gpsd (via service gpsd stop and yum erase gpsd). Now things are good, I can compile and upload the blink demo (after modifying it to get around the compiler bug I know about).


Feedback? Questions? Drop me a line!

Tom's Computer Info / tom@mmto.org