[R-sig-hpc] mpicc support for R packages
hyu at stats.uwo.ca
Fri Sep 23 17:09:45 CEST 2011
Thanks for the patch. If I understand correctly, we need to pursuit R
development term to change the default compiler to mpicc in case the
environment R_USE_MPI is detect (use your patch). On Rmpi part,
configure.ac needs to detect the environment R_USE_MPI at the beginning
and acts accordingly.
Once mpicc is used instead of cc, the compiling of Rmpi should be much
easier except auto loading package test at the end. Rmpi may not know all
additional libs during loading.
Michael Spiegel wrote:
> 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
> 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"
> 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.
> R-sig-hpc mailing list
> R-sig-hpc at r-project.org
Department of Statistics & Actuarial Sciences
The University of Western Ontario
London, Ontario N6A 5B7
More information about the R-sig-hpc