pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/graphics/blender blender: fix build with gcc-9



details:   https://anonhg.NetBSD.org/pkgsrc/rev/d99d8c9966c5
branches:  trunk
changeset: 335941:d99d8c9966c5
user:      markd <markd%pkgsrc.org@localhost>
date:      Wed Jul 03 10:21:08 2019 +0000

description:
blender: fix build with gcc-9

GCC 9 started implementing the OpenMP 4.0 and later behavior. When not using
default clause or when using default(shared), this makes no difference, but
if using default(none), previously the choice was not specify the const
qualified variables on the construct at all, or specify in firstprivate
clause. In GCC 9 as well as for OpenMP 4.0 compliance, those variables need
to be specified on constructs in which they are used, either in shared or
in firstprivate clause. Specifying them in firstprivate clause is one way to
achieve compatibility with both older GCC versions and GCC 9,
another option is to drop the default(none) clause.

This patch thus drops the default(none) clause.

See https://gcc.gnu.org/gcc-9/porting_to.html#ompdatasharing

patch from fedora.

diffstat:

 graphics/blender/distinfo                                           |   3 +-
 graphics/blender/patches/patch-intern_elbeem_intern_solver_main.cpp |  57 ++++++++++
 2 files changed, 59 insertions(+), 1 deletions(-)

diffs (78 lines):

diff -r 1454e39653f8 -r d99d8c9966c5 graphics/blender/distinfo
--- a/graphics/blender/distinfo Wed Jul 03 10:06:50 2019 +0000
+++ b/graphics/blender/distinfo Wed Jul 03 10:21:08 2019 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.51 2019/03/27 11:05:57 markd Exp $
+$NetBSD: distinfo,v 1.52 2019/07/03 10:21:08 markd Exp $
 
 SHA1 (blender-2.79b.tar.gz) = 4fd307ccfd1d6df5cc1898009712d4b1ae35430f
 RMD160 (blender-2.79b.tar.gz) = 787fc2ee718157aa95ffcced4935355d3086ca0d
@@ -10,6 +10,7 @@
 SHA1 (patch-extern_glog_src_config__netbsd.h) = be4727135b8fe1ddbcb5ad52f8230aec51a1a909
 SHA1 (patch-extern_glog_src_utilities.h) = c78ef191ab6ec7e65837b88468a7e1b8eaf325d3
 SHA1 (patch-intern_cycles_util_util_sseb.h) = 5d5bf8d71a443b63959ec79072e458f1a43cde94
+SHA1 (patch-intern_elbeem_intern_solver_main.cpp) = 2dca2892e5f71742785fc34c20738c6b61dbfa8b
 SHA1 (patch-intern_guardedalloc_intern_mallocn__intern.h) = c7bc89af1c03b50ae0bd8af5aacc25cd82dfcbfc
 SHA1 (patch-intern_itasc_kdl_tree.hpp) = b0c6640853ace08c07b443ff8f18290367f1d8da
 SHA1 (patch-source_blender_imbuf_intern_dds_DirectDrawSurface.cpp) = b38f61900aa30b02479c7397062d71d295932847
diff -r 1454e39653f8 -r d99d8c9966c5 graphics/blender/patches/patch-intern_elbeem_intern_solver_main.cpp
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/blender/patches/patch-intern_elbeem_intern_solver_main.cpp       Wed Jul 03 10:21:08 2019 +0000
@@ -0,0 +1,57 @@
+$NetBSD: patch-intern_elbeem_intern_solver_main.cpp,v 1.1 2019/07/03 10:21:08 markd Exp $
+
+From b61af886ca3fb760831c96b641968c78ea242614 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Robert-Andr=C3=A9=20Mauchin?= <zebob.m%gmail.com@localhost>
+Date: Wed, 3 Apr 2019 01:36:52 +0200
+Subject: [PATCH] Fix for GCC9 new OpenMP data sharing
+
+GCC 9 started implementing the OpenMP 4.0 and later behavior. When not using
+default clause or when using default(shared), this makes no difference, but
+if using default(none), previously the choice was not specify the const
+qualified variables on the construct at all, or specify in firstprivate
+clause. In GCC 9 as well as for OpenMP 4.0 compliance, those variables need
+to be specified on constructs in which they are used, either in shared or
+in firstprivate clause. Specifying them in firstprivate clause is one way to
+achieve compatibility with both older GCC versions and GCC 9,
+another option is to drop the default(none) clause.
+
+This patch thus drops the default(none) clause.
+
+See https://gcc.gnu.org/gcc-9/porting_to.html#ompdatasharing
+
+Signed-off-by: Robert-André Mauchin <zebob.m%gmail.com@localhost>
+
+diff --git a/intern/elbeem/intern/solver_main.cpp b/intern/elbeem/intern/solver_main.cpp
+index 9fdefc7cc2a..97b4c109e1f 100644
+--- intern/elbeem/intern/solver_main.cpp
++++ intern/elbeem/intern/solver_main.cpp
+@@ -381,7 +381,7 @@ LbmFsgrSolver::mainLoop(const int lev)
+       GRID_REGION_INIT();
+ #if PARALLEL==1
+       const int gDebugLevel = ::gDebugLevel;
+-#pragma omp parallel default(none) num_threads(mNumOMPThreads) \
++#pragma omp parallel num_threads(mNumOMPThreads) \
+   reduction(+: \
+         calcCurrentMass,calcCurrentVolume, \
+               calcCellsFilled,calcCellsEmptied, \
+@@ -1126,7 +1126,7 @@ LbmFsgrSolver::preinitGrids()
+               GRID_REGION_INIT();
+ #if PARALLEL==1
+       const int gDebugLevel = ::gDebugLevel;
+-#pragma omp parallel default(none) num_threads(mNumOMPThreads) \
++#pragma omp parallel num_threads(mNumOMPThreads) \
+   reduction(+: \
+         calcCurrentMass,calcCurrentVolume, \
+               calcCellsFilled,calcCellsEmptied, \
+@@ -1164,7 +1164,7 @@ LbmFsgrSolver::standingFluidPreinit()
+       GRID_REGION_INIT();
+ #if PARALLEL==1
+       const int gDebugLevel = ::gDebugLevel;
+-#pragma omp parallel default(none) num_threads(mNumOMPThreads) \
++#pragma omp parallel num_threads(mNumOMPThreads) \
+   reduction(+: \
+         calcCurrentMass,calcCurrentVolume, \
+               calcCellsFilled,calcCellsEmptied, \
+-- 
+2.20.1
+



Home | Main Index | Thread Index | Old Index