Skip to content

Instantly share code, notes, and snippets.

@oshimaya
Created April 17, 2022 23:53
Show Gist options
  • Save oshimaya/a933d8b5f7bb12648e24e35026a973ab to your computer and use it in GitHub Desktop.
Save oshimaya/a933d8b5f7bb12648e24e35026a973ab to your computer and use it in GitHub Desktop.
Fix build error in darktable 3.6.1 on NetBSD
--- src/develop/masks/circle.c.orig 2021-09-10 06:20:12.000000000 +0000
+++ src/develop/masks/circle.c
@@ -1110,7 +1110,7 @@ static int _circle_get_mask_roi(const dt
dt_omp_firstprivate(circpts, centerx, centery, total) \
dt_omp_sharedconst(circ) schedule(static) if(circpts/8 > 1000)
#else
-#pragma omp parallel for shared(points) schedule(static)
+#pragma omp parallel for sharedconst(circ) schedule(static)
#endif
#endif
for(int n = 0; n < circpts / 8; n++)
@@ -1211,7 +1211,7 @@ static int _circle_get_mask_roi(const dt
dt_omp_sharedconst(points) \
schedule(static) collapse(2) if(bbw*bbh > 50000)
#else
-#pragma omp parallel for shared(points)
+#pragma omp parallel for sharedconst(points) schedule(static)
#endif
#endif
for(int j = bbym; j <= bbYM; j++)
@@ -1252,7 +1252,7 @@ static int _circle_get_mask_roi(const dt
dt_omp_sharedconst(points) \
schedule(static) collapse(2) if(bbh*bbw > 50000) num_threads(MIN(darktable.num_openmp_threads,(h*
w)/20000))
#else
-#pragma omp parallel for shared(points)
+#pragma omp parallel for sharedconst(points) schedule(static)
#endif
#endif
for(int j = 0; j < bbh; j++)
@@ -1285,7 +1285,7 @@ static int _circle_get_mask_roi(const dt
dt_omp_firstprivate(grid, bbxm, bbym, bbw, endx, endy, w) \
dt_omp_sharedconst(buffer, points) schedule(static)
#else
-#pragma omp parallel for shared(buffer)
+#pragma omp parallel for sharedconst(buffer, points) schedule(static)
#endif
#endif
for(int j = bbym * grid; j < endy; j++)
--- src/develop/masks/ellipse.c.orig 2021-09-10 06:20:12.000000000 +0000
+++ src/develop/masks/ellipse.c
@@ -1961,7 +1961,7 @@ static int _ellipse_get_mask_roi(const d
dt_omp_firstprivate(ellpts, center, ta, tb, cosa, sina) \
shared(ell)
#else
-#pragma omp parallel for shared(points)
+#pragma omp parallel for shared(ell)
#endif
#endif
for(int n = 0; n < ellpts; n++)
@@ -2133,7 +2133,7 @@ static int _ellipse_get_mask_roi(const d
dt_omp_firstprivate(grid, bbxm, bbym, bbw, endx, endy, w) \
shared(buffer, points)
#else
-#pragma omp parallel for shared(buffer)
+#pragma omp parallel for shared(buffer, points)
#endif
#endif
for(int j = bbym * grid; j < endy; j++)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment