Bug 257329 - build fails - openmp flags
Summary: build fails - openmp flags
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Plugin-DImg-RAW (show other bugs)
Version: 1.5.0
Platform: Compiled Sources Solaris
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-19 15:55 UTC by tropikhajma
Modified: 2012-06-27 10:40 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 1.6.0


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description tropikhajma 2010-11-19 15:55:04 UTC
Version:           unspecified (using Devel) 
OS:                Solaris

build of kdegraphics with the Sun Studio 12.1 compiler fails with 
...
Undefined			first referenced
 symbol  			    in file
__mt_WorkSharing_cxt_               CMakeFiles/unprocessed_raw.dir/__/libraw/internal/dcraw_common.o
__mt_get_next_chunk_invoke_mfunc_once_int_ CMakeFiles/unprocessed_raw.dir/__/libraw/internal/dcraw_common.o
omp_get_thread_num                  CMakeFiles/unprocessed_raw.dir/__/libraw/internal/dcraw_common.o
__mt_MasterFunction_cxt_            CMakeFiles/unprocessed_raw.dir/__/libraw/internal/dcraw_common.o
ld: fatal: symbol referencing errors. No output written to unprocessed_raw

(http://my.cdash.org/viewBuildError.php?buildid=116203)

this is because Sun Studio uses different flags for OpenMP

the below patch fixes it:
Index: libs/libkdcraw/CMakeLists.txt
===================================================================
--- libs/libkdcraw/CMakeLists.txt       (revision 1198513)
+++ libs/libkdcraw/CMakeLists.txt       (working copy)
@@ -106,9 +106,12 @@
 
 IF(OPENMP_FOUND)
     ADD_DEFINITIONS(${OpenMP_CXX_FLAGS})
-    IF(CMAKE_COMPILER_IS_GNUCXX)
+    IF("${CMAKE_CXX_COMPILER_ID}" STREQUAL GNU )
         SET(OPENMP_LDFLAGS "-lgomp")
-    ENDIF(CMAKE_COMPILER_IS_GNUCXX)
+    ENDIF("${CMAKE_CXX_COMPILER_ID}" STREQUAL GNU )
+    IF("${CMAKE_C_COMPILER_ID}" STREQUAL SunPro )
+        SET(OPENMP_LDFLAGS "-xopenmp")
+    ENDIF("${CMAKE_C_COMPILER_ID}" STREQUAL SunPro )
 ENDIF(OPENMP_FOUND)
 
 # Flag to debug LibRaw


(the same failure in libs/libkdcraw/test/raw2png remains)

Reproducible: Always
Comment 1 caulier.gilles 2010-11-22 10:07:35 UTC
SVN commit 1199532 by cgilles:

apply patch to compile fine libkdcraw with openmp under Solaris
BUGS: 257329


 M  +5 -2      CMakeLists.txt  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1199532
Comment 2 caulier.gilles 2010-11-22 12:34:26 UTC
SVN commit 1199679 by cgilles:

same similar patch need to be applied to ExpoBlending tool about openmp.
CCBUGS: 257329


 M  +7 -3      CMakeLists.txt  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1199679
Comment 3 caulier.gilles 2010-11-22 12:36:02 UTC
SVN commit 1199681 by cgilles:

do not handle openmp under macosx
CCBUGS: 257329


 M  +2 -2      CMakeLists.txt  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1199681
Comment 4 tropikhajma 2010-11-30 21:42:26 UTC
the below patch fixes the mentioned raw2png failure:

--- libs/libkdcraw/test/CMakeLists.txt.orig     2010-11-30 20:49:46.096351324 +0100
+++ libs/libkdcraw/test/CMakeLists.txt  2010-11-30 20:50:45.080015887 +0100
@@ -30,7 +30,7 @@
 
 SET(raw2png_SRCS raw2png.cpp)
 KDE4_ADD_EXECUTABLE(raw2png NOGUI ${raw2png_SRCS})
-TARGET_LINK_LIBRARIES(raw2png kdcraw ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY})
+TARGET_LINK_LIBRARIES(raw2png kdcraw ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${OPENMP_LDFLAGS} )
 
 LIBKDCRAW_BUILD_TEST(simple_dcraw)
 LIBKDCRAW_BUILD_TEST(mem_image)
Comment 5 caulier.gilles 2010-11-30 21:54:21 UTC
SVN commit 1202426 by cgilles:

compile under Solaris with OpenMP
CCBUGS: 257329 


 M  +1 -1      CMakeLists.txt  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1202426