Pages: [1] 2   Go Down
Author Topic: arduino svn compile bug  (Read 4858 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 12
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

When attempting to compile on 64 gentoo with the lastest of all deps built locally I get errors from the make.sh script.  It errors due to deprecation issues.  It advises to add -Xlint:deprecation to the build command

editing the make.sh to add that i get the following

 ~/arduino-svn/build/linux $ sudo ./make.sh
Copying shared and core files...
Copying examples...
Copying dist files...
Building the PDE...
tools/DiscourseFormat.java:6: warning: unmappable character for encoding ASCII
  Copyright (c) 2005-06 Ignacio Manuel Gonz?lez Moreta
                                           ^
../core/PGraphics.java:2296: warning: [deprecation] getFontMetrics(java.awt.Font) in java.awt.Toolkit has been deprecated
          Toolkit.getDefaultToolkit().getFontMetrics(textFontNative);
                                     ^
tools/Archiver.java:105: warning: [deprecation] show() in java.awt.Dialog has been deprecated
    fd.show();
      ^
Editor.java:1083: warning: [deprecation] show() in java.awt.Window has been deprecated
          find.show();
              ^
Editor.java:1235: warning: [deprecation] show() in java.awt.Window has been deprecated
    window.show();
          ^
Editor.java:1640: warning: [deprecation] show() in java.awt.Dialog has been deprecated
        dialog.show();
              ^
Sketch.java:816: warning: [deprecation] show() in java.awt.Dialog has been deprecated
    fd.show();
      ^
Sketch.java:954: warning: [deprecation] show() in java.awt.Dialog has been deprecated
    fd.show();
      ^
syntax/JEditTextArea.java:164: warning: [deprecation] isManagingFocus() in javax.swing.JComponent has been deprecated
  public final boolean isManagingFocus()
                       ^
Sketchbook.java:179: warning: [deprecation] show() in java.awt.Dialog has been deprecated
      fd.show();
        ^
Sketchbook.java:328: warning: [deprecation] show() in java.awt.Dialog has been deprecated
    fd.show();
      ^
FindReplace.java:228: warning: [deprecation] hide() in java.awt.Window has been deprecated
    hide();
    ^
syntax/TextAreaPainter.java:77: warning: [deprecation] isManagingFocus() in javax.swing.JComponent has been deprecated
  public final boolean isManagingFocus()
                       ^
syntax/TextAreaPainter.java:360: warning: [deprecation] getFontMetrics(java.awt.Font) in java.awt.Toolkit has been deprecated
    fm = Toolkit.getDefaultToolkit().getFontMetrics(font);
                                    ^
syntax/SyntaxStyle.java:102: warning: [deprecation] getFontMetrics(java.awt.Font) in java.awt.Toolkit has been deprecated
    fontMetrics = Toolkit.getDefaultToolkit().getFontMetrics(
                                             ^
Base.java:158: warning: [deprecation] show() in java.awt.Window has been deprecated
    editor.show();
          ^
Base.java:545: warning: [deprecation] show() in java.awt.Dialog has been deprecated
      fd.show();
        ^
Preferences.java:547: warning: [deprecation] show() in java.awt.Window has been deprecated
    dialog.show();
          ^
RunnerClassLoader.java:89: warning: [deprecation] toURL() in java.io.File has been deprecated
        return searchResource.toURL();
                             ^
19 warnings

Done.

I would've filed it on a bug tracker but i couldn't find one.
« Last Edit: February 03, 2008, 08:14:56 pm by johnm1019 » Logged

Forum Administrator
Cambridge, MA
Offline Offline
Faraday Member
*****
Karma: 12
Posts: 3538
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Those all look like warnings.  It'd be better if they weren't there, but they shouldn't cause a problem.  Did you have other errors in the build process?  Did the application run?
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 12
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I get
$ ./run.sh

(<unknown>:1321): Gtk-WARNING **: Attempting to add a widget with type GtkButton to a GtkComboBoxEntry (need an instance of GtkEntry or of a subclass)

(<unknown>:1321): Gtk-CRITICAL **: gtk_widget_realize: assertion `GTK_WIDGET_ANCHORED (widget) || GTK_IS_INVISIBLE (widget)' failed

(<unknown>:1321): Gtk-CRITICAL **: gtk_paint_box: assertion `style->depth == gdk_drawable_get_depth (window)' failed

(<unknown>:1321): Gtk-CRITICAL **: gtk_paint_box: assertion `style->depth == gdk_drawable_get_depth (window)' failed

(<unknown>:1321): Gtk-CRITICAL **: gtk_paint_box: assertion `style->depth == gdk_drawable_get_depth (window)' failed

(<unknown>:1321): Gtk-CRITICAL **: gtk_paint_box: assertion `style->depth == gdk_drawable_get_depth (window)' failed
java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver
Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path
      at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1682)
      at java.lang.Runtime.loadLibrary0(Runtime.java:823)
      at java.lang.System.loadLibrary(System.java:1030)
      at gnu.io.CommPortIdentifier.<clinit>(CommPortIdentifier.java:83)
      at processing.app.Editor.populateSerialMenu(Editor.java:903)
      at processing.app.Editor.buildToolsMenu(Editor.java:800)
      at processing.app.Editor.<init>(Editor.java:190)
      at processing.app.Base.<init>(Base.java:149)
      at processing.app.Base.main(Base.java:104)


The GTK errors occur while loading the dialog that asks me to pick my sketch directory.

After I do that, and press ok, nothing comes up and the error about the linker comes up smiley-sad

It should be noted that this is after I deleted librxtxSerial.so.

If svn-update which restores the file, rm -rf work and then rebuild it and re-run it i get another error

$ ./run.sh

(<unknown>:1492): Gtk-WARNING **: Attempting to add a widget with type GtkButton to a GtkComboBoxEntry (need an instance of GtkEntry or of a subclass)

(<unknown>:1492): Gtk-CRITICAL **: gtk_widget_realize: assertion `GTK_WIDGET_ANCHORED (widget) || GTK_IS_INVISIBLE (widget)' failed

(<unknown>:1492): Gtk-CRITICAL **: gtk_paint_box: assertion `style->depth == gdk_drawable_get_depth (window)' failed

(<unknown>:1492): Gtk-CRITICAL **: gtk_paint_box: assertion `style->depth == gdk_drawable_get_depth (window)' failed

(<unknown>:1492): Gtk-CRITICAL **: gtk_paint_box: assertion `style->depth == gdk_drawable_get_depth (window)' failed

(<unknown>:1492): Gtk-CRITICAL **: gtk_paint_box: assertion `style->depth == gdk_drawable_get_depth (window)' failed

(<unknown>:1492): Gtk-CRITICAL **: gtk_paint_box: assertion `style->depth == gdk_drawable_get_depth (window)' failed

(<unknown>:1492): Gtk-CRITICAL **: gtk_paint_box: assertion `style->depth == gdk_drawable_get_depth (window)' failed
java.lang.UnsatisfiedLinkError: /home/jm/arduino-svn/build/linux/work/lib/librxtxSerial.so: /home/jm/arduino-svn/build/linux/work/lib/librxtxSerial.so: wrong ELF class: ELFCLASS32 (Possible cause: architecture word width mismatch) thrown while loading gnu.io.RXTXCommDriver
Exception in thread "main" java.lang.UnsatisfiedLinkError: /home/jm/arduino-svn/build/linux/work/lib/librxtxSerial.so: /home/jm/arduino-svn/build/linux/work/lib/librxtxSerial.so: wrong ELF class: ELFCLASS32 (Possible cause: architecture word width mismatch)
      at java.lang.ClassLoader$NativeLibrary.load(Native Method)
      at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751)
      at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1676)
      at java.lang.Runtime.loadLibrary0(Runtime.java:823)
      at java.lang.System.loadLibrary(System.java:1030)
      at gnu.io.CommPortIdentifier.<clinit>(CommPortIdentifier.java:83)
      at processing.app.Editor.populateSerialMenu(Editor.java:903)
      at processing.app.Editor.buildToolsMenu(Editor.java:800)
      at processing.app.Editor.<init>(Editor.java:190)
      at processing.app.Base.<init>(Base.java:149)
      at processing.app.Base.main(Base.java:104)
« Last Edit: February 03, 2008, 10:21:50 pm by johnm1019 » Logged

Forum Administrator
Cambridge, MA
Offline Offline
Faraday Member
*****
Karma: 12
Posts: 3538
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

You need a version of RXTX that's compiled for your system, and you need to put it in place of the librxtxSerial.so that's in the source tree.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 12
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

ahh ok.

So i will delete the rxtx that comes with it and replace it with the one found locally on my system after compile, THEN compile arduino.

thanks!
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 12
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm getting very close!

So im summary to get this built and running on a 64-bit gentoo system do the following

Build your own version of RXTX.
then either symlink or cp your local version of librxtxSerial.so to /path/to/arduino-svn/build/linux/dist/lib
#updatedb
#locate librxtxSerial.so
$cp /local/path/librxtxSerial.so /arduino-svn/build/linux/dist/lib/.

Then deal with AVRDUDE, which will take care of 64 bit libusb issues.
so compile avrdude for your own system.

then locate your avrdude binary path locally
then cp /local/avrdude to arduino-svn/build/linux/dist/tools/.


now go to /arduino-sv/build/linux/ and rm -rf work, then ./make.sh

NOW we have to symlink the ldscripts libray
cd into work
ln -s /usr/lib64(NOTE THE 64HERE)/binutils/2.18/ldscripts/

now ./arduino and it'll run.

Things I still need to figure out.

BUG I NEED HELP WITH:
When uploading firmware I get that the device signature doesn't match.  This is because arduino uses another method of determining this with a patch source which I could've used to compile avrdude locally.  I chose portage since that'll keep it up to date and line with gentoo config's.....
That being said, I can also add the "-F" flag to ignore this.  Now, where in the arduino-gui source do I add that flag?  Where is that command actually called from?   This way I can use the button on the GUI.

2. My sketchbook directory is NOT saved upon exiting the program.

JM
Logged

Forum Administrator
Cambridge, MA
Offline Offline
Faraday Member
*****
Karma: 12
Posts: 3538
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

1. app/AvrdudeUploader.java

2. what's not saved?  the preference that indicates the location of the sketchbook directory?  or the contents of the directory?
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 12
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

K. Got it working

I edited app/AvrdudeUploader.java and added in the last function right before the commandDownloader.addAll
commandDownloader.Add("-F");

Now this will force uploading even for an improper ident which I would imagine could do bad things if you don't have the proper board hooked up.

The preference saving issues went away once I changed that.... very weird..... but good smiley

I will write up another post that can be appended to the gentoo guide.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 12
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

First, follow the Arduino on Gentoo guide. Down to the part where it tells you to download and un-tar the arduino software archive.  We are going to take it from there.
First checkout the latest version
svn checkout http://arduino-svn-repo/trunk/latest/ /path/to/where/u/want/arduino-svn

Now we need to recompile some lib's of our own.

Start by compiling rxtx and avrdude for your system
You'll need to add dev-embedded/uisp and dev-embedded/avrdude to your /etc/portage/package.keywords since they are keyword masked for some arches (namely amd64)
#emerge -vp rxtx avrdude
and if your happy
#emerge -v rxtx avrdude

Now we need to hook those into the arduino build.
So as root
#updatedb

Now locate librxtxSerial.so and the avrdude binary file.
locate librxtxSerial.so
locate avrdude
Note those path's.

Now either copy or symlink those files into the build system
$ln -s /local/path/librxtxSerial.so /path/to/arduino-svn/build/linux/dist/lib/librxtxSerial.so
$ln -s /local/path/to/avrdude to /path/to/arduino-svn/build/linux/dist/tools/avrdude

Lastly we need to edit the file
nano /path/to/arduino-svn/app/AvrdudeUploader.java
and before the line
"commandDownloader.addAll(params);" [which for me appears at line 152]
add
//add a -F flag
commandDownloader.add("-F");
What this does is force the uploader to go even though the device signature won't be correct.  Arduino provides a patched version of avrdude so you dont need to do this (safer) but this would require downloading and compiling that separately and I prefer to use portage for everything since that is the reason i use gentoo in the first place.

Build Time!
Now cd /path/to/arduino-svn/build/linux/. and clear the work directory out if anything is there rm -rf work.
Now build it ./make.sh

Now cd work
And we need to add the ldscripts reference, which is mentioned in the gentoo guide (but we didn't do since it was past the cut off point smiley)
Your version of avr-binutils MAY be something other than 2.18, most likely it'll be the only entry in there so you can just tab complete it.
ln -s /usr/lib64(NOTE THE 64 HERE)/binutils/avr/2.18/ldscripts/ /path/to/arduino-svn/build/linux/work/ldscripts

now if you aren't already there
cd /path/to/arduino-svn/build/linux/work/.

and you should be able to ./arduino and it should work.

 Now you need to go back to the Arduino Gentoo guide and finish getting the hardware setup in the kernel.  Pick backup where it says
"The next step is to get the USB to serial adapter working. "
and follow it the rest of the way from there.


Happy Gentoo'ing! smiley
JM
« Last Edit: October 22, 2011, 06:51:23 am by johnm1019 » Logged

Forum Administrator
Cambridge, MA
Offline Offline
Faraday Member
*****
Karma: 12
Posts: 3538
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

BTW, if you compile the Arduino version of avrdude, you shouldn't need to actually build the Arduino distribution - just replace the RXTX with a 64 bit version.  (Most of the code is Java, so it should run fine on 64-bit systems.)
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 12
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
BTW, if you compile the Arduino version of avrdude, you shouldn't need to actually build the Arduino distribution - just replace the RXTX with a 64 bit version.  (Most of the code is Java, so it should run fine on 64-bit systems.)

Cool smiley

It would be awesome if the dev's could throw together an ebuild for this and get it in portage  8-)
Logged

0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 86
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

ahh it would be great, i can't get arduino-0012 working, but only 0009.
I'll try this guide tonight and let's see.
Logged

0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 86
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

ok, i got it working my default 0011 installation.
All i did was downloading arduino-svn and compiling with the -F param patch.
Then copied pde.jar to my 0011 lib directory and that's all.

 ;D
Logged

0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 70
Slowly Developing
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm having trouble getting this to work on my system. I've followed the instructions to the letter.

running
Code:
crossdev -t avr -s4
returns
Code:
--------------------------------------------------------------------------------
 * Host Portage ARCH:     amd64
 * Target Portage ARCH:   *
 * Target System:         avr
 * Stage:                 4 (C/C++ compiler)

 * binutils:              binutils-[latest]
 * gcc:                   gcc-[latest]
 * libc:                  avr-libc-[latest]

 * PORTDIR_OVERLAY:       /usr/portage
 * PORT_LOGDIR:           /var/log/portage
 * PKGDIR:                /usr/portage/packages/cross/avr
 * PORTAGE_TMPDIR:        /var/tmp/cross/avr
  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  
 * Using sys-devel/binutils from /usr/portage instead of /usr/portage
 * Using sys-devel/gcc from /usr/portage instead of /usr/portage
 * Using dev-embedded/avr-libc from /usr/portage instead of /usr/portage
 * Using sys-devel/gdb from /usr/portage instead of /usr/portage
 * Using dev-util/insight from /usr/portage instead of /usr/portage
 * Forcing the latest versions of {binutils,gcc}-config/gnuconfig ...     [ ok ]
 * Log: /var/log/portage/cross-avr-binutils.log
 * Emerging cross-binutils ...                                            [ ok ]
 * Log: /var/log/portage/cross-avr-avr-libc-headers.log
 * Emerging cross-avr-libc-headers ...

 * avr-libc failed :(
 * If you file a bug, please attach the following logfiles:
 * /var/log/portage/cross-avr-info.log
 * /var/log/portage/cross-avr-avr-libc-headers.log

The log files, as noted read:
Code:
/var/log/portage/cross-avr-info.log

>>> Auto-cleaning packages...

>>> No outdated packages were found on your system.

Code:
/var/log/portage/cross-avr-avr-libc-headers.log

>>> Verifying ebuild Manifests...

>>> Emerging (1 of 1) cross-avr/avr-libc-1.6.2 to /
 * avr-libc-1.6.2.tar.bz2 RMD160 SHA1 SHA256 size ;-) ...                 [ ok ]
 * avr-libc-manpages-1.6.2.tar.bz2 RMD160 SHA1 SHA256 size ;-) ...        [ ok ]
 * checking ebuild checksums ;-) ...                                      [ ok ]
 * checking auxfile checksums ;-) ...                                     [ ok ]
 * checking miscfile checksums ;-) ...                                    [ ok ]
 * checking avr-libc-1.6.2.tar.bz2 ;-) ...                                [ ok ]
 * checking avr-libc-manpages-1.6.2.tar.bz2 ;-) ...                       [ ok ]
 * Checking for avr-gcc ...
  [ !! ]
 *
 * Failed to locate 'avr-gcc' in $PATH. You can install an AVR toolchain using:
 *   $ crossdev -t avr
 *
 *
 * ERROR: cross-avr/avr-libc-1.6.2 failed.
 * Call stack:
 *               ebuild.sh, line   49:  Called pkg_setup
 *   avr-libc-1.6.2.ebuild, line   40:  Called die
 * The specific snippet of code:
 *               die "AVR toolchain not found"
 *  The die message:
 *   AVR toolchain not found
 *
 * If you need support, post the topmost build error, and the call stack if relevant.
 * A complete build log is located at '/var/tmp/cross/avr/portage/cross-avr/avr-libc-1.6.2/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/cross/avr/portage/cross-avr/avr-libc-1.6.2/temp/die.env'.
 * This ebuild used the following eclasses from overlays:
 *   /usr/portage/eclass/flag-o-matic.eclass
 *   /usr/portage/eclass/eutils.eclass
 *   /usr/portage/eclass/multilib.eclass
 *   /usr/portage/eclass/toolchain-funcs.eclass
 *   /usr/portage/eclass/portability.eclass
 *

 * Messages for package cross-avr/avr-libc-1.6.2:

 *
 * Failed to locate 'avr-gcc' in $PATH. You can install an AVR toolchain using:
 *   $ crossdev -t avr
 *
 *
 * ERROR: cross-avr/avr-libc-1.6.2 failed.
 * Call stack:
 *               ebuild.sh, line   49:  Called pkg_setup
 *   avr-libc-1.6.2.ebuild, line   40:  Called die
 * The specific snippet of code:
 *               die "AVR toolchain not found"
 *  The die message:
 *   AVR toolchain not found
 *
 * If you need support, post the topmost build error, and the call stack if relevant.
 * A complete build log is located at '/var/tmp/cross/avr/portage/cross-avr/avr-libc-1.6.2/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/cross/avr/portage/cross-avr/avr-libc-1.6.2/temp/die.env'.
 * This ebuild used the following eclasses from overlays:
 *   /usr/portage/eclass/flag-o-matic.eclass
 *   /usr/portage/eclass/eutils.eclass
 *   /usr/portage/eclass/multilib.eclass
 *   /usr/portage/eclass/toolchain-funcs.eclass
 *   /usr/portage/eclass/portability.eclass
 *

It looks like a recursive error...it says it needs the avr toolchain, and to use crossdev to build it....but that's what I'm doing, isn't it?

Also, checking out the svn repo is proving troublesome. Is it always incredibly slow?
Logged


Forum Administrator
Cambridge, MA
Offline Offline
Faraday Member
*****
Karma: 12
Posts: 3538
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

If you're having trouble installing avr-libc on your distribution, I'd look for support from the package maintainer.  I don't know anything about it.  

The repository does unfortunately have a few very large files in it, so it takes a while to check out.  If you're only interested in running Arduino, you should be able to just download the Linux version from the software page.
Logged

Pages: [1] 2   Go Up
Jump to: