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

Michael Spiegel mspiegel at renci.org
Fri Sep 23 19:28:14 CEST 2011

Yes, this should be the plan to incorporate these changes.

-----Original Message-----
From: Hao Yu [mailto:hyu at stats.uwo.ca] 
Sent: Friday, September 23, 2011 11:10 AM
To: Michael Spiegel
Cc: r-sig-hpc at r-project.org
Subject: Re: [R-sig-hpc] mpicc support for R packages

Hi Michael,

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 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.
> Thanks,
> --Michael
> _______________________________________________
> R-sig-hpc mailing list
> R-sig-hpc at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-hpc

Department of Statistics & Actuarial Sciences Fax Phone#:(519)-661-3813 The University of Western Ontario Office Phone#:(519)-661-3622 London, Ontario N6A 5B7 http://www.stats.uwo.ca/faculty/yu

More information about the R-sig-hpc mailing list