#6 Fix build for GCC9 new OpenMP data sharing
Merged 2 years ago by luya. Opened 2 years ago by eclipseo.
rpms/ eclipseo/blender master  into  master

@@ -0,0 +1,61 @@ 

+ From 043c52d3d2df6f6d0780acd02a3dd4e25b7ba7f0 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

+ MIME-Version: 1.0

+ Content-Type: text/plain; charset=UTF-8

+ Content-Transfer-Encoding: 8bit

+ 

+ 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>

+ ---

+  intern/elbeem/intern/solver_main.cpp | 6 +++---

+  1 file changed, 3 insertions(+), 3 deletions(-)

+ 

+ diff --git a/intern/elbeem/intern/solver_main.cpp b/intern/elbeem/intern/solver_main.cpp

+ index 68f7c04cd54..514087b6130 100644

+ --- a/intern/elbeem/intern/solver_main.cpp

+ +++ b/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

+ 

file modified
+6 -1
@@ -22,7 +22,7 @@ 

  Name:       blender

  Epoch:      1

  Version:    %{blender_api}

- Release:    13%{?dist}

+ Release:    14%{?dist}

  

  Summary:    3D modeling, animation, rendering and post-production

  License:    GPLv2
@@ -56,6 +56,8 @@ 

  # Commit to make OpenGL_GL_PREFERENCES=GLVND work

  # https://developer.blender.org/rB0658d047a94a86060f039790898a80a7adb0dcd9

  Patch12:     blender-cmake_opengl.patch

+ # Patch to build with GCC9

+ Patch13:     0001-Fix-for-GCC9-new-OpenMP-data-sharing.patch

  

  # Development stuff

  BuildRequires:  boost-devel
@@ -314,6 +316,9 @@ 

  %{_fontbasedir}/%{name}/

  

  %changelog

+ * Wed Apr 03 01:33:05 CET 2019 Robert-André Mauchin <zebob.m@gmail.com> - 1:2.79b-14

+ - Fix build for GCC9 new OpenMP data sharing

+ 

  * Thu Mar 14 2019 Mohan Boddu <mboddu@bhujji.com> - 1:2.79b-13

  - Rebuild for OpenImageIO 2.0.5

  

Signed-off-by: Robert-André Mauchin zebob.m@gmail.com

This fix the build with GCC 9 for F30 and F31. I have yet to send the patch upstream, I'll send it on their ML when I'm approved.

Please build for F31 and F30 as some users can't upgrade because of this.

Pull-Request has been merged by luya

2 years ago