You are not logged in.

#1 2013-10-26 22:48:35

kircul
Member
Registered: 2013-10-26
Posts: 9

Cannot compile arduino project

Hi guys,

I'm trying to work with arduino IDE, but I cannot compile even Blink example. I'm always seeing following error:

/usr/share/arduino/hardware/tools/avr/bin/../lib/gcc/avr/4.3.2/../../../avr/bin/ld: cannot find -lm

Any ideas how I can fix it?

Offline

#2 2013-10-26 23:25:24

gonX
Member
From: Denmark
Registered: 2009-08-16
Posts: 108

Re: Cannot compile arduino project

Where are you seeing this? Through the arduino PKGBUILD from aur?


since 2009

Offline

#3 2013-10-27 00:33:19

kircul
Member
Registered: 2013-10-26
Posts: 9

Re: Cannot compile arduino project

Yes, arduino. I also tried to install arduino-git and arduino-beta, result is the same.

Offline

#4 2013-10-27 11:28:00

bdalenoord
Member
Registered: 2012-06-14
Posts: 25

Re: Cannot compile arduino project

This is exactly what I've experienced...

It seems that the compilation of avr-gcc was not done correctly. As avr-gcc comes precompiled as a dependency of arduino, this is (if I'm correct) a packaging error. I've filed a bug-report to see if any maintainer has to say something about this...

Offline

#5 2013-10-27 18:20:37

marius
Member
Registered: 2010-06-03
Posts: 7

Re: Cannot compile arduino project

I'm also experiencing the exact same issue hmm

Offline

#6 2013-10-27 18:21:41

yuvadm
Member
From: Tel Aviv-Jaffa, Israel
Registered: 2012-08-08
Posts: 69
Website

Re: Cannot compile arduino project

Bump. Same issue. I just installed it now and I thought I was nuts.

Looks like a bug introduced in the latest avr-gcc update from Oct 17. Trying to downgrade back to 4.8.0, but not finding it on any of the mirrors hmm

Last edited by yuvadm (2013-10-27 18:33:43)

Offline

#7 2013-10-27 19:46:34

bdalenoord
Member
Registered: 2012-06-14
Posts: 25

Re: Cannot compile arduino project

My bug-report was 'rejected' as it seems to be a bug in the arduino-package

avr-gcc (a customized version at least) is shipped with the IDE, as can be found by the error line:

   /usr/share/arduino/hardware/tools/avr/bin/../lib/gcc/avr/4.3.2/../../../avr/bin/ld

This path evaluates to '/usr/share/arduino/hardware/tools/avr/lib/avr/bin/ld'... I've added a comment to the AUR now, so lets see what's the comment on that...

Offline

#8 2013-10-27 20:06:50

kircul
Member
Registered: 2013-10-26
Posts: 9

Re: Cannot compile arduino project

yuvadm wrote:

Bump. Same issue. I just installed it now and I thought I was nuts.

Looks like a bug introduced in the latest avr-gcc update from Oct 17. Trying to downgrade back to 4.8.0, but not finding it on any of the mirrors hmm

I already tried. Unfortunately unsuccessful sad

Offline

#9 2013-10-27 20:27:53

yuvadm
Member
From: Tel Aviv-Jaffa, Israel
Registered: 2012-08-08
Posts: 69
Website

Re: Cannot compile arduino project

kircul wrote:

I already tried. Unfortunately unsuccessful sad

Yeah I just noticed arduino brings its own avr toolchain.

EDIT: funny, same exact arduino setup (same versions) works on my desktop, but still spitting errors on my laptop. Trying to find any discrepancies between the two.

Last edited by yuvadm (2013-10-27 22:33:32)

Offline

#10 2013-10-29 18:34:54

lucasaad
Member
Registered: 2013-10-29
Posts: 1

Re: Cannot compile arduino project

Same issue here

Offline

#11 2013-10-30 17:18:20

kircul
Member
Registered: 2013-10-26
Posts: 9

Re: Cannot compile arduino project

Solution was found in discussion in package arduino.

In short words:

  • You need to install package avr-gcc

  • Replace build-in avr-gcc compiler by same from package installed on previous step:

    # cd /usr/share/arduino/hardware/tools/avr/bin
    # mv ./avr-gcc ./avr-gcc-backup
    # ln -s /usr/bin/avr-gcc ./

It works for me.

Offline

#12 2013-10-31 21:27:29

bdalenoord
Member
Registered: 2012-06-14
Posts: 25

Re: Cannot compile arduino project

Well, it works for now... I got warned by another developer for the native arduino library support though. I'm not able to test it right now, but thanks so far! big_smile

Edit: Sadly, my concerns were grounded. I am unable to compile anything with custom libraries... I'll have to wait with Arduino until an update is coming out...

Last edited by bdalenoord (2013-11-03 13:11:12)

Offline

#13 2013-11-19 16:55:31

CoolGenie
Member
Registered: 2008-04-06
Posts: 51

Re: Cannot compile arduino project

This works for me too. Thanks! smile

kircul wrote:

Solution was found in discussion in package arduino.

In short words:

  • You need to install package avr-gcc

  • Replace build-in avr-gcc compiler by same from package installed on previous step:

    # cd /usr/share/arduino/hardware/tools/avr/bin
    # mv ./avr-gcc ./avr-gcc-backup
    # ln -s /usr/bin/avr-gcc ./

It works for me.

Offline

#14 2013-11-23 04:30:02

WaxyMouthfeel
Member
Registered: 2009-04-03
Posts: 3

Re: Cannot compile arduino project

If you're into absolutely broken and stupid hacks, it looks like the compiler fails only on linking.   So I'm calling the arduino avr-gcc until I see an "-lm", then I hand it to the Arch Linux one.

Like so:

#!/usr/bin/perl

$is_lm = 0;

if (grep(/\-lm/, @ARGV)) { $is_lm = 1; }

if ($is_lm == 0) {
        print STDERR "switch: ARDUINO\n";
        exec('/usr/share/arduino/hardware/tools/avr/bin/orig.avr-gcc', @ARGV);

} else {
        print STDERR "switch: ARCH\n";
        exec('/usr/bin/avr-gcc', @ARGV);
}

Offline

#15 2013-12-11 14:35:33

Guybrush747
Member
Registered: 2013-07-17
Posts: 2

Re: Cannot compile arduino project

Worked also for my Asus laptop!


CoolGenie wrote:

This works for me too. Thanks! smile

kircul wrote:

Solution was found in discussion in package arduino.

In short words:

  • You need to install package avr-gcc

  • Replace build-in avr-gcc compiler by same from package installed on previous step:

    # cd /usr/share/arduino/hardware/tools/avr/bin
    # mv ./avr-gcc ./avr-gcc-backup
    # ln -s /usr/bin/avr-gcc ./

It works for me.

Offline

#16 2014-10-04 05:23:27

prakharsingh95
Member
From: Roorkee
Registered: 2014-10-02
Posts: 33

Re: Cannot compile arduino project

kircul wrote:

Solution was found in discussion in package arduino.

In short words:

  • You need to install package avr-gcc

  • Replace build-in avr-gcc compiler by same from package installed on previous step:

    # cd /usr/share/arduino/hardware/tools/avr/bin
    # mv ./avr-gcc ./avr-gcc-backup
    # ln -s /usr/bin/avr-gcc ./

It works for me.

Thanks man. This bug is still present in arduino-beta from AUR.


A person who never made a mistake never tried anything new.

Offline

#17 2014-10-10 14:23:37

eliot.lim
Member
Registered: 2014-09-02
Posts: 2

Re: Cannot compile arduino project

Thanks man. This bug is still present in arduino-beta from AUR.

Can confirm that the issue is not present in the arduino package from AUR, but exists with the arduino-beta package also from AUR.

Offline

Board footer

Powered by FluxBB