[R-sig-hpc] mpicc support for R packages

Michael Spiegel mspiegel at renci.org
Thu Sep 22 21:32:56 CEST 2011

Hi folks,

If you've ever looked at the configure.ac file for the Rmpi package, you'll see that it's 281 lines of scanning several environment variables and then attempting to set LDFLAGS and CPPFLAGS for the most popular MPI implementations. This prohibits non programming experts from installing the Rmpi package without knowledge of these environment variables and the correct values for these variables. An alternative would be to allow the package to compile with the "mpicc" compiler, which most MPI implementations provide as a wrapper with the correct library and include flags.

The package build system allows a package to specify additional compiler flags, but it does not allow the specification of a different compiler. I've written a patch that is targeted specifically for the "mpicc" compiler, this should avoid the issue of a package compiled with the "foobar" compiler when the interpreter was compiled with the "quux" compiler.

I've attached a 22 line patch to the svn trunk of the R development repository that allows a package to use the "mpicc" compiler by setting the environment variable "R_USE_MPI". I submitted an earlier patch to the R-devel mailing list, but I didn't hear anything back and that patch was broken (sorry). To test the new patch, I have been able to successfully compile with packages that use the R_USE_MPI variable and packages that do not use it. As R provides built-in support for OpenMP pragmas, this patch would help provide built-in support for MPI invocations as well.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://stat.ethz.ch/pipermail/r-sig-hpc/attachments/20110922/6b1d330f/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mpicc.patch
Type: application/octet-stream
Size: 2255 bytes
Desc: mpicc.patch
URL: <https://stat.ethz.ch/pipermail/r-sig-hpc/attachments/20110922/6b1d330f/attachment.obj>

More information about the R-sig-hpc mailing list