Bug 125446

Summary: Compile error on Solaris 8 - colorspaces/rgb_f32/kis_rgb_f32_colorspace.cc uses powf which is not available
Product: [Applications] krita Reporter: Steve Evans <stevee>
Component: GeneralAssignee: Adrian Page <adrian>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Solaris   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Steve Evans 2006-04-12 18:56:19 UTC
Version:           1.5.0 (using KDE KDE 3.5.2)
Installed from:    Compiled From Sources
Compiler:          gcc 3.4.3 
OS:                Solaris

I get this compile error:

if /bin/bash ../../../libtool --silent --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I. -I../../.. -I./../../sdk -I./../../kritacolor/color_strategy/ -I./../../kritacolor/ -I../../../lib/kofficeui -I../../../lib/kofficeui -I../../../lib/kofficecore -I../../../lib/kofficecore -I../../../lib/store -I../../../lib/store -I../../../lib/kwmf -I../../../lib/kwmf -I../../../lib/kopalette -I../../../lib/kopalette -I/opt/kde/include -I/opt/qt/include   -I/gorbag/exta/cad/externals/SOLARIS/gnome2/include/glib-2.0 -I/gorbag/exta/cad/externals/SOLARIS/include  -DQT_THREAD_SUPPORT -I/opt/kde/include -I/gorbag/exta/cad/externals/SOLARIS/gnome2/include/glib-2.0 -I/gorbag/exta/cad/externals/SOLARIS/include -I/opt/qt/include  -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -DUSE_SOLARIS -DSVR4  -Wno-long-long -Wundef -Wall -W -Wpointer-arith -DNDEBUG -DNO_DEBUG -O2 -I/opt/kde/include -I/gorbag/exta/cad/externals/SOLARIS/gnome2/include/glib-2.0 -I/gorbag/exta/cad/externals/SOLARIS/include -I/opt/qt/include -O2 -fomit-frame-pointer -DNeedVarargsPrototypes=1 -DNeedFunctionPrototypes=1 -pipe -fno-exceptions -mcpu=ultrasparc -Wno-non-virtual-dtor -fno-exceptions -fno-check-new -fno-common -DQT_CLEAN_NAMESPACE -DQT_NO_ASCII_CAST -DQT_NO_STL -DQT_NO_COMPAT -DQT_NO_TRANSLATION -DHAVE_KNEWSTUFF  -MT kis_rgb_f32_colorspace.lo -MD -MP -MF ".deps/kis_rgb_f32_colorspace.Tpo" -c -o kis_rgb_f32_colorspace.lo kis_rgb_f32_colorspace.cc; \
then mv -f ".deps/kis_rgb_f32_colorspace.Tpo" ".deps/kis_rgb_f32_colorspace.Plo"; else rm -f ".deps/kis_rgb_f32_colorspace.Tpo"; exit 1; fi
In file included from kis_rgb_f32_colorspace.cc:25:
/gorbag/exta/cad/externals/SOLARIS/include/lcms.h:1339:5: warning: "USE_DEFAULT_FLOOR_CONVERSION" is not defined
In file included from ./../../kritacolor/kis_f32_base_colorspace.h:25,
                 from kis_rgb_f32_colorspace.h:30,
                 from kis_rgb_f32_colorspace.cc:32:
./../../sdk/kis_integer_maths.h:22:1: warning: "UINT8_MAX" redefined
In file included from /usr/local/gcc-3.4.3/lib/gcc/sparc-sun-solaris2.8/3.4.3/include/syslimits.h:41,
                 from /usr/local/gcc-3.4.3/lib/gcc/sparc-sun-solaris2.8/3.4.3/include/limits.h:11,
                 from kis_rgb_f32_colorspace.cc:23:
/usr/include/sys/int_limits.h:79:1: warning: this is the location of the previous definition
In file included from ./../../kritacolor/kis_f32_base_colorspace.h:25,
                 from kis_rgb_f32_colorspace.h:30,
                 from kis_rgb_f32_colorspace.cc:32:
./../../sdk/kis_integer_maths.h:25:1: warning: "UINT16_MAX" redefined
In file included from /usr/local/gcc-3.4.3/lib/gcc/sparc-sun-solaris2.8/3.4.3/include/syslimits.h:41,
                 from /usr/local/gcc-3.4.3/lib/gcc/sparc-sun-solaris2.8/3.4.3/include/limits.h:11,
                 from kis_rgb_f32_colorspace.cc:23:
/usr/include/sys/int_limits.h:80:1: warning: this is the location of the previous definition
In file included from ./../../kritacolor/kis_f32_base_colorspace.h:25,
                 from kis_rgb_f32_colorspace.h:30,
                 from kis_rgb_f32_colorspace.cc:32:
./../../sdk/kis_integer_maths.h:28:1: warning: "UINT32_MAX" redefined
In file included from /usr/local/gcc-3.4.3/lib/gcc/sparc-sun-solaris2.8/3.4.3/include/syslimits.h:41,
                 from /usr/local/gcc-3.4.3/lib/gcc/sparc-sun-solaris2.8/3.4.3/include/limits.h:11,
                 from kis_rgb_f32_colorspace.cc:23:
/usr/include/sys/int_limits.h:81:1: warning: this is the location of the previous definition
In file included from ./../../kritacolor/kis_f32_base_colorspace.h:25,
                 from kis_rgb_f32_colorspace.h:30,
                 from kis_rgb_f32_colorspace.cc:32:
./../../sdk/kis_integer_maths.h:31:1: warning: "INT16_MAX" redefined
In file included from /usr/local/gcc-3.4.3/lib/gcc/sparc-sun-solaris2.8/3.4.3/include/syslimits.h:41,
                 from /usr/local/gcc-3.4.3/lib/gcc/sparc-sun-solaris2.8/3.4.3/include/limits.h:11,
                 from kis_rgb_f32_colorspace.cc:23:
/usr/include/sys/int_limits.h:73:1: warning: this is the location of the previous definition
In file included from ./../../kritacolor/kis_f32_base_colorspace.h:25,
                 from kis_rgb_f32_colorspace.h:30,
                 from kis_rgb_f32_colorspace.cc:32:
./../../sdk/kis_integer_maths.h:32:1: warning: "INT16_MIN" redefined
In file included from /usr/local/gcc-3.4.3/lib/gcc/sparc-sun-solaris2.8/3.4.3/include/syslimits.h:41,
                 from /usr/local/gcc-3.4.3/lib/gcc/sparc-sun-solaris2.8/3.4.3/include/limits.h:11,
                 from kis_rgb_f32_colorspace.cc:23:
/usr/include/sys/int_limits.h:138:1: warning: this is the location of the previous definition
kis_rgb_f32_colorspace.cc: In function `Q_UINT8 convertToDisplay(float, float, float)':
kis_rgb_f32_colorspace.cc:248: error: `powf' undeclared (first use this function)
kis_rgb_f32_colorspace.cc:248: error: (Each undeclared identifier is reported only once for each function it appears in.)
kis_rgb_f32_colorspace.cc: In member function `virtual QImage KisRgbF32ColorSpace::convertToQImage(const Q_UINT8*, Q_INT32, Q_INT32, KisProfile*, Q_INT32, float)':
kis_rgb_f32_colorspace.cc:274: error: `powf' undeclared (first use this function)
distcc[26972] ERROR: compile kis_rgb_f32_colorspace.cc on gandalf/3 failed

I solved the problem by replacing powf() with pow()
Comment 1 Halla Rempt 2006-04-12 20:46:55 UTC
Does pow do the same thing as powf? I've assigned this bug to Adrian Page, since he knows this code best.
Comment 2 Adrian Page 2006-04-12 22:51:48 UTC
SVN commit 529238 by page:

Use pow if powf is not available.

BUG: 125446



 M  +5 -0      colorspaces/rgb_f16half/kis_rgb_f16half_colorspace.cc  
 M  +5 -0      colorspaces/rgb_f32/kis_rgb_f32_colorspace.cc  
 M  +7 -0      configure.in.in  


--- branches/koffice/1.5/koffice/krita/colorspaces/rgb_f16half/kis_rgb_f16half_colorspace.cc #529237:529238
@@ -38,6 +38,11 @@
 
 #include "kis_integer_maths.h"
 
+#ifndef HAVE_POWF
+#undef powf
+#define powf pow
+#endif
+
 //#define HALF_MAX ((half)1.0f) //temp
 
 #define EPSILON HALF_EPSILON
--- branches/koffice/1.5/koffice/krita/colorspaces/rgb_f32/kis_rgb_f32_colorspace.cc #529237:529238
@@ -39,6 +39,11 @@
 
 #include "kis_integer_maths.h"
 
+#ifndef HAVE_POWF
+#undef powf
+#define powf pow
+#endif
+
 #define FLOAT_MAX 1.0f //temp
 
 #define EPSILON 1e-6
--- branches/koffice/1.5/koffice/krita/configure.in.in #529237:529238
@@ -99,3 +99,10 @@
 
 # --- End of OpenGL check ---
 
+# Check for powf.
+
+AC_CHECK_FUNC(powf, [have_powf="yes"], [AC_CHECK_LIB(m, powf, [have_powf="yes"], [have_powf="no"])])
+
+if test "$have_powf" = 'yes'; then
+  AC_DEFINE([HAVE_POWF], 1, [Define to 1 if your system has powf in <maths.h>])
+fi
Comment 3 Steve Evans 2006-10-18 11:13:49 UTC
This problem still exists in koffice 1.6.0
Comment 4 Halla Rempt 2006-11-06 11:57:45 UTC
If the above patch didn't fix it, we really need a patch by someone who actually works with Solaris -- we're coding in the dark here, not having either solaris or solaris expertise.
Comment 5 Steve Evans 2006-11-06 14:13:19 UTC
To clarify things, the above patch does work, but it is not included in koffice 1.6.0
Comment 6 Halla Rempt 2006-11-19 16:46:25 UTC
Oh dear... And I wasn't paying attention, so it's too late to put it in for 1.6.1, too. I'll commit for 1.6.2, which will be released in January. I saw too late that Adrian had only committed to the 1.5 branch.
Comment 7 Halla Rempt 2006-11-19 16:50:38 UTC
I'm not sure how to port this to CMake and trunk, though. It's probably still a problem there, so reassigning to Adrian.
Comment 8 Halla Rempt 2006-11-19 16:57:36 UTC
And, of course, this bug is not unconfirmed. Checked in for 1.6, btw.
Comment 9 Cyrille Berger 2006-12-30 11:38:57 UTC
the patch was applied to krita 1.6 by Adrian. And as far as I can see is in. So there is an other problem, can we have the compiler output ?
Comment 10 Steve Evans 2007-01-02 12:36:49 UTC
The patch was added by Adrian in 1.5, not 1.6. It was added to 1.6 on Nov 19th which was too late for inclusion in koffice 1.6.1, as detailed in comment #6.

The patch does solve the problem, so hopefully 1.6.2 will be OK.
Comment 11 Sven Langkamp 2007-06-12 07:39:38 UTC
1.6.3 has been released. Can this bug be closed now?
Comment 12 Halla Rempt 2007-12-06 14:26:47 UTC
I think so.