-->
Page 1 of 2

sqrt issues when no srt is called or needed

PostPosted: Mon Oct 12, 2015 9:24 am
by picstart
This has <DHT.h> from DHT sensor library
..... looks like another dependency issue ..DHT uses float and I suspect float brings in a dependency on a math library which has a dependency on sqrt which brings in a dependency on the esp tool chain which has a dependency on ieee standards which has a dependency on a specific Iee standard 784. There may be many more hidden dependencies
The dependency below on a specific drive letter and a specific directory structure is unnerving I don't have a drive d: but I'd wager the original coder does.
d:\ivan\projects\arduinoesp\toolchain\dl\esp-newlib\build\xtensa-lx106-elf\newlib\libm\math/../../../../../newlib/libm/math/w_sqrt.c:63: undefined reference to `__ieee754_sqrt'

The arduino code being tested is DHTtester from the examples DHTtester.

Any ideas on how to get DHTtester to compile?

The compiler eror
[quote]Arduino: 1.6.5 (Windows 7), Board: "Generic ESP8266 Module, Serial, 80 MHz, 40MHz, DIO, 115200, 512K (64K SPIFFS)"

c:/arduino/arduino-1.6.5/portable/packages/esp8266/tools/xtensa-lx106-elf-gcc/1.20.0-26-gb404fb9/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/lib\libm.a(lib_a-w_sqrt.o):(.literal+0x8): undefined reference to `__ieee754_sqrt'
c:/arduino/arduino-1.6.5/portable/packages/esp8266/tools/xtensa-lx106-elf-gcc/1.20.0-26-gb404fb9/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/lib\libm.a(lib_a-w_sqrt.o): In function `sqrt':
d:\ivan\projects\arduinoesp\toolchain\dl\esp-newlib\build\xtensa-lx106-elf\newlib\libm\math/../../../../../newlib/libm/math/w_sqrt.c:63: undefined reference to `__ieee754_sqrt'
collect2.exe: error: ld returned 1 exit status
Error compiling.

This report would have more information with
"Show verbose output during compilation"
enabled in File > Preferences.
[/quote]

Re: sqrt issues when no srt is called or needed

PostPosted: Fri Oct 16, 2015 10:17 am
by wickwirew
You are right about the dependencies. I got it work work by editing the library and adding my own pow()and sqrt() method. Ill attach the edited library. So just go into your documents and delete the old one then add mine and it should work! Let me know if you have any issues.

Re: sqrt issues when no srt is called or needed

PostPosted: Sat Oct 17, 2015 3:16 pm
by chrisaclark
Many thanks for this I have the same problem. Can the IEEE library be put right in the next release?

Re: sqrt issues when no srt is called or needed

PostPosted: Sat Oct 17, 2015 10:07 pm
by picstart
wickwirew
Thanks for the effort....I chose to rewrite the DHT11 code...I already had a compact module DHT11 I was using for PIC MCU's.
Arduino libraries spanning several boards a vendor sells maybe great if you purchased all of the arduino piggy back sensor boards but is bloatware for a standalone esp8266.
The DHT11 only needs one pin on a generic esp8266 board and about 100 lines of code.
The esp8266 needs an IDE Arduino or Eclipse are fine so are libraries independent of vendor specific arduino piggy back boards.