[R-pkg-devel] Bug? Makevars ignores FC=mpif90

peter dalgaard pdalgd at gmail.com
Mon Aug 10 20:35:37 CEST 2015


> On 10 Aug 2015, at 19:47 , Ignacio Martinez <ignacio82 at gmail.com> wrote:
> 
> Thanks peter.
> 
> 1. Does it say anywhere that the build process should use src/Makevars?
> I'm not sure, where should it say that? I'm using the default options in Rstudio to create a package

It actually is discussed in Writing R Extensions. (I was half-expecting it not to be there.)  But you should read it very carefully, in particular the sections about which variables you want to set in it, and which ones you do not.

In very concrete terms, notice that src/Makevars is read _before_ $RHOME/etc/Makeconf. The latter sets FC, so overwrites whatever it was set to in src/Makevars.

> 2. Also notice that an important part of the package concept is that packages can be distributed.
> The package that i want to build uses MPI. Is that a problem? My understanding is that in order to use MPI i have to set FC to mpif90. Is that wrong?

It's wrong (or at least not right) to set it in the package sources, because someone else might have to set FC differently.

> 3. build configuration belongs in the build environment
> I'm not sure if I follow. What is the correct way of telling Rstudio that the package i'm building uses MPI?

Wouldn't know. You already know how to do it by settings in a personal Makevars file. It is not obvious that there is a general way of specifying that one needs to use a special kind of compiler.

-pd

> Thanks again!
> 
> PS: This is the link to my question in stack-overflow
> 
> 
> 
> On Mon, Aug 10, 2015 at 1:41 PM peter dalgaard <pdalgd at gmail.com> wrote:
> 
> > On 10 Aug 2015, at 19:25 , Ignacio Martinez <ignacio82 at gmail.com> wrote:
> >
> > Hi,
> >
> > I'm learning to develop R packages that use Fortran (and MPI). I recently
> > asked a question on stack-overflow and I was told to contact this list with
> > a followup question.
> >
> > When I add to src/Makevars the follwoing line
> >
> > FC=mpif90
> >
> > Rstudio ignores it when I click `Build and Reload`.  But, if I create a
> > Makevars file in a .R/ directory in my$HOME directory with that line,
> > Rstudio uses mpif90.
> >
> > Is the fact that R is ignoring the src/Makevars a bug? If not, am I doing
> > something wrong?
> >
> 
> Ask differently: Does it say anywhere that the build process should use src/Makevars?
> 
> Also notice that an important part of the package concept is that packages can be distributed. The recipient's Fortran compiler is not necessarily "mpif90". So, generally speaking, build configuration belongs in the build environment, not in the package.
> 
> -pd
> 
> > Thanks,
> >
> > Ignacio
> >
> >
> > PS: I hope this is the right place to ask this question.
> >
> >       [[alternative HTML version deleted]]
> >
> > ______________________________________________
> > R-package-devel at r-project.org mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-package-devel
> 
> --
> Peter Dalgaard, Professor,
> Center for Statistics, Copenhagen Business School
> Solbjerg Plads 3, 2000 Frederiksberg, Denmark
> Phone: (+45)38153501
> Email: pd.mes at cbs.dk  Priv: PDalgd at gmail.com
> 
> 
> 
> 
> 
> 
> 
> 

-- 
Peter Dalgaard, Professor,
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Email: pd.mes at cbs.dk  Priv: PDalgd at gmail.com



More information about the R-package-devel mailing list