From d679f5c6f0b8e3bd67af8116f685a9d96258f762 Mon Sep 17 00:00:00 2001 From: Peder <pbac@dtu.dk> Date: Sun, 12 Jul 2020 23:25:59 +0200 Subject: [PATCH] src/Makevars and src/Makevars.win must be included for compiling on Windows --- make.R | 17 ++++++++++++++++- src/Makevars | 14 ++++++++++++++ src/Makevars.win | 14 ++++++++++++++ 3 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 src/Makevars create mode 100644 src/Makevars.win diff --git a/make.R b/make.R index 8677269..ebb44d3 100644 --- a/make.R +++ b/make.R @@ -82,7 +82,22 @@ system("R CMD check ../onlineforecast_1.0.0.tar.gz") # https://win-builder.r-project.org/ -# Run another version of R +#----------------- +# WINDOWS: +# Install rtools +# Run in R: +#writeLines('PATH="${RTOOLS40_HOME}\\usr\\bin;${PATH}"', con = "~/.Renviron") +# Check if rtools are found: +#Sys.which("make") + +# Must have Makevars and Makevars.win +# Make the two files, find them and copy into "src" +#library("RcppArmadillo") +#RcppArmadillo.package.skeleton("tmp-pkg") + + +#----------------- +# Run another version of R (a linux in podman) # see https://hub.docker.com/u/rocker # Open terminal and "sudo su" (needed for podman to access files) diff --git a/src/Makevars b/src/Makevars new file mode 100644 index 0000000..d3e3f41 --- /dev/null +++ b/src/Makevars @@ -0,0 +1,14 @@ + +## With R 3.1.0 or later, you can uncomment the following line to tell R to +## enable compilation with C++11 (where available) +## +## Also, OpenMP support in Armadillo prefers C++11 support. However, for wider +## availability of the package we do not yet enforce this here. It is however +## recommended for client packages to set it. +## +## And with R 3.4.0, and RcppArmadillo 0.7.960.*, we turn C++11 on as OpenMP +## support within Armadillo prefers / requires it +CXX_STD = CXX11 + +PKG_CXXFLAGS = $(SHLIB_OPENMP_CXXFLAGS) +PKG_LIBS = $(SHLIB_OPENMP_CXXFLAGS) $(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS) diff --git a/src/Makevars.win b/src/Makevars.win new file mode 100644 index 0000000..d3e3f41 --- /dev/null +++ b/src/Makevars.win @@ -0,0 +1,14 @@ + +## With R 3.1.0 or later, you can uncomment the following line to tell R to +## enable compilation with C++11 (where available) +## +## Also, OpenMP support in Armadillo prefers C++11 support. However, for wider +## availability of the package we do not yet enforce this here. It is however +## recommended for client packages to set it. +## +## And with R 3.4.0, and RcppArmadillo 0.7.960.*, we turn C++11 on as OpenMP +## support within Armadillo prefers / requires it +CXX_STD = CXX11 + +PKG_CXXFLAGS = $(SHLIB_OPENMP_CXXFLAGS) +PKG_LIBS = $(SHLIB_OPENMP_CXXFLAGS) $(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS) -- GitLab