[R-SIG-Mac] OpenMP on CRAN

Kevin Ushey kev|nu@hey @end|ng |rom gm@||@com
Thu Apr 2 19:04:47 CEST 2020


For what it's worth, it looks like it is still possible to use OpenMP
on macOS with the system toolchain. Using the example file here:


I can compile + link + run this on macOS 10.15.4 and with:

$ /usr/bin/clang -Xpreprocessor -fopenmp
-I/usr/local/opt/libomp/include -L/usr/local/opt/libomp/lib -lomp

As for whether this is 'safe', or whether R could conceivably bundle
and use its own copy of libomp is a separate question I cannot answer.
But at least this is a mechanism for enterprising users to enable
OpenMP in packages built from source if they so desire.


On Thu, Apr 2, 2020 at 6:01 AM BATES Timothy <tim.bates using ed.ac.uk> wrote:
> Moving to a compiler that drops support for OpenMP seems a sad choice, especially now we’ve all climbed the learning curve of the non-Apple compiler (the real barrier was lack of a pkg installer and that’s done now).
> Losing OpenMP for the CRAN version of OpenMx/umx (our SEM packages) would be a big loss for users (for whom the CRAN version now supports OpenMP giving them a 2-12x speed up). In general, R on Mac is made more viable by having OpenMP
> Re Brian’s points, I’d say that the distribution problem is crucial: Packages not on CRAN have dramatically diminished accessibility/useage.
> Second, a great range of compute-intensive problems are amenable to division amongst cores, including nearly all models that take more than a nominal amount of time to run: So simulations, CIs, bootstrapping, nearly everything in genetics all speeds up.
> I’d say especially on desktop/laptop. The big advantage of multi blade systems requires snowfall-type solutions, but desktops profit automatically from their multi-core structure and don;’t have multiple processors (except graphics, which no-one seems to be exploiting on CRAN-style R), so OpenMP is their one trick. I’d hope not to lose it.
> Best, t
> > On 2 Apr 2020, at 05:18, Prof Brian Ripley <ripley using stats.ox.ac.uk> wrote:
> >
> > On 01/04/2020 22:02, Simon Urbanek wrote:
> >> JJB,
> >> 1. correct, there was too much trouble in this. But please feel free to start a new thread about this here if you have strong opinions.
> >
> > Also note that it is possible (and not hard) to install packages from source with an OpenMP-supporting compiler, and how to do so is in the R-admin manual.  The problems come in distributing them.
> >
> > The benefits of OpenMP are often overestimated, especially on desktop/laptop level hardware.  But it is available for the small (tiny?) proportion of users who need it.
> The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336.
> _______________________________________________
> R-SIG-Mac mailing list
> R-SIG-Mac using r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-mac

More information about the R-SIG-Mac mailing list