On Mon, Feb 11, 2019 at 07:17:25PM -0700, Orion Poplawski wrote:
Looks like GCC 9 is finally enforcing an OpenMP change:
From
https://gcc.gnu.org/ml/gcc-patches/2018-11/msg00628.html
Please see
https://gcc.gnu.org/gcc-9/porting_to.html#ompdatasharing
which documents what you can do and what works with both compilers and what
doesn't.
GCC 8 complains about just adding fp_stderr to shared():
nco_omp.c: In function 'nco_openmp_ini':
nco_omp.c:205:43: error: 'fp_stderr' is predetermined 'shared' for
'shared'
# pragma omp parallel default(none) shared(fp_stderr,thr_nbr_act)
Yes, either you want firstprivate(fp_stderr), or drop default(none) if you
want to make it work with both compilers.
And apparently complains if you drop default(none) as well (from
another
project with the same problem):
[ 9%] Building CXX object CMakeFiles/_CuraEngine.dir/src/layerPart.cpp.o
/home/ruben/Projects/CuraEngine/src/layerPart.cpp: In function ‘void
cura::createLayerParts(cura::SliceMeshStorage&, cura::Slicer*)’:
/home/ruben/Projects/CuraEngine/src/layerPart.cpp:52:78: error:
‘total_layers’ is predetermined ‘shared’ for ‘shared’
#pragma omp parallel for shared(mesh, slicer, total_layers)
schedule(dynamic)
That is with GCC 8 or earlier, right? Just leave total_layers out
of the shared clause.
Jakub