Re: [R-pkg-devel] compilation flags WARNING

2018-07-05 Thread Dirk Eddelbuettel


On 5 July 2018 at 22:19, Göran Broström wrote:
| Thanks Heather and Iñaki: I understand.
| 
| I have an old Makevars file in the src directory of the package.  I 
| guess I can set the flags there?

No, because those get scanned by R CMD check and friends.

For the one you do not want, Heather's suggestion was spot. Supply a new
(cleaner) system-wide default.  Those values are not checked.

I sometimes do the opposite and add (what would be "non-portable") options in
~/.R/Makevars to make very noisy builds quieter etc.

| Now it only contains
| 
| # PKG_CFLAGS = -Wall
| # PKG_FFLAGS = -Wall -fbounds-check
| PKG_LIBS = $(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS)

As we said no issues as nothing not allowed by R here.

Dirk

-- 
http://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [R-pkg-devel] compilation flags WARNING

2018-07-05 Thread Heather Turner
I would suggest not to set the CFLAGS in the package itself - at least not 
exclusively. R-admin 6.3.3 (the section I linked before) recommends "to  enable 
a reasonable amount of diagnostic messaging (“warnings”) when compiling, such 
as e.g. -Wall -pedantic for tools from GCC", while R-exts 1.2.1 says"When 
writing a Makevars file for a package you intend to distribute, take care to 
ensure that it is not specific to your compiler: flags such as -O2 -Wall 
-pedantic (and all other -W flags: for the Oracle compilers these are used to 
pass arguments to compiler phases) are all specific to GCC." Since these are 
contradictory, you can't satisfy both via PKG_CFLAGS alone. That is why I 
suggest to use the Makevars.site file to set pedantic flags for local use that 
are not distributed with the package (if you don't want to set them at a 
site-wide level R-admin 6.3.3 gives alternatives for setting at user-level).

Heather

On Thu, Jul 5, 2018, at 9:19 PM, Göran Broström wrote:
> Thanks Heather and Iñaki: I understand.
> 
> I have an old Makevars file in the src directory of the package.  I 
> guess I can set the flags there? Now it only contains
> 
> # PKG_CFLAGS = -Wall
> # PKG_FFLAGS = -Wall -fbounds-check
> PKG_LIBS = $(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS)
> 
> Göran
> 
> On 2018-07-05 17:43, Heather Turner wrote:
> > 
> > 
> > On Thu, Jul 5, 2018, at 3:39 PM, Iñaki Úcar wrote:
> >> El jue., 5 jul. 2018 a las 16:11, Göran Broström
> >> () escribió:
> >>>
> >>> I am preparing a CRAN release of eha (a trivial change due to a change
> >>> in the survival package), but when checking the build I get:
> >>>
> >>> goran@M6800:~/R$ R CMD check --as-cran eha_2.5.2.tar.gz
> >>> ...
> >>> * checking compilation flags used ... WARNING
> >>> Compilation used the following non-portable flag(s):
> >>> ‘-Wdate-time’ ‘-Werror=format-security’ ‘-Wformat’
> >>> ...
> >>
> >> AFAIK, these are new checks. I get similar warnings on Fedora for
> >> different flags.
> >>
> >>> I have never seen this before and I haven't (to my knowledge) set any
> >>> compilation flags. It is my first build and check on a newly upgraded
> >>> ubuntu 18.04 (no issues on 17.10). Should I perhaps ask on r-sig-debian,
> >>> or is that observation irrelevant?
> >>
> >> Again AFAIK (there are package maintainers for several distros here
> >> that can correct me if I'm wrong), each distro defines some policies
> >> regarding compilation flags that are applied to all packages by
> >> default. So these warnings can be safely ignored locally (or you may
> >> override them), because those flags won't be defined on CRAN.
> >>
> > Yes, by default the compilation flags are those set when R was installed. 
> > You can see the current flags via
> > 
> > R CMD config CFLAGS
> > 
> > which in your case should include  ‘-Wdate-time’ etc.
> > 
> > As Iñaki says you can safely ignore the warning, but if you prefer to not 
> > to have any warnings you can solve this by creating a Makevars.site file 
> > with CFLAGS excluding the non-portable ones, e.g.
> > 
> > CFLAGS=-Wall -g O0 -fPIC
> > 
> > This should be saved in the /etc directory of R.home(), e.g. /usr/lib/R/etc.
> > 
> > See 
> > https://cran.r-project.org/doc/manuals/r-release/R-admin.html#Customizing-package-compilation
> >  for more information.
> > 
> > Heather
> > 
> >> Iñaki
> >>
> >>>
> >>> Göran Broström
> >>
> >> __
> >> R-package-devel@r-project.org mailing list
> >> https://stat.ethz.ch/mailman/listinfo/r-package-devel
> > 
> > __
> > R-package-devel@r-project.org mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-package-devel
> >
> 
> __
> R-package-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-package-devel

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [R-pkg-devel] compilation flags WARNING

2018-07-05 Thread Iñaki Úcar
El jue., 5 jul. 2018 a las 22:23, Göran Broström
() escribió:
>
> Thanks Heather and Iñaki: I understand.
>
> I have an old Makevars file in the src directory of the package.  I
> guess I can set the flags there? Now it only contains
>
> # PKG_CFLAGS = -Wall
> # PKG_FFLAGS = -Wall -fbounds-check
> PKG_LIBS = $(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS)

IMHO it's better to do it outside the package. The best way, without
changing the system settings, is to place a Makevars under ~/.R/

Iñaki

>
> Göran
>
> On 2018-07-05 17:43, Heather Turner wrote:
> >
> >
> > On Thu, Jul 5, 2018, at 3:39 PM, Iñaki Úcar wrote:
> >> El jue., 5 jul. 2018 a las 16:11, Göran Broström
> >> () escribió:
> >>>
> >>> I am preparing a CRAN release of eha (a trivial change due to a change
> >>> in the survival package), but when checking the build I get:
> >>>
> >>> goran@M6800:~/R$ R CMD check --as-cran eha_2.5.2.tar.gz
> >>> ...
> >>> * checking compilation flags used ... WARNING
> >>> Compilation used the following non-portable flag(s):
> >>> ‘-Wdate-time’ ‘-Werror=format-security’ ‘-Wformat’
> >>> ...
> >>
> >> AFAIK, these are new checks. I get similar warnings on Fedora for
> >> different flags.
> >>
> >>> I have never seen this before and I haven't (to my knowledge) set any
> >>> compilation flags. It is my first build and check on a newly upgraded
> >>> ubuntu 18.04 (no issues on 17.10). Should I perhaps ask on r-sig-debian,
> >>> or is that observation irrelevant?
> >>
> >> Again AFAIK (there are package maintainers for several distros here
> >> that can correct me if I'm wrong), each distro defines some policies
> >> regarding compilation flags that are applied to all packages by
> >> default. So these warnings can be safely ignored locally (or you may
> >> override them), because those flags won't be defined on CRAN.
> >>
> > Yes, by default the compilation flags are those set when R was installed. 
> > You can see the current flags via
> >
> > R CMD config CFLAGS
> >
> > which in your case should include  ‘-Wdate-time’ etc.
> >
> > As Iñaki says you can safely ignore the warning, but if you prefer to not 
> > to have any warnings you can solve this by creating a Makevars.site file 
> > with CFLAGS excluding the non-portable ones, e.g.
> >
> > CFLAGS=-Wall -g O0 -fPIC
> >
> > This should be saved in the /etc directory of R.home(), e.g. /usr/lib/R/etc.
> >
> > See 
> > https://cran.r-project.org/doc/manuals/r-release/R-admin.html#Customizing-package-compilation
> >  for more information.
> >
> > Heather
> >
> >> Iñaki
> >>
> >>>
> >>> Göran Broström
> >>
> >> __
> >> R-package-devel@r-project.org mailing list
> >> https://stat.ethz.ch/mailman/listinfo/r-package-devel
> >
> > __
> > R-package-devel@r-project.org mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-package-devel
> >
>
> __
> R-package-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-package-devel



-- 
Iñaki Úcar
http://www.enchufa2.es
@Enchufa2

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [R-pkg-devel] compilation flags WARNING

2018-07-05 Thread Göran Broström

Thanks Heather and Iñaki: I understand.

I have an old Makevars file in the src directory of the package.  I 
guess I can set the flags there? Now it only contains


# PKG_CFLAGS = -Wall
# PKG_FFLAGS = -Wall -fbounds-check
PKG_LIBS = $(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS)

Göran

On 2018-07-05 17:43, Heather Turner wrote:



On Thu, Jul 5, 2018, at 3:39 PM, Iñaki Úcar wrote:

El jue., 5 jul. 2018 a las 16:11, Göran Broström
() escribió:


I am preparing a CRAN release of eha (a trivial change due to a change
in the survival package), but when checking the build I get:

goran@M6800:~/R$ R CMD check --as-cran eha_2.5.2.tar.gz
...
* checking compilation flags used ... WARNING
Compilation used the following non-portable flag(s):
‘-Wdate-time’ ‘-Werror=format-security’ ‘-Wformat’
...


AFAIK, these are new checks. I get similar warnings on Fedora for
different flags.


I have never seen this before and I haven't (to my knowledge) set any
compilation flags. It is my first build and check on a newly upgraded
ubuntu 18.04 (no issues on 17.10). Should I perhaps ask on r-sig-debian,
or is that observation irrelevant?


Again AFAIK (there are package maintainers for several distros here
that can correct me if I'm wrong), each distro defines some policies
regarding compilation flags that are applied to all packages by
default. So these warnings can be safely ignored locally (or you may
override them), because those flags won't be defined on CRAN.


Yes, by default the compilation flags are those set when R was installed. You 
can see the current flags via

R CMD config CFLAGS

which in your case should include  ‘-Wdate-time’ etc.

As Iñaki says you can safely ignore the warning, but if you prefer to not to 
have any warnings you can solve this by creating a Makevars.site file with 
CFLAGS excluding the non-portable ones, e.g.

CFLAGS=-Wall -g O0 -fPIC

This should be saved in the /etc directory of R.home(), e.g. /usr/lib/R/etc.

See 
https://cran.r-project.org/doc/manuals/r-release/R-admin.html#Customizing-package-compilation
 for more information.

Heather


Iñaki



Göran Broström


__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel



__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [R-pkg-devel] compilation flags WARNING

2018-07-05 Thread Heather Turner



On Thu, Jul 5, 2018, at 3:39 PM, Iñaki Úcar wrote:
> El jue., 5 jul. 2018 a las 16:11, Göran Broström
> () escribió:
> >
> > I am preparing a CRAN release of eha (a trivial change due to a change
> > in the survival package), but when checking the build I get:
> >
> > goran@M6800:~/R$ R CMD check --as-cran eha_2.5.2.tar.gz
> > ...
> > * checking compilation flags used ... WARNING
> > Compilation used the following non-portable flag(s):
> >‘-Wdate-time’ ‘-Werror=format-security’ ‘-Wformat’
> > ...
> 
> AFAIK, these are new checks. I get similar warnings on Fedora for
> different flags.
> 
> > I have never seen this before and I haven't (to my knowledge) set any
> > compilation flags. It is my first build and check on a newly upgraded
> > ubuntu 18.04 (no issues on 17.10). Should I perhaps ask on r-sig-debian,
> > or is that observation irrelevant?
> 
> Again AFAIK (there are package maintainers for several distros here
> that can correct me if I'm wrong), each distro defines some policies
> regarding compilation flags that are applied to all packages by
> default. So these warnings can be safely ignored locally (or you may
> override them), because those flags won't be defined on CRAN.
> 
Yes, by default the compilation flags are those set when R was installed. You 
can see the current flags via

R CMD config CFLAGS

which in your case should include  ‘-Wdate-time’ etc.

As Iñaki says you can safely ignore the warning, but if you prefer to not to 
have any warnings you can solve this by creating a Makevars.site file with 
CFLAGS excluding the non-portable ones, e.g.

CFLAGS=-Wall -g O0 -fPIC

This should be saved in the /etc directory of R.home(), e.g. /usr/lib/R/etc.

See 
https://cran.r-project.org/doc/manuals/r-release/R-admin.html#Customizing-package-compilation
 for more information.

Heather

> Iñaki
> 
> >
> > Göran Broström
> 
> __
> R-package-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-package-devel

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [R-pkg-devel] compilation flags WARNING

2018-07-05 Thread Iñaki Úcar
El jue., 5 jul. 2018 a las 16:11, Göran Broström
() escribió:
>
> I am preparing a CRAN release of eha (a trivial change due to a change
> in the survival package), but when checking the build I get:
>
> goran@M6800:~/R$ R CMD check --as-cran eha_2.5.2.tar.gz
> ...
> * checking compilation flags used ... WARNING
> Compilation used the following non-portable flag(s):
>‘-Wdate-time’ ‘-Werror=format-security’ ‘-Wformat’
> ...

AFAIK, these are new checks. I get similar warnings on Fedora for
different flags.

> I have never seen this before and I haven't (to my knowledge) set any
> compilation flags. It is my first build and check on a newly upgraded
> ubuntu 18.04 (no issues on 17.10). Should I perhaps ask on r-sig-debian,
> or is that observation irrelevant?

Again AFAIK (there are package maintainers for several distros here
that can correct me if I'm wrong), each distro defines some policies
regarding compilation flags that are applied to all packages by
default. So these warnings can be safely ignored locally (or you may
override them), because those flags won't be defined on CRAN.

Iñaki

>
> Göran Broström

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


[R-pkg-devel] compilation flags WARNING

2018-07-05 Thread Göran Broström
I am preparing a CRAN release of eha (a trivial change due to a change 
in the survival package), but when checking the build I get:


goran@M6800:~/R$ R CMD check --as-cran eha_2.5.2.tar.gz
...
* checking compilation flags used ... WARNING
Compilation used the following non-portable flag(s):
  ‘-Wdate-time’ ‘-Werror=format-security’ ‘-Wformat’
...

I have never seen this before and I haven't (to my knowledge) set any 
compilation flags. It is my first build and check on a newly upgraded 
ubuntu 18.04 (no issues on 17.10). Should I perhaps ask on r-sig-debian, 
or is that observation irrelevant?


Göran Broström

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel