On 2/12/19 1:02 AM, Jakub Jelinek wrote:
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.
Thanks for the reference.
> 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.
Okay. In this case we'll probably drop default(none). Many people have
gotten into the habit of using default(none) though in order to force
declaring the form of all variables.
> 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.
Right, because the default is to be shared. Thanks.
--
Orion Poplawski
Manager of NWRA Technical Systems 720-772-5637
NWRA, Boulder/CoRA Office FAX: 303-415-9702
3380 Mitchell Lane orion(a)nwra.com
Boulder, CO 80301
https://www.nwra.com/