[rrd-developers] Re: rrdtool-1.2.10 configurirng porblem on Solaris 9 with gcc-4.0.0 or later

Tobias Oetiker oetiker at ee.ethz.ch
Tue Jul 19 18:20:05 MEST 2005


Hi Hiroshi,

try this patch


Index: configure.ac
===================================================================
--- configure.ac        (revision 649)
+++ configure.ac        (working copy)
@@ -205,16 +205,19 @@
 dnl actual code to check if this works
 AC_CHECK_FUNCS(fpclassify, ,
   [AC_MSG_CHECKING(for fpclassify with <math.h>)
-    AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <math.h>]], [[float f = 0.0; fpclassify(f)]])],[AC_MSG_RESULT(yes)
+    AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <math.h>
+volatile int x;volatile float f; ]], [[x = fpclassify(f)]])],[AC_MSG_RESULT(yes)
       AC_DEFINE(HAVE_FPCLASSIFY)],[AC_MSG_RESULT(no)])])
 AC_CHECK_FUNCS(finite, ,
   [AC_CHECK_FUNCS(isfinite, ,
     [AC_MSG_CHECKING(for isfinite with <math.h>)
-    AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <math.h>]], [[float f = 0.0; isfinite(f)]])],[AC_MSG_RESULT(yes)
+    AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <math.h>
+volatile int x;volatile float f;  ]], [[x = isfinite(f)]])],[AC_MSG_RESULT(yes)
       AC_DEFINE(HAVE_ISFINITE)],[AC_MSG_RESULT(no)])])])
 AC_CHECK_FUNCS(isinf, ,
   [AC_MSG_CHECKING(for isinf with <math.h>)
-    AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <math.h>]], [[float f = 0.0; isinf(f)]])],[AC_MSG_RESULT(yes)
+    AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <math.h>
+volatile int x;volatile float f;  ]], [[x = isinf(f)]])],[AC_MSG_RESULT(yes)
       AC_DEFINE(HAVE_ISINF)],[AC_MSG_RESULT(no)])])

 AC_FULL_IEEE



cheers
tobi
Today hiroshi.fujishima at gmail.com wrote:

> Hi,
>
> It cannot configure rrdtool-1.2.10 on Solaris 9 with gcc-4.0.0 or
> later.  the error message is following.
>
> checking for isinf... no
> checking for isinf with <math.h>... yes
> 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 (oetiker at ee.ethz.ch).
> Check config.log to see what went wrong ...
>
> The configure script checks isinf with <math.h> as following.
>
> #include <math.h>
> int
> main ()
> {
> float f = 0.0; isinf(f)
>   ;
>   return 0;
> }
>
> Gcc-4.0.0 or later eliminates calls to pure functions whose return
> value is not used.[1] So compilation of the above code is succeed and
> the HAVE_ISINF macro is defined if the system does not have isinf().
>
> Therefore, the following isinf(a) macro is not defined.
>
> /* Solaris */
> #if (! defined(HAVE_ISINF) && defined(HAVE_FPCLASS))
> #  define HAVE_ISINF 1
> #  define isinf(a) (fpclass(a) == FP_NINF || fpclass(a) == FP_PINF)
> #endif
>
> Jakub Jelinek suggested the solution in gcc at gcc.gnu.org list.[2] Could
> anyone take look it?
>
> [1] http://article.gmane.org/gmane.comp.gcc.devel/69128
> [2] http://article.gmane.org/gmane.comp.gcc.devel/69154
>
> Regards.
>
>

-- 
 ______    __   _
/_  __/_  / /  (_) Oetiker @ ISG.EE, ETL F24.2, ETH, CH-8092 Zurich
 / // _ \/ _ \/ /  System Manager, Time Lord, Coder, Designer, Coach
/_/ \.__/_.__/_/   http://people.ee.ethz.ch/oetiker +41(0)44-632-5286

--
Unsubscribe mailto:rrd-developers-request at list.ee.ethz.ch?subject=unsubscribe
Help        mailto:rrd-developers-request at list.ee.ethz.ch?subject=help
Archive     http://lists.ee.ethz.ch/rrd-developers
WebAdmin    http://lists.ee.ethz.ch/lsg2.cgi



More information about the rrd-developers mailing list