[rrd-users] compile problem with IEEE math on Freescale P2020

Trevor Bowen trevorbowen at gmail.com
Fri May 3 17:07:19 CEST 2013


Well, I finally got RRDtool to compile on my Freescale P2020 based board.

The root of the issue was that the configure script was determined to test 
the IEEE-754 config-test programs on the host to verify that the math worked 
as expected!  Since I was cross-compiling, that obviously failed, although 
it was not obvious to me that was the issue.  The configure script tries to 
detect this, but it is only partially successful.  This can be fixed by the 
following patch, which needs to be added to the repo.

diff --git original/rrdtool-1.5.20130424/configure 
fixed/rrdtool-1.5.20130424/configure
index 980d90b..b380ff6 100755
--- original/rrdtool-1.5.20130424/configure
+++ fixed/rrdtool-1.5.20130424/configure
@@ -20231,7 +20231,9 @@ if test "${rd_cv_ieee_works+set}" = set; then
    $as_echo_n "(cached) " >&6
  else
    if test "$cross_compiling" = yes; then
-  :
+    $as_echo_n "(skipped ... cross-compiling) " >&6
+    # Bypass further checks
+    rd_cv_ieee_works=yes
  else
    cat >conftest.$ac_ext <<_ACEOF
  /* confdefs.h.  */

If you are uncomfortable with the above patch, you can always force the 
configure script to bypass the checks on the command line.  For example, 
here is mine:

./configure --host=ppc-linux rd_cv_ieee_works=yes --disable-perl 
--disable-lua --disable-ruby --disable-libdbi --disable-tcl --prefix=/usr 
--sysconfdir=/etc --mandir=/usr/share/man

Notice the rd_cv_ieee switch which disables the IEEE-754 validation.  (I 
disable all of the bindings, except Python, since that is all I use.)

FWIW, I found these posts to be extremely helpful:

* http://lists.uclibc.org/pipermail/uclibc/2004-February/029102.html
* 
http://www.avrfreaks.net/index.php?name=PNphpBB2&file=printview&t=86145&start=0

Hope this helps someone else.  Thanks to Tobi for the awesome tool!

Trevor

====================================================
Are you in search of ultimate truth?
http://www.insearchoftruth.org
http://www.wordsfitlyspoken.org

On 05/02/2013 09:25 AM, Trevor Bowen wrote:
> This may be more of a question for developers and Tobi, but would it be 
> possible to either bundle or include the option to use SoftFloat as an 
> alternative to the missing IEEE 754 floating-point library?
>
> Please see:
>
>     * http://www.jhauser.us/arithmetic/SoftFloat.html
>     * 
> http://stackoverflow.com/questions/2186788/is-there-an-open-source-c-c-implementation-of-ieee-754-operations
>
> Currently, I'm trying to patch RRDtool to use SoftFloat on my embedded 
> board, which apparently is missing an IEEE-754 library, but I'm sure 
> others more familiar with RRDtool could do so with greater ease and 
> "correctness".
>
> Thanks!
>
> Trevor
>
>
> On 04/30/2013 02:56 PM, Trevor Bowen wrote:
>> Hi,
>>
>> Has anyone discovered how to cross-compile RRDtool for Freescale's P2020 
>> using their LTIB toolchain?  I am getting the familiar missing IEEE 
>> floating-point math error:
>>
>>     IEEE Math Checks
>>     checking for fpclassify... no
>>     checking for fpclassify with <math.h>... yes
>>     checking for isinf... yes
>>     checking whether isfinite is broken... no
>>     checking if IEEE math works out of the box... no
>>     checking if IEEE math works with the -ieee switch... no
>>     checking if IEEE math works with the -qfloat=nofold switch... no
>>     checking if IEEE math works with the -w 
>> -qflttrap=enable:zerodivide... no
>>     checking if IEEE math works with the -mieee switch... no
>>     checking if IEEE math works with the -q float=rndsngl switch... no
>>     checking if IEEE math works with the -OPT:IEEE_NaN_inf=ON switch... no
>>     checking if IEEE math works with the -OPT:IEEE_comparisons=ON 
>> switch... no
>>     checking if IEEE math works with fpsetmask(0)... no
>>     checking if IEEE math works with signal(SIGFPE,SIG_IGN)... no
>>     configure: error:
>>     Your Compiler does not do propper IEEE math ... Please find out how to
>>     make IEEE math work with your compiler and let me know 
>> (tobi at oetiker.ch).
>>     Check config.log to see what went wrong ...
>>
>> I am compiling it with the following (simplified) script:
>>
>>     export RFS=/local/cross-compiled/rootfs
>>     export ARCH=powerpc
>>     export OS=linux
>>     export TOOLCHAIN_BASE=/opt/freescale
>>     export 
>> TOOLCHAIN_BIN=${TOOLCHAIN_BASE}/usr/local/gcc-4.3.74-eglibc-2.8.74-dp-2/powerpc-none-linux-gnuspe/bin
>>     export CROSS_COMPILE=${TOOLCHAIN_BIN}/powerpc-none-linux-gnuspe-
>>     export c=${CROSS_COMPILE}
>>     export AS=${CROSS_COMPILE}as
>>     export LD=${CROSS_COMPILE}ld
>>     export CC=${CROSS_COMPILE}gcc
>>     export AR=${CROSS_COMPILE}ar
>>     export STRIP="${CROSS_COMPILE}strip --strip-unneeded"
>>     export SSTRIP=${CROSS_COMPILE}sstrip
>>     export OBJCOPY=${CROSS_COMPILE}objcopy
>>     export OBJDUMP=${CROSS_COMPILE}objdump
>>     export MAKE=make
>>     export CFLAGS="-I${RFS}/usr/local/include -L${RFS}/lib"
>>     export LDFLAGS="-I${RFS}/usr/local/include -L${RFS}/lib"
>>     export PKG_CONFIG_LIBDIR="$( cd ${RFS}/usr/lib/pkgconfig && pwd )"
>>     ./configure --host=ppc-linux --build=i586-linux-gnu --prefix=/usr/local
>>
>> Any suggestions?
>>
>> Thanks!
>>
>> Trevor
>



More information about the rrd-users mailing list