Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Arduino on Slack

99 views
Skip to first unread message

notbob

unread,
Feb 2, 2012, 1:15:17 PM2/2/12
to
I've recently decided being totally inept on Slack was not enough, so
needed another outlet to flog myself over. Anyway, got all the
Arduino pkgs (ide/libs) from slacky and bought some hardware from that
hottie from NY, Ladyada. All looked good, hardware working OK, until
I got to compiling a program (blink sketch) in the ide and got errors.
I'll copy what I've already posted on their forum:


==========

/usr/lib/gcc/avr/4.3.3/../../../../avr/bin/ld: skipping incompatible
/usr/lib/gcc/avr/4.3.3/../../../../avr/lib/avr5/libm.a when searching
for -lm
/usr/lib/gcc/avr/4.3.3/../../../../avr/bin/ld: skipping incompatible
/usr/lib/gcc/avr/4.3.3/../../../../avr/lib/libm.a when searching for
-lm
/usr/lib/gcc/avr/4.3.3/../../../../avr/bin/ld: cannot find -lm


Slocate shows all these file do, in fact, exist and in the indicated
locations (directories). I changed permissions on both libm.a and
libm.s to 777. The ld file is already 755. I retried compile. No
joy.....

===========


So, their support suggested in was all slack's fault, but I can't buy
that, slack having the most stable vanilla pkgs/libs around.

First of all, what is "-lm"? I thought it was an option, what with
the hyphen. Turns out google posted error shows a variation "cannot
find -ls". Are these files? Binaries like ld? A page on google from
a gentoo user said it is a linker problem and goes into a buncha info
on chain tools and enabling multilib and symlinking a buncha files,
etc. A translated page from slacky (that google trasnlate thingie
works pretty damn good!!) has all kindsa confusing garbage about
mixing 64bit and 32bit files and older and newer versions. I also
found a blog page about arduino on slackware, but it's outdated and
doesn't seem to address my prob.

I guess I'll try slackbuilds.org pkgs as they compile against existing
hardware and see if that helps. Also found the original avr
linux/unix lib/tools page to wade through. Short of that, do any
slack arduino users have some insights?

TIA
nb

--
Fight internet CENSORSHIP - Fight SOPA-PIPA
Contact your congressman and/or representative, now!
http://projects.propublica.org/sopa/
vi --the heart of evil!

root

unread,
Feb 2, 2012, 1:33:24 PM2/2/12
to
-lm means to use the gcc math library.
>
> I guess I'll try slackbuilds.org pkgs as they compile against existing
> hardware and see if that helps. Also found the original avr
> linux/unix lib/tools page to wade through. Short of that, do any
> slack arduino users have some insights?
>
> TIA
> nb

slackbuilds does have arduino, but you have to get these first:
avr-libc, avr-gcc and avr-binutils

Slackbuilds adds:
Note: Due to a bug in the Arduino IDE, you might need to downgrade to
avr-binutils 2.20.1 to compile programs for some boards. You can use the
SlackBuild from SBo to compile a working version of avr-binutils 2.20.1.
>

notbob

unread,
Feb 2, 2012, 2:06:11 PM2/2/12
to
On 2012-02-02, root <NoE...@home.org> wrote:

> Slackbuilds adds:
> Note: Due to a bug in the Arduino IDE, you might need to downgrade to
> avr-binutils 2.20.1 to compile programs for some boards. You can use the
> SlackBuild from SBo to compile a working version of avr-binutils 2.20.1.

Yes, I have all the libs, but that's also what I got from slacky, the
thing about mixing/matching up/dwn rev libs, 2.20.1 from SBo, etc.
Hard to tell who's got the straight dope, so to speak. I been reading
bender's page:

http://home.comcast.net/~bender647/arduino/

.....it being more informative than previously suspected, that
toolchain thing being essential, apparently, but supposedly is built
when all the proper libs are compiled. The chase continues.....

Thnx ;)

Rob Windgassen

unread,
Feb 2, 2012, 6:15:06 PM2/2/12
to
On Thu, 02 Feb 2012 18:15:17 +0000, notbob wrote:


> First of all, what is "-lm"?

-l<name> is the option to link library named lib<name> (note
the 'lib' prefix), so -lm indicates to link the libm library.
libm is the library that contains (at least) the math functions for the
C standard library.

Along with -l there is -L option (uppercase) to override/extend the
default search paths of the library.
You have to find out were the libm.a (for static linked targets as avr the
library name typically has .a suffix) for the avr targets is placed on
your system and then pass that path with the -L option.
You can provide multiple -l and -L options to the gcc command line
to suit your needs.

'man gcc' contains a lot of info, but due to being a lot it may take
a while to find what you need.

Rob

Eef Hartman

unread,
Feb 3, 2012, 4:33:31 AM2/3/12
to
notbob <not...@nothome.com> wrote:
> First of all, what is "-lm"? I thought it was an option, what with
> the hyphen.

-l means: use library: lib<string>.a (or .so), so -lm will search the
math library, libm.* for needed functions.
The normal gcc/slack version of that is in /lib; libm.so.6 - which
mostly is a symlink to /lib/libm-<version>.so (version is 2.13 in
Slackware 13.37, different versions in other releases of course).
But avr seems to supply its own version of libm, which isn't
compatible with the standard (libc) system library of slackware.
This could be a version (libm newer than libc) or architecture
question (32- vs 64-bits). BTW: the 64-bits libs are mostly in
/lib64 cq /usr/lib64.
With the file command you can determine architecture:
file /lib/libm-2.13.so
/lib/libm-2.13.so: ELF 32-bit LSB shared object, Intel 80386, version
1 (SYSV), dynamically linked (uses shared libs),
so _my_ version of libm is 32-bits. If you do the same to the libm
in the avr/lib directory, you can see what IT is.
--
******************************************************************
** Eef Hartman, Delft University of Technology, dept. SSC/ICT **
** e-mail: E.J.M....@tudelft.nl - phone: +31-15-27 82525 **
******************************************************************

notbob

unread,
Feb 3, 2012, 6:50:00 PM2/3/12
to
On 2012-02-02, root <NoE...@home.org> wrote:

> Slackbuilds adds:
> Note: Due to a bug in the Arduino IDE, you might need to downgrade to
> avr-binutils 2.20.1 to compile programs for some boards. You can use the
> SlackBuild from SBo to compile a working version of avr-binutils 2.20.1.

I have all the proper pkgs from slacky, including the updated:

/var/log/packages/avr-binutils-2.20.1-i486-1sl

All avr-* pkgs were installed prior to installing the main arduino pkg.

notbob

unread,
Feb 13, 2012, 10:34:54 AM2/13/12
to
On 2012-02-02, notbob <not...@nothome.com> wrote:

To recap:

> I've recently decided being totally inept on Slack was not enough, so
> needed another outlet to flog myself over. Anyway, got all the
> Arduino pkgs (ide/libs) from slacky and bought some hardware from that
> hottie from NY, Ladyada. All looked good, hardware working OK, until
> I got to compiling a program (blink sketch) in the ide and got errors.
> I'll copy what I've already posted on their forum:
>
>
>==========
>
> /usr/lib/gcc/avr/4.3.3/../../../../avr/bin/ld: skipping incompatible
> /usr/lib/gcc/avr/4.3.3/../../../../avr/lib/avr5/libm.a when searching
> for -lm
> /usr/lib/gcc/avr/4.3.3/../../../../avr/bin/ld: skipping incompatible
> /usr/lib/gcc/avr/4.3.3/../../../../avr/lib/libm.a when searching for
> -lm
> /usr/lib/gcc/avr/4.3.3/../../../../avr/bin/ld: cannot find -lm
>
>
> Slocate shows all these file do, in fact, exist and in the indicated
> locations (directories). I changed permissions on both libm.a and
> libm.s to 777. The ld file is already 755. I retried compile. No
> joy.....


After flogging this fer a couple weeks, to no avail, I finally
appealed to Vito Magnanimo <vito...@gmail.com> at Slacky for help.
He recompiled the proper packages into a new build,
avr-libc-1.7.1-i486-4sl.txz, and now Slacky's carefully chosen combo
of up/down rev versions of all the avr-* pkgs works without a hitch.

I tried compiling slackbuild.org's pkgs, but they also are not
correct, the avr-binutils-2-21-1 and avr-gcc-4.5.3 being too new, buggy, and
incompatible. Slacky finally got it right and it now works with the
13.37 32-bit pkgs if loaded in proper dependency sequence:

avr-binutils-2.20.1-i486-2sl
avr-gcc-4.3.3-i486-2sl
avr-libc-1.7.1-i486-4sl
avrdude-5.11.1-i486-1sl
arduino-1.0-i486-2sl

....in that order.

A hearty Slackware HUZZAH! to the magnanimous Vito and Slacky!

(btw, Vito speaks fine English and welcomes all info, feedback, bug
reports, etc. A very nice fellow.)

carry on, slackers ;)
0 new messages