EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  <20162017  2018  2019  2020  2021  2022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  <20162017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: EPICS 3.14.12.3 Build Problems with the new Ubuntu 16.04 LTS
From: Michael Davidsaver <[email protected]>
To: [email protected]
Date: Tue, 26 Apr 2016 08:55:43 -0400

../../../../include/os/Linux/epicsMath.h:22:21: error: non-floating-point argument in call to function ‘__builtin_isfinite’

#  define finite(x) isfinite(x)

From what I can tell the gcc __builtin_isfinite() has always treated this as an error.  The change is rather in glibc 2.23, which starts exposing the builtins directly.

https://sourceware.org/git/?p=glibc.git;a=commit;h=8df4e219e43a4a257d0759b54fef8c488e2f282e

It also seems like Base isn't the only code effected by this change.

https://www.google.com/#q=site:bugs.debian.org+%22non-floating-point+argument+in+call+to+function%22

I don't know what the C standard has to say, but this seems like a glibc bug.  However, some workaround will probably be necessary in Base.

-#  define finite(x) isfinite(x)
+#  define finite(x) isfinite((float)x)

I think this is a bit too simple.  The reason isfinite() is a macro is have different implementations for float, double (and long double).  Looking at what glibc is doing it seems that something like the following is better:

#if __GLIBC__>2 || ( __GLIBC__==2 && __GLIBC_MINOR__>=23)
#  undef isfinite
#  define isfinite(x) \
     (sizeof (x) == sizeof (float)                                            \
     ? __builtin_isfinite ((float)x)                                                         \
     : sizeof (x) == sizeof (double)                                         \
     ? __builtin_isfinite ((double)x) : __builtin_isfinite ((long double)x))
#endif


On 04/26/2016 04:38 AM, Abdalla Ahmad wrote:

Hello all,

 

As you may already know, last Thursday was the release of the new Ubuntu 16.04 LTS. We decided to take a look at it and test our control system tools starting with EPICS.

 

I installed the OS on VMware Workstation, when doing the build, these are the error messages that appeared:

 

/usr/bin/g++ -c  -D_POSIX_C_SOURCE=199506L -D_POSIX_THREADS -D_XOPEN_SOURCE=500           -D_X86_64_  -DUNIX  -D_BSD_SOURCE -Dlinux  -D_REENTRANT   -O3   -Wall      -m64      -MMD -I. -I../O.Common -I. -I.. -I../../../../include/os/Linux -I../../../../include        ../epicsCalcTest.cpp

../epicsCalcTest.cpp: In function ‘int main(int, char**)’:

../../../../include/os/Linux/epicsMath.h:22:21: error: non-floating-point argument in call to function ‘__builtin_isfinite’

#  define finite(x) isfinite(x)

                     ^

../epicsCalcTest.cpp:102:40: note: in definition of macro ‘testExpr’

#define testExpr(expr) testCalc(#expr, expr);

                                        ^

../epicsCalcTest.cpp:314:14: note: in expansion of macro ‘finite’

     testExpr(finite(0));

              ^

../epicsCalcTest.cpp:328:14: error: non-floating-point argument in call to function ‘__builtin_isinf_sign’

     testExpr(isinf(0));

              ^

../epicsCalcTest.cpp:102:40: note: in definition of macro ‘testExpr’

#define testExpr(expr) testCalc(#expr, expr);

                                        ^

../epicsCalcTest.cpp:332:14: error: non-floating-point argument in call to function ‘__builtin_isnan’

     testExpr(isnan(0));

              ^

../epicsCalcTest.cpp:102:40: note: in definition of macro ‘testExpr’

#define testExpr(expr) testCalc(#expr, expr);

                                        ^

../../../../configure/RULES_BUILD:209: recipe for target 'epicsCalcTest.o' failed

make[3]: *** [epicsCalcTest.o] Error 1

make[3]: Leaving directory '/home/abdalla/epics/base-3.14.12.3/src/libCom/test/O.linux-x86_64'

../../../configure/RULES_ARCHS:63: recipe for target 'install.linux-x86_64' failed

make[2]: *** [install.linux-x86_64] Error 2

make[2]: Leaving directory '/home/abdalla/epics/base-3.14.12.3/src/libCom/test'

../configure/RULES_DIRS:70: recipe for target 'libCom/test.install' failed

make[1]: *** [libCom/test.install] Error 2

make[1]: Leaving directory '/home/abdalla/epics/base-3.14.12.3/src'

configure/RULES_DIRS:70: recipe for target 'src.install' failed

make: *** [src.install] Error 2

 

A quick search over the Internet shows that some people have faced this error with the same GCC 5.3 compiler and the solution was to add a simple cast to float to the argument that caused the error.

 

The two needed files are:

1.       epicsCalcTest.cpp (located at base/src/libCom/test)

2.       epicsMath.h (located at base/src/libCom/osi/os/posix)

 

You can see the attached patch file for more details (which is applied on the base's top level folder). After doing the modifications in the patch file, the build works fine producing all EPICS binaries.

 

The question is, could there be another way to bypass this error? I think something can be done on the compiler side especially it is the new GCC 5.3 since the same EPICS version worked on Ubuntu 15.04 and 14.04 LTS without any problem (can't recall GCC version here).

 

Best Regards,

 

Abdalla Ahmad

Control Engineer

SESAME.

Allan, Jordan.

Tel: (+962-5) 3511348 , ext. 265

Fax: (+962-5) 3511423

Mob: (+962-7)88183296

www.sesame.org.jo

 

 



Replies:
Re: EPICS 3.14.12.3 Build Problems with the new Ubuntu 16.04 LTS Michael Davidsaver
References:
EPICS 3.14.12.3 Build Problems with the new Ubuntu 16.04 LTS Abdalla Ahmad

Navigate by Date:
Prev: Re: EPICS_TIMEZONE and TZ on RTEMS Michael Davidsaver
Next: Re: Area Detector question bob dalesio
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  <20162017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: EPICS 3.14.12.3 Build Problems with the new Ubuntu 16.04 LTS Abdalla Ahmad
Next: Re: EPICS 3.14.12.3 Build Problems with the new Ubuntu 16.04 LTS Michael Davidsaver
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  <20162017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 15 Jul 2016 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·