Go Down

Topic: "cannot find -lm" while compile/upload (Read 1 time) previous topic - next topic

Hans891


Hi!

I've recently bought an Arduino starter kit with an Arduino UNO in it. Unpacked and installed IDE and everything was working perfectly. That was a few weeks ago.

But today when I'm trying to compile or upload any code I get a set of errors. It's not code related as I get the same error when compiling the "blink" demo thats embedded in the IDE.

During these weeks I've applied a few system updates as this machine is auto updated. Tried to search a few forums, wikis and searched the net but with no solution. However I found this fresh listed bug report wich reflects my conditions. http://bugzilla.opensuse.org/show_bug.cgi?id=905634

Any ideas?


Regards
Hans

DrAzzy

So you're running Suse linux 13.2? If so, sounds like that's your bug.

Honestly, my first reaction to the error is that it looks like a command it's executing is getting mangled, with the -lm commandline argument being treated as a new command instead of an argument. Someone who's more familiar with the AVR compile process would be better able to assess that, though.


matelot: Why do you say this looks like a virus? It doesn't look at all like that to me - it sounds like a problem with the build environment, likely resulting from a system update of some sort. Particularly if you're running linux, which it sounds like you are, since you linked a suse bug.
ATTinyCore for x4/x5/x61/x7/x8/x41/1634/828/x313 megaTinyCore for the megaavr ATtinies - Board Manager:
http://drazzy.com/package_drazzy.com_index.json
ATtiny breakouts, mosfets, awesome prototyping board in my store http://tindie.com/stores/DrAzzy

Hans891

So you're running Suse linux 13.2? If so, sounds like that's your bug.
No, actually running 12.3 on AMD64 but I don't think its only 13.x that experience this problem.

Honestly, my first reaction to the error is that it looks like a command it's executing is getting mangled, with the -lm commandline argument being treated as a new command instead of an argument. Someone who's more familiar with the AVR compile process would be better able to assess that, though.
Fully agree! The error output looks like the command line argument -lm is not recognized and handled as a filename which obviously is not correct. A broken version dependency could cause this. It can be due to packaging errors or perhaps a configuration error like a path that points to wrong version of the software. I'm not at all familiar with the structure of the Arduino IDE and related compilers so I'm actually rather stuck. Will try to add a comment to that bug report that it also impact 12.3. Will also try to set up the Arduino packages on a laptop running 13.1 later today.


Johnc52

I received the same message. Below are the errors generated when trying to verify.

  This report would have more information with
  "Show verbose output during compilation"
  enabled in File > Preferences.
Arduino: 1.0.6 (Linux), Board: "Arduino Uno"
/usr/share/arduino-1.0.6/hardware/tools/avr/bin/../lib/gcc/avr/4.3.2/../../../avr/bin/ld: skipping incompatible /usr/share/arduino-1.0.6/hardware/tools/avr/bin/../lib/gcc/avr/4.3.2/../../../avr/lib/avr5/libm.a when searching for -lm
/usr/share/arduino-1.0.6/hardware/tools/avr/bin/../lib/gcc/avr/4.3.2/../../../avr/bin/ld: skipping incompatible /usr/share/arduino-1.0.6/hardware/tools/avr/bin/../lib/gcc/avr/4.3.2/../../../avr/lib/libm.a when searching for -lm
/usr/share/arduino-1.0.6/hardware/tools/avr/bin/../lib/gcc/avr/4.3.2/../../../avr/bin/ld: cannot find -lm

Hans891

The above mentioned bug report has been updated with a workaround.  (http://bugzilla.opensuse.org/show_bug.cgi?id=905634). I've tried it and it worked for me.  ;D

Code: [Select]

mv /usr/share/arduino-1.0.6/hardware/tools /usr/share/arduino-1.0.6/hardware/tools.old

saurabhshandilya

Well, the first thing that rings the bell, is surely the build environment. 
-lm is obviously an  argument that says to include maths library or some other, it depends.  The default place might have been moved, you could have easily fixed that error by excluding that particular library from the path (default environment) and manually giving it.

As per your verbose output, I see that it searches for static library to include at places like :
/usr/share/arduino-1.0.6/hardware/tools/avr/bin/../lib/gcc/avr/4.3.2/../../../avr/lib/avr5
/usr/share/arduino-1.0.6/hardware/tools/avr/bin/../lib/gcc/avr/4.3.2/../../../avr/lib/
...
and then probably the shared one also, and being unsuccessful in both it generates the error.

Go Up