diff options
author | markd <markd@pkgsrc.org> | 2019-07-03 10:21:08 +0000 |
---|---|---|
committer | markd <markd@pkgsrc.org> | 2019-07-03 10:21:08 +0000 |
commit | ecf1abda121e13082ce42c7e07737d648dbf36a7 (patch) | |
tree | faaba36e33bb03eb33408b5d60c930156b4a6459 /graphics | |
parent | 1187c38fbf72be15d8e3c27f8f5e0329f449f9a0 (diff) | |
download | pkgsrc-ecf1abda121e13082ce42c7e07737d648dbf36a7.tar.gz |
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 (limited to 'graphics')
-rw-r--r-- | graphics/blender/distinfo | 3 | ||||
-rw-r--r-- | graphics/blender/patches/patch-intern_elbeem_intern_solver_main.cpp | 57 |
2 files changed, 59 insertions, 1 deletions
diff --git a/graphics/blender/distinfo b/graphics/blender/distinfo index e534874579e..fef51bfe915 100644 --- a/graphics/blender/distinfo +++ b/graphics/blender/distinfo @@ -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.h) = 9666c5d925cfeebeef2f178418c9fc2403831da1 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 --git a/graphics/blender/patches/patch-intern_elbeem_intern_solver_main.cpp b/graphics/blender/patches/patch-intern_elbeem_intern_solver_main.cpp new file mode 100644 index 00000000000..f68a6ae10cc --- /dev/null +++ b/graphics/blender/patches/patch-intern_elbeem_intern_solver_main.cpp @@ -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> +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> + +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 + |