[packages/ufraw] - added openmp patch (fix gcc 9+ OpenMP compatibility); release 12

qboosh qboosh at pld-linux.org
Fri Dec 11 21:59:13 CET 2020


commit 4a9526824c1707463a33b18d49b53b7368e20c23
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Fri Dec 11 21:59:44 2020 +0100

    - added openmp patch (fix gcc 9+ OpenMP compatibility); release 12

 ufraw-openmp.patch | 103 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 ufraw.spec         |   4 ++-
 2 files changed, 106 insertions(+), 1 deletion(-)
---
diff --git a/ufraw.spec b/ufraw.spec
index 6b6175c..f06296d 100644
--- a/ufraw.spec
+++ b/ufraw.spec
@@ -7,7 +7,7 @@ Summary:	RAW photo loader
 Summary(pl.UTF-8):	Narzędzie do wczytywania zdjęć w formacie RAW
 Name:		ufraw
 Version:	0.22
-Release:	12
+Release:	13
 License:	GPL v2+
 Group:		Applications/Graphics
 Source0:	http://downloads.sourceforge.net/ufraw/%{name}-%{version}.tar.gz
@@ -18,6 +18,7 @@ Patch2:		ufraw-lf-destroy.patch
 Patch3:		ufraw-multipliers.patch
 Patch4:		exiv2-0.27.patch
 Patch5:		%{name}-include.patch
+Patch6:		%{name}-openmp.patch
 URL:		http://ufraw.sourceforge.net/
 BuildRequires:	automake
 BuildRequires:	bzip2-devel
@@ -111,6 +112,7 @@ Wtyczka GIMP-a do wczytywania zdjęć w formacie RAW.
 %patch3 -p1
 %patch4 -p1
 %patch5 -p1
+%patch6 -p1
 
 %build
 cp -f /usr/share/automake/mkinstalldirs .
diff --git a/ufraw-openmp.patch b/ufraw-openmp.patch
new file mode 100644
index 0000000..8e59ea6
--- /dev/null
+++ b/ufraw-openmp.patch
@@ -0,0 +1,103 @@
+* gcc >= 9 requires all const variables to be specified as shared
+* gcc < 9 doesn't allow const variables to be specified as shared
+* to maintain compatibility with both: specify as shared and drop const
+--- ufraw-0.22/dcraw_api.cc.orig	2015-06-16 05:58:38.000000000 +0200
++++ ufraw-0.22/dcraw_api.cc	2020-12-11 21:50:57.735071017 +0100
+@@ -680,14 +680,14 @@
+      */
+     void dcraw_finalize_raw(dcraw_data *h, dcraw_data *dark, int rgbWB[4])
+     {
+-        const int pixels = h->raw.width * h->raw.height;
+-        const unsigned black = dark ? MAX(h->black - dark->black, 0) : h->black;
++        int pixels = h->raw.width * h->raw.height;
++        unsigned black = dark ? MAX(h->black - dark->black, 0) : h->black;
+         if (h->colors == 3)
+             rgbWB[3] = rgbWB[1];
+         if (dark) {
+ #ifdef _OPENMP
+             #pragma omp parallel for schedule(static) default(none) \
+-            shared(h,dark,rgbWB)
++            shared(h,dark,rgbWB,pixels,black)
+ #endif
+             for (int i = 0; i < pixels; i++) {
+                 int cc;
+@@ -700,7 +700,7 @@
+         } else {
+ #ifdef _OPENMP
+             #pragma omp parallel for schedule(static) default(none) \
+-            shared(h,dark,rgbWB)
++            shared(h,dark,rgbWB,pixels,black)
+ #endif
+             for (int i = 0; i < pixels; i++) {
+                 int cc;
+--- ufraw-0.22/dcraw_indi.c.orig	2015-06-16 05:58:38.000000000 +0200
++++ ufraw-0.22/dcraw_indi.c	2020-12-11 21:52:43.514497960 +0100
+@@ -115,16 +115,16 @@
+ }
+ 
+ void CLASS wavelet_denoise_INDI(ushort(*image)[4], const int black,
+-                                const int iheight, const int iwidth,
++                                int iheight, int iwidth,
+                                 const int height, const int width,
+                                 const int colors, const int shrink,
+-                                const float pre_mul[4], const float threshold,
++                                const float pre_mul[4], float threshold,
+                                 const unsigned filters)
+ {
+     float *fimg = 0, thold, mul[2], avg, diff;
+     int size, lev, hpass, lpass, row, col, nc, c, i, wlast;
+     ushort *window[4];
+-    static const float noise[] =
++    static float noise[] =
+     { 0.8002, 0.2735, 0.1202, 0.0585, 0.0291, 0.0152, 0.0080, 0.0044 };
+ 
+ //  dcraw_message (dcraw, DCRAW_VERBOSE,_("Wavelet denoising...\n")); /*UF*/
+@@ -143,7 +143,7 @@
+ #else
+     #pragma omp parallel for				\
+     default(none)					\
+-    shared(nc,image,size)				\
++    shared(nc,image,size,noise,iwidth,iheight,threshold) \
+     private(c,i,hpass,lev,lpass,row,col,thold,fimg,temp)
+ #endif
+ #endif
+@@ -337,8 +337,8 @@
+    I've extended the basic idea to work with non-Bayer filter arrays.
+    Gradients are numbered clockwise from NW=0 to W=7.
+  */
+-void CLASS vng_interpolate_INDI(ushort(*image)[4], const unsigned filters,
+-                                const int width, const int height, const int colors, void *dcraw, dcraw_data *h) /*UF*/
++void CLASS vng_interpolate_INDI(ushort(*image)[4], unsigned filters,
++                                int width, int height, int colors, void *dcraw, dcraw_data *h) /*UF*/
+ {
+     static const signed char *cp, terms[] = {
+         -2, -2, +0, -1, 0, 0x01, -2, -2, +0, +0, 1, 0x01, -2, -1, -1, +0, 0, 0x01,
+@@ -414,7 +414,7 @@
+ #ifdef _OPENMP
+     #pragma omp parallel				\
+     default(none)					\
+-    shared(image,code,prow,pcol,h)			\
++    shared(image,code,prow,pcol,h,height,width,filters,colors)	\
+     private(row,col,g,brow,rowtmp,pix,ip,gval,diff,gmin,gmax,thold,sum,color,num,c,t)
+ #endif
+     {
+@@ -483,8 +483,8 @@
+ /*
+    Patterned Pixel Grouping Interpolation by Alain Desbiolles
+ */
+-void CLASS ppg_interpolate_INDI(ushort(*image)[4], const unsigned filters,
+-                                const int width, const int height,
++void CLASS ppg_interpolate_INDI(ushort(*image)[4], unsigned filters,
++                                int width, int height,
+                                 const int colors, void *dcraw, dcraw_data *h)
+ {
+     int dir[5] = { 1, width, -1, -width, 1 };
+@@ -497,7 +497,7 @@
+ #ifdef _OPENMP
+     #pragma omp parallel				\
+     default(none)					\
+-    shared(image,dir,diff)				\
++    shared(image,dir,diff,height,width,filters)		\
+     private(row,col,i,d,c,pix,guess)
+ #endif
+     {
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/ufraw.git/commitdiff/4a9526824c1707463a33b18d49b53b7368e20c23



More information about the pld-cvs-commit mailing list