Hello,
We (Fedora) have blender 2.79b failing to build from source with GCC 9 in
Fedora 30 and Rawhide.
See log: https://kojipkgs.fedoraproject.org/work/tasks/9457/33889457/build.log
After investigation, this is caused by a change in GCC 9 as noted in the
"Porting to GCC 9" page:
>OpenMP data sharing
>GCC releases before 9 were implementing an OpenMP 3.1 data sharing rule that
>const qualified variables without mutable member are predetermined shared,
>but as an exception may be specified in the firstprivate clause. OpenMP 4.0
>dropped this rule, but in the hope that the incompatible change will be
>reverted GCC kept implementing the previous behavior. Now that for OpenMP 5.0
>it has been confirmed this is not going to change, 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. In C++, const variables with constant initializers which are not odr-
>used in the region, but replaced with their constant initializer are not
>considered to be referenced in the region for default(none) purposes.
https://gcc.gnu.org/gcc-9/porting_to.html#ompdatasharing
This patch solves the build failure by dropping the default(none) clause in
intern/elbeem/intern/solver_main.cpp.
Here's a link to a successful build with this patch applied:
https://koji.fedoraproject.org/koji/taskinfo?taskID=33898420
Best regards,
Robert-André
ps: please don't ask me to register to https://developer.blender.org/ to
upload this patch.
From b61af886ca3fb760831c96b641968c78ea242614 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Robert-Andr=C3=A9=20Mauchin?= <[email protected]>
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 <[email protected]>
---
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 9fdefc7cc2a..97b4c109e1f 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
_______________________________________________
Bf-committers mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-committers