On Wednesday 26 May 2010, Pavel Heimlich, a.k.a. hajma wrote:
> Hi Alex,
>
> 2010/5/5 Alexander Neundorf <neund...@kde.org>:
> > I never used OpenMP, so I don't know.
> > For the time being I wouldn't oppose a patch to get kdegraphics
> > compiling.
>
> Attached is the patch that makes kdegraphics compile here.
> The part for libs/libkdcraw/test/CMakeLists.txt would need some
> IF-ing, I am not sure how to best handle it.

Attached is an updated version of the patch.
Can you please verify that it works for you ?
The -xopenmp flag depends on the compiler, not on the operating system, 
right ?

One thing I noticed when looking at the cmake output on my.cdash.org is that 
it says 
-- The C compiler identification is SunPro
-- The CXX compiler identification is Unknown

The problem here is the "Unknown" for the CXX compiler.
If you look in share/cmake-2.6/Modules/CMakeCXXCompilerId.cpp.in, you will 
see:

#elif defined(__SUNPRO_CC)
# define COMPILER_ID "SunPro"

This should be defined for the SunStudio compiler (also according to 
http://docs.sun.com/app/docs/doc/820-7599/6nirkt75m?l=en&a=view#bkaoe ).

Could you please try to find out whether this #elif matches in your case ?

Alex
Index: libs/libkdcraw/test/CMakeLists.txt
===================================================================
--- libs/libkdcraw/test/CMakeLists.txt	(revision 1130912)
+++ libs/libkdcraw/test/CMakeLists.txt	(working copy)
@@ -11,7 +11,7 @@
 
     # Disable dcraw C Ansi code warnings from LibRaw. Just to be clear on the console.
     FOREACH(_curentfile ${${_target}_SRCS})
-	SET_SOURCE_FILES_PROPERTIES(${_curentfile} PROPERTIES COMPILE_FLAGS -w)
+        SET_SOURCE_FILES_PROPERTIES(${_curentfile} PROPERTIES COMPILE_FLAGS -w)
     ENDFOREACH(_curentfile ${${_target}_SRCS})
 
     KDE4_ADD_EXECUTABLE(${_target} NOGUI ${${_target}_SRCS})
@@ -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 ${OPENMP_LDFLAGS} ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY})
 
 LIBKDCRAW_BUILD_TEST(simple_dcraw)
 LIBKDCRAW_BUILD_TEST(mem_image)
Index: libs/libkdcraw/libraw/libraw/libraw_types.h
===================================================================
--- libs/libkdcraw/libraw/libraw/libraw_types.h	(revision 1130912)
+++ libs/libkdcraw/libraw/libraw/libraw_types.h	(working copy)
@@ -105,7 +105,8 @@
                 colors,
                 bits;
 #ifdef LIBRAW_LIBRARY_BUILD
-#ifdef _OPENMP
+//this code does not conform to openmp specifications, does not build with Sun Studio
+#if defined(_OPENMP) && !defined(__SUNPRO_CC)
 #pragma omp firstprivate(colors,height,width)
 #endif
 #endif
@@ -139,7 +140,8 @@
     ushort      iheight,
                 iwidth;
 #ifdef LIBRAW_LIBRARY_BUILD
-#ifdef _OPENMP
+//this code does not conform to openmp specifications, does not build with Sun Studio
+#if defined(_OPENMP) && !defined(__SUNPRO_CC)
 #pragma omp firstprivate(iheight,iwidth)
 #endif
 #endif
@@ -222,7 +224,8 @@
     float       bright;         /* -b */
     float       threshold;      /*  -n */
 #ifdef LIBRAW_LIBRARY_BUILD
-#ifdef _OPENMP
+//this code does not conform to openmp specifications, does not build with Sun Studio
+#if defined(_OPENMP) && !defined(__SUNPRO_CC)
 #pragma omp firstprivate(threshold)
 #endif
 #endif
@@ -279,7 +282,8 @@
     libraw_masked_t             masked_pixels;
     ushort                      (*image)[4] ;
 #ifdef LIBRAW_LIBRARY_BUILD
-#ifdef _OPENMP
+//this code does not conform to openmp specifications, does not build with Sun Studio
+#if defined(_OPENMP) && !defined(__SUNPRO_CC)
 #pragma omp shared(image)
 #endif
 #endif
Index: libs/libkdcraw/CMakeLists.txt
===================================================================
--- libs/libkdcraw/CMakeLists.txt	(revision 1130912)
+++ libs/libkdcraw/CMakeLists.txt	(working copy)
@@ -91,9 +91,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
@@ -132,7 +135,7 @@
     INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/libkdcraw.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
 ENDIF(NOT WIN32)
 
-SUBDIRS(icons)
-SUBDIRS(libkdcraw)
-SUBDIRS(test)
-SUBDIRS(profiles)
+ADD_SUBDIRECTORY(icons)
+ADD_SUBDIRECTORY(libkdcraw)
+ADD_SUBDIRECTORY(test)
+ADD_SUBDIRECTORY(profiles)
_______________________________________________
Kde-buildsystem mailing list
Kde-buildsystem@kde.org
https://mail.kde.org/mailman/listinfo/kde-buildsystem

Reply via email to