Makevars CXX_STD variable ignored when no *.cpp files in src/

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Makevars CXX_STD variable ignored when no *.cpp files in src/

Radosław Piliszek
Hello!

I might have found a bug in the way that R handles Makevars file when
building a package.

Value of variable CXX_STD is ignored - i.e. R does not use the correct
compiler/flags - if there are no *.cpp files directly in the src/
directory (e.g. all *.cpp are in subdirectories, and OBJECTS variable
is set accordingly). Adding a bogus *.cpp file fixes this issue.
However, this is not very obvious (I would dare saying it is not
obvious at all) and I spent quite a time checking what went wrong
after I organized my src files better. :-)

Kind regards,
Radosław Piliszek

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: Makevars CXX_STD variable ignored when no *.cpp files in src/

Martyn Plummer-3
You are not the first person to report this, but last time when I tried
it myself I could not reproduce the bug. Let me try it again.

Martyn

On Fri, 2018-03-02 at 09:26 +0100, Radosław Piliszek wrote:

> Hello!
>
> I might have found a bug in the way that R handles Makevars file when
> building a package.
>
> Value of variable CXX_STD is ignored - i.e. R does not use the
> correct
> compiler/flags - if there are no *.cpp files directly in the src/
> directory (e.g. all *.cpp are in subdirectories, and OBJECTS variable
> is set accordingly). Adding a bogus *.cpp file fixes this issue.
> However, this is not very obvious (I would dare saying it is not
> obvious at all) and I spent quite a time checking what went wrong
> after I organized my src files better. :-)
>
> Kind regards,
> Radosław Piliszek
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: Makevars CXX_STD variable ignored when no *.cpp files in src/

Martyn Plummer-3
Radoslaw sent me a reproducible example. I have been able to identify
the problem and fix it. I have copied in Alexander Loboda who
previously reported the same problem.

Briefly, the tools package relied on the presence of files with
extension .cpp or .cc in the src directory to determine whether the C++
compiler is required. In the absence of any such files, the code to set
the C++ compiler flags correctly was never run.

Martyn

On Fri, 2018-03-02 at 09:42 +0000, Martyn Plummer wrote:

> You are not the first person to report this, but last time when I tried
> it myself I could not reproduce the bug. Let me try it again.
>
> Martyn
>
> On Fri, 2018-03-02 at 09:26 +0100, Radosław Piliszek wrote:
> > Hello!
> >
> > I might have found a bug in the way that R handles Makevars file when
> > building a package.
> >
> > Value of variable CXX_STD is ignored - i.e. R does not use the
> > correct
> > compiler/flags - if there are no *.cpp files directly in the src/
> > directory (e.g. all *.cpp are in subdirectories, and OBJECTS variable
> > is set accordingly). Adding a bogus *.cpp file fixes this issue.
> > However, this is not very obvious (I would dare saying it is not
> > obvious at all) and I spent quite a time checking what went wrong
> > after I organized my src files better. :-)
> >
> > Kind regards,
> > Radosław Piliszek
> >
> > ______________________________________________
> > [hidden email] mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-devel
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel