Bug 163118

Summary: digikam-0.9.4_beta5 compilation hangs with gcc 4.3
Product: [Applications] digikam Reporter: Deathwing00 <deathwing00>
Component: Portability-CompilationAssignee: Digikam Developers <digikam-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: jlp, rdieter
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Gentoo Packages   
OS: Linux   
Latest Commit: Version Fixed In: 0.9.4
Sentry Crash Report:

Description Deathwing00 2008-06-03 09:48:52 UTC
Version:            (using KDE 3.5.9)
Installed from:    Gentoo Packages
Compiler:          gcc-4.3.0 glibc-2.7-r2, kernel 2.6.25-gentoo-r4 x86_64
OS:                Linux

Downstream: https://bugs.gentoo.org/show_bug.cgi?id=224611

User reports that the current digikam version compiles with gcc 4.2.4 but hangs at the following point with gcc 4.3.0. Patch requested.

CHOST="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2 -fomit-frame-pointer -pipe"
LDFLAGS="-Wl,--as-needed"

Actual Results:
Compilation gets to the following point and hangs with ~100% cpu usage on one
core:
==========================================================
/usr/qt/3/bin/moc ./greycstorationwidget.h -o greycstorationwidget.moc
creating libgreycstoration_la.all_cpp.cpp ...
/bin/sh ../../../libtool --silent --tag=CXX   --mode=compile
x86_64-pc-linux-gnu-g++ -DHAVE_CONFIG_H -I. -I../../..
-I../../../digikam/libs/dimg -I../../../digikam/libs/dimg/filters
-I../../../digikam/digikam  -I/usr/kde/3.5/include -I/usr/qt/3/include -I. 
-I/usr/kde/3.5/include  -DQT_THREAD_SUPPORT  -D_REENTRANT  -Wno-long-long
-Wundef -ansi -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -Wcast-align -Wchar-subscripts
-Wall -W -Wpointer-arith -DNDEBUG -DNO_DEBUG -O2 -march=native -O2
-fomit-frame-pointer -pipe -Wformat-security -Wmissing-format-attribute
-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 -DQT_CLEAN_NAMESPACE -fexceptions -w  -c -o
libgreycstoration_la.all_cpp.lo libgreycstoration_la.all_cpp.cpp
==========================================================
Comment 1 caulier.gilles 2008-06-03 09:55:24 UTC
This problem have been already reported here. It's fully relevant of CImg.h file taken from CImg library verion 1.2.8 which do not compile fine under GCC 4.3

Please report this problem into CImg bugzilla.

http://cimg.sourceforge.net/

Thanks in advance.

Gilles Caulier
Comment 2 Deathwing00 2008-06-03 10:03:32 UTC
Reported: http://sourceforge.net/forum/message.php?msg_id=5004166
Comment 3 Andi Clemens 2008-06-03 13:07:58 UTC
Deathwing00,

to compile it anyway, set full debugging in configure like this:

./configure --prefix=<path_to_KDE> --enable-debug=full

No optimizations will be made and it should work fine. This is just a temporary solution, but it will work.
Comment 4 Rex Dieter 2008-06-03 14:13:13 UTC
fwiw, beta5 built fine here on fedora (f10/rawhide) using gcc-4.3.
Comment 5 Deathwing00 2008-06-04 08:23:27 UTC
Seems to fail to compile with -O3 and -O2, but it does work with -O1.
Comment 6 Andi Clemens 2008-06-04 09:02:42 UTC
I'm not sure if it really hangs or if it just takes too long, I once was able to compile beta5 with standard settings (-O3) and it took only 1 minute (not the whole application :-) only the greycstoration part).
So nobody actually seems to know what is going wrong here, some distributions with gcc-4.3 compile fine, others don't.
Another possibility is to go into the specific folder (libs/greycstoration) and call make from in there without optimizations. Then go back to the digikam root folder and compile the rest with the optimizations you like to have set. This way it should compile fine, too.
Comment 7 caulier.gilles 2008-06-04 10:09:31 UTC
SVN commit 816533 by cgilles:

disable final options to compile CImg.h version 1.2.8.
This is a temporally solution util a fix is apply to CImg
CCBUGS: 163118


 M  +5 -0      Makefile.am  


WebSVN link: http://websvn.kde.org/?view=rev&revision=816533
Comment 8 Mark Purcell 2008-06-06 12:17:34 UTC
On some arch's it fails and other it succeeds:
http://experimental.debian.net/build.php?pkg=digikam
2:0.9.4~beta5-1 (amd64) (latest build at May 31 01:57: maybe-successful)
2:0.9.4~beta5-1 (i386) (latest build at May 31 02:07: maybe-successful)
2:0.9.4~beta5-1 (alpha) (latest build at May 31 03:27: maybe-successful)
2:0.9.4~beta5-1 (ia64) (latest build at May 31 04:10: maybe-failed)
2:0.9.4~beta5-1 (s390) (latest build at May 31 04:14: maybe-failed)
2:0.9.4~beta5-1 (sparc) (latest build at May 31 05:07: maybe-failed)
2:0.9.4~beta5-1 (hppa) (latest build at May 31 20:40: maybe-failed)
2:0.9.4~beta5-1 (mipsel) (latest build at Jun 2 07:57: maybe-failed)

With gcc-4.2 it builds fine, I presume with the patch they will build fine too.
Comment 10 caulier.gilles 2008-06-15 19:26:09 UTC
Andi,

Talking with MAndriva team today, it sound like to use this directive : 

export CXXFLAGS="%optflags -fno-tree-pre

...before to compile fix the problem with gcc 4.3.x. Can you confirm this ?

Gilles Caulier
Comment 11 caulier.gilles 2008-06-15 19:31:36 UTC
SVN commit 820890 by cgilles:

try to fix broken compilation with GCC 4.3.x
CCBUGS: 163118


 M  +3 -5      Makefile.am  


WebSVN link: http://websvn.kde.org/?view=rev&revision=820890
Comment 12 Andi Clemens 2008-06-15 19:45:21 UTC
Hi,

I went into digikam/libs/greycstoration, running "make clean". Then I started "make -f Makefile.cvs && ./configure --prefix=/opt/kde --enable-final" to generate the new makefiles.
After that I went back to digikam/libs/greycstoration and "make" took 20 seconds... so it seems to work for me.
Comment 13 caulier.gilles 2008-06-16 12:22:48 UTC
Thanks Andy. I can close this file now.

Gilles
Comment 14 caulier.gilles 2008-06-16 12:24:23 UTC
SVN commit 821084 by cgilles:

updtae
BUG: 163118


 M  +1 -1      NEWS  


WebSVN link: http://websvn.kde.org/?view=rev&revision=821084
Comment 15 Andi Clemens 2008-06-16 12:29:49 UTC
Yesterday a new version of gcc arrived in Archlinux (gcc-4.3.1), but this seems to compile well, too. So I think it is ok to close it...