Date: Wed, 2 Mar 2011 10:35:21 +0100 (CET) From: Christoph Moench-Tegeder <cmt@burggraben.net> To: FreeBSD-gnats-submit@FreeBSD.org Subject: ports/155183: graphics/gegl build failure because of missing log2f() Message-ID: <20110302093521.1191DA101C@reindeer.exwg.net> Resent-Message-ID: <201103021000.p22A0KlF071831@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 155183 >Category: ports >Synopsis: graphics/gegl build failure because of missing log2f() >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Wed Mar 02 10:00:20 UTC 2011 >Closed-Date: >Last-Modified: >Originator: Christoph Moench-Tegeder >Release: FreeBSD 8.2-RELEASE amd64 >Organization: >Environment: System: FreeBSD reindeer.exwg.net 8.2-RELEASE FreeBSD 8.2-RELEASE #7: Thu Feb 17 09:12:56 CET 2011 cmt@reindeer.exwg.net:/usr/obj/usr/src/sys/CMT amd64 Upgrade graphics/gegl-0.1.2_1 to graphics/gegl-0.1.6 >Description: Build of gegl-0.1.6 fails because of missing log2f(): CXX exp_combine-exp_combine.o exp_combine.cpp: In function 'gfloat expcombine_get_file_ev(const gchar*)': exp_combine.cpp:94: error: 'log2f' was not declared in this scope gmake[2]: *** [exp_combine-exp_combine.o] Error 1 gmake[2]: Leaving directory `/usr/ports/graphics/gegl/work/gegl-0.1.6/tools' log2f() is in POSIX and C89, so FreeBSD should have one, too; but that is outside the scope of this PR. >How-To-Repeat: try to build gegl >Fix: If I got my logarithms right, the following patch should produce equivalent code without relying on log2f(). Please review, in case I'm making a fool of myself. diff -Nru gegl.orig/files/patch-tools-exp_combine.cpp gegl/files/patch-tools-exp_combine.cpp --- gegl.orig/files/patch-tools-exp_combine.cpp 1970-01-01 01:00:00.000000000 +0100 +++ gegl/files/patch-tools-exp_combine.cpp 2011-03-02 10:26:21.000000000 +0100 @@ -0,0 +1,11 @@ +--- tools/exp_combine.cpp.orig 2011-03-02 10:23:52.000000000 +0100 ++++ tools/exp_combine.cpp 2011-03-02 10:25:03.000000000 +0100 +@@ -91,7 +91,7 @@ + gain = 1.0f; + } + +- return log2f (aperture * aperture) + log2f (1 / time) + log2f (gain); ++ return logf (aperture * aperture * gain / time) / logf (2.0); + } + + Regards, Christoph >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20110302093521.1191DA101C>