|Summary:||media-libs/gegl - reinhard05.c: In function 'reinhard05_stats_start': reinhard05.c:88: error: 'NAN' undeclared (first use in this function)|
|Product:||Gentoo/Alt||Reporter:||Rabbe Fogelholm <rabbe>|
|Component:||Prefix Support||Assignee:||Gentoo Prefix <prefix>|
|Severity:||normal||CC:||divanorama, kripton, palmer|
|Package list:||Runtime testing required:||---|
|Attachments:||Adds -std=gnu99 to CFLAGS|
Description Rabbe Fogelholm 2011-06-14 11:41:02 UTC
Platform is Gentoo Prefix on SUSE Enterprise 10 SP2. media-libs/gegl-0.1.6 fails to emerge, which in turn stops gimp from being emerged. The console output looks like: reinhard05.c: In function 'reinhard05_stats_start': reinhard05.c:88: error: 'NAN' undeclared (first use in this function) reinhard05.c:88: error: (Each undeclared identifier is reported only once reinhard05.c:88: error: for each function it appears in.) make: *** [reinhard05.la] Error 1 make: Leaving directory `/local/scratch/portage/media-libs/gegl-0.1.6/work/gegl-0.1.6/operations/common' make: *** [all-recursive] Error 1 make: Leaving directory `/local/scratch/portage/media-libs/gegl-0.1.6/work/gegl-0.1.6/operations/common' make: *** [all-recursive] Error 1 make: Leaving directory `/local/scratch/portage/media-libs/gegl-0.1.6/work/gegl-0.1.6/operations' make: *** [all-recursive] Error 1 make: Leaving directory `/local/scratch/portage/media-libs/gegl-0.1.6/work/gegl-0.1.6' make: *** [all] Error 2 * ERROR: media-libs/gegl-0.1.6 failed (compile phase): * emake failed
Comment 1 Dmitry Ivankov 2011-06-21 11:27:42 UTC
Looks like a bug in gegl, forgotten #include <math.h>. I've hacked around it with CFLAGS="-DNAN=__builtin_nanf\\(\\\"\\\"\\)" emerge -1 gegl. Stole it from my math.h and my gcc>=3.3. Proper way is to add a patch of course.
Comment 2 Rabbe Fogelholm 2011-06-22 07:18:35 UTC
Thanks Dmitry! With your workaround I can again emerge 'gegl'.
Comment 3 Rob Kay 2011-07-01 10:10:06 UTC
Same problem here. Thanks for solution! Workaround: export CFLAGS="-DNAN=\"(0.0/0.0)\"" then emerge -1 gegl
Comment 4 Palmer Dabbelt 2012-06-23 20:32:17 UTC
Created attachment 316101 [details] Adds -std=gnu99 to CFLAGS This problem still exists for me when using media-libs/gegl-0.2.0 on a Red Hat 5, ~amd64-linux Gentoo prefix. There's actually a few more failures now, but it seems that they're all related to floating point stuff. The missing definitions are NAN and fminf, both of which seem to need _ISOC99_SOURCE defined. I've attached a patch that adds "-std=gnu99" to CFLAGS, which allows gegl-0.2.0 to build. I think this is correct as the package seems to be using GNU C extensions (when I just added "-std=c99" the build still failed, I didn't look closely). With the attached patch applied, medias-libs/gegl-0.2.0 builds on my ~amd64-prefix.
Comment 5 Wilfred Hughes 2014-05-09 14:29:45 UTC
I'm also on a RHEL 5 machine running Gentoo Prefix, and I can confirm using those CFLAGS fixes the compilation error.
Comment 6 Wilfred Hughes 2014-05-09 15:28:41 UTC
Upstream bug, upstream is not convinced that the fix should be their end: https://bugzilla.gnome.org/show_bug.cgi?id=567435
Comment 7 Fabian Groffen 2017-11-14 13:22:19 UTC
I'm sorry, but I believe the package and OS changed considerably since.