[R-pkg-devel] CXX14 not defined on Windows

2020-02-04 Thread Guido Kraemer
I am testing building a package on Windows. The package requires C++14. 
I have installed the latest versions of R (3.6.2), RTools (3.5), and 
RStudio. The package builds fine under Linux.

I get the following error:

> devtools::install_github("gdkrmr/zarr-R")
   ...
  C++14 standard requested but CXX14 is not defined
   ...


I have also set `~/.R/Makevars.win` as suggested in the manual "Writing 
R extensions", Section 1.2.5 "Using C++14 code". When typing `R CMD 
config CXX14` in the RStudio terminal, I get a reply 
("c:/Rtools/mingw_64/bin/g++"). When trying to install the package 
manually with `R CMD INSTALL ...` from the RStudio terminal, I get the 
same error.


What am I doing wrong?

Thanks!

Guido

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


Re: [R-pkg-devel] CXX14 not defined on Windows

2020-02-04 Thread Dirk Eddelbuettel


On 4 February 2020 at 17:51, Guido Kraemer wrote:
| I am testing building a package on Windows. The package requires C++14. 

You will have to wait.

The current Rtools is at g++ 4.9.3 which (barely) supports C++11.  We all
keep our fingers crossed as the replacement Rtools would bring g++ 8.*.  This
may happen with R 4.0.0 in April but I have no more details either.

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] CXX14 not defined on Windows

2020-02-05 Thread Ralf Stubner
On Tue, Feb 4, 2020 at 5:51 PM Guido Kraemer  wrote:
> I have also set `~/.R/Makevars.win` as suggested in the manual "Writing
> R extensions", Section 1.2.5 "Using C++14 code".

What exactly do you have in src/Makevars.win? Just the simple CXX_STD
= CXX14 or the more complex set-up from the end of section 1.2.5..

The rstan package is on CRAN including windows binaries and uses
C++14. In src/Makevars.win they have

CXX_STD = CXX14
CXX14STD = -std=c++1y

c.f. 
https://github.com/stan-dev/rstan/blob/40e93534e771d8c536ddb60fc62e86a5b55596de/rstan/rstan/src/Makevars.win#L2-L3

cheerio
ralf

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


Re: [R-pkg-devel] CXX14 not defined on Windows

2020-02-05 Thread Dirk Eddelbuettel


On 5 February 2020 at 11:47, Ralf Stubner wrote:
| On Tue, Feb 4, 2020 at 5:51 PM Guido Kraemer  wrote:
| > I have also set `~/.R/Makevars.win` as suggested in the manual "Writing
| > R extensions", Section 1.2.5 "Using C++14 code".
| 
| What exactly do you have in src/Makevars.win? Just the simple CXX_STD
| = CXX14 or the more complex set-up from the end of section 1.2.5..
| 
| The rstan package is on CRAN including windows binaries and uses
| C++14. In src/Makevars.win they have
| 
| CXX_STD = CXX14
| CXX14STD = -std=c++1y
| 
| c.f. 
https://github.com/stan-dev/rstan/blob/40e93534e771d8c536ddb60fc62e86a5b55596de/rstan/rstan/src/Makevars.win#L2-L3

Good catch. I think I also noticed at least one other package using C++14
with the current toolchain (xtensor) and it used eg by one other package
(rray) which has an even simpler src/Makevars.win just setting CXX_STD as
advised (plus tweaks to PKG_CXXFLAGS, see 
  https://github.com/r-lib/rray/blob/master/src/Makevars.win

So notwithstanding my earlier message Guido's package should work with the
current Rtools.  

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] CXX14 not defined on Windows

2020-02-06 Thread Guido Kraemer
I have used the same setup as in Section 1.2.5 of the manual and have 
set CXX_STD=CXX14 in src/Makevars.win. No I also remember that, when I 
sent the package to winbuilder, some time ago, it started compiling (the 
compile failed, but at least it tried).


On 2/5/20 11:47 AM, Ralf Stubner wrote:

On Tue, Feb 4, 2020 at 5:51 PM Guido Kraemer  wrote:

I have also set `~/.R/Makevars.win` as suggested in the manual "Writing
R extensions", Section 1.2.5 "Using C++14 code".

What exactly do you have in src/Makevars.win? Just the simple CXX_STD
= CXX14 or the more complex set-up from the end of section 1.2.5..

The rstan package is on CRAN including windows binaries and uses
C++14. In src/Makevars.win they have

CXX_STD = CXX14
CXX14STD = -std=c++1y

c.f. 
https://github.com/stan-dev/rstan/blob/40e93534e771d8c536ddb60fc62e86a5b55596de/rstan/rstan/src/Makevars.win#L2-L3

cheerio
ralf


--
Guido Kraemer
Max Planck Institute for Biogeochemistry Jena
Department for Biogeochemical Integration
Hans-Knöll-Str. 10
07745 Jena
Germany

phone: +49 3641 576293
e-mail: gkrae...@bgc-jena.mpg.de

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


Re: [R-pkg-devel] CXX14 not defined on Windows

2020-02-10 Thread Guido Kraemer
I had some success using RTools40 and the corresponding R testing 
version. I had to do a lot of MSYS shenanigans and couldn't get static 
compilation to work, but the binary package seems to work just fine in R 
3.6.2.


It makes me very happy to see that R will get an updated toolchain and a 
proper MSYS environment with a package manager! Is there a due date for 
R 4.0.0?


Guido

On 2/4/20 6:14 PM, Dirk Eddelbuettel wrote:

On 4 February 2020 at 17:51, Guido Kraemer wrote:
| I am testing building a package on Windows. The package requires C++14.

You will have to wait.

The current Rtools is at g++ 4.9.3 which (barely) supports C++11.  We all
keep our fingers crossed as the replacement Rtools would bring g++ 8.*.  This
may happen with R 4.0.0 in April but I have no more details either.

Dirk


--
Guido Kraemer
Max Planck Institute for Biogeochemistry Jena
Department for Biogeochemical Integration
Hans-Knöll-Str. 10
07745 Jena
Germany

phone: +49 3641 576293
e-mail: gkrae...@bgc-jena.mpg.de

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