Hi Mark, if you consider backward compatibility (and potential compatibility with other compilers) a worthy goal, you can easily reduce manually in a '#pragma omp critical' block. An example here (around the middle of the page):
http://www.parallelr.com/r-and-openmp-boosting-compiled-code-on-multi-core-cpu-s/ Cheers, Ott On Wed, Aug 3, 2016 at 1:13 AM, Mark van der Loo <mark.vander...@gmail.com> wrote: > Dear pkg developers, > > > I'm working on a package using C code and openMP. The package builds and > tests fine on my own machine[1] and also on r-hub[2]. However on travis-ci > the build crashes[3] with the following message (plus a few similar): > > gower.c:297:29: error: expected ‘+’, ‘*’, ‘-’, ‘&’, ‘^’, ‘|’, ‘&&’, or ‘||’ > before ‘min’ > > The line in question is an #omp pragma statement: > > #pragma omp for reduction(min:imin), reduction(max:imax) > > > I am using #pragma omp statements all over the place and this is the only > type causing crashes. I'm guessing it has something to do with travis > building on a 12.04 ubuntu VM with a rather old gcc (4.6.3). > > So I have two questions: > > 1. Has anyone else seen this? Or am I missing something? > 2. Is there a workaround, or should I just go for another build service > (which one)? > > Cheers, > Mark > > > [1] Linux duvel 4.4.0-31-generic #50-Ubuntu SMP Wed Jul 13 00:07:12 UTC > 2016 x86_64 x86_64 x86_64 GNU/Linux w/gcc 5.4.0, libgomp1.0.0 > [2] > > https://builder.r-hub.io/status/gower_0.0.1.tar.gz-8c487e92f4af364ee73f85ca8f59775c > [3] https://travis-ci.org/markvanderloo/gower#L619 > > [[alternative HTML version deleted]] > > ______________________________________________ > R-package-devel@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-package-devel -- Ott Toomet Visiting Researcher School of Information Mary Gates Hall, Suite 310 University of Washington Seattle, WA 98195 [[alternative HTML version deleted]] ______________________________________________ R-package-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel