rstan icon indicating copy to clipboard operation
rstan copied to clipboard

Error in model fit: C++14 standard requested but CXX14 is not defined

Open RichardIanBarnes opened this issue 7 years ago • 26 comments

Summary:

Error message relating to C++compiler when running a linear model fit.

Description:

I am new to Stan and RStan and trying out the tutorial by Max Farrell and Isla Myers-Smith on: https://ourcodingclub.github.io/2018/04/17/stan-intro.html

The step by step process is shown below under 'Reproducible Steps'.

When I run the stanc() it compiles fine. But when I fit the linear model I receive the following error message: Error in compileCode(f, code, language = language, verbose = verbose) : Compilation ERROR, function(s)/method(s) not created! Error in .shlib_internal(commandArgs(TRUE)) : C++14 standard requested but CXX14 is not defined Calls: <Anonymous> -> .shlib_internal Execution halted In addition: Warning message: In system(cmd, intern = !verbose) : running command 'C:/PROGRA~1/R/R-35~1.1/bin/x64/R CMD SHLIB file55c71d73e8e.cpp 2> file55c71d73e8e.cpp.err.txt' had status 1

I've searched everywhere for possible solutions. I reviewed the following issue posted by yanys7 https://github.com/stan-dev/rstan/issues/565

As suggested by bgoodri I created a ~/.R/Makevars file and inserted the following: CXX14 = g++

However the problem still persists.

I don't know if this is a bug or if I'm doing something wrong. Thanks in advance for any help you can provide.

Reproducible Steps:

This follows almost exactly the steps shown in the tutorial.

Sys.setenv(USE_CXX14 = 1)
library(rstan)
library(gdata)
library(bayesplot)
rstan_options(auto_write = TRUE)
options(mc.cores = parallel::detectCores())
seaice <- read.csv("seaice.csv", stringsAsFactors = F)
colnames(seaice)<-c("year", "extent_north", "extent_south")
x <- I(seaice$year - 1978)
y <- seaice$extent_north
N <- length(seaice$year)
stan_data <- list(N = N, x = x, y = y)
write("// Stan model for simple linear regression
data {
      int <lower = 1> N;
      vector[N] x; 
      vector[N] y;
      }
      
      parameters {
      real alpha; 
      real beta; 
      real<lower = 0> sigma;
      }
      
      model {
      y ~ normal(alpha + x * beta, sigma);
      }
      generated quantities {
      }, 
"stan_model1.stan")
stanc("stan_model1.stan")
stan_model1 <- "stan_model1.stan"
fit <- stan(file = stan_model1, data = stan_data, warmup = 500, iter = 1000, chains = 4, thin = 1)

Current Output:

The output from stanc("stan_model1.stan") is below: $status [1] TRUE

$model_cppname [1] "model55c23451a60_stan_model1"

$cppcode [1] "// Code generated by Stan version 2.17.0\n\n#include <stan/model/model_header.hpp>\n\nnamespace model55c23451a60_stan_model1_namespace {\n\nusing std::istream;\nusing std::string;\nusing std::stringstream;\nusing std::vector;\nusing stan::io::dump;\nusing stan::math::lgamma;\nusing stan::model::prob_grad;\nusing namespace stan::math;\n\ntypedef Eigen::Matrix<double,Eigen::Dynamic,1> vector_d;\ntypedef Eigen::Matrix<double,1,Eigen::Dynamic> row_vector_d;\ntypedef Eigen::Matrix<double,Eigen::Dynamic,Eigen::Dynamic> matrix_d;\n\nstatic int current_statement_begin__;\n\nstan::io::program_reader prog_reader__() {\n stan::io::program_reader reader;\n reader.add_event(0, 0, "start", "model55c23451a60_stan_model1");\n reader.add_event(19, 19, "end", "model55c23451a60_stan_model1");\n return reader;\n}\n\nclass model55c23451a60_stan_model1 : public prob_grad {\nprivate:\n int N;\n vector_d x;\n vector_d y;\npublic:\n model55c23451a60_stan_model1(stan::io::va...

$model_name [1] "stan_model1"

$model_code [1] "// Stan model for simple linear regression\ndata {\n int <lower = 1> N; // Sample size\n vector[N] x; //Predictor\n vector[N] y; // Outcome\n}\n\nparameters {\n real alpha; //Intercept\n real beta; // Slope\n real<lower = 0> sigma; //Error SD\n}\n\nmodel {\n y ~ normal(alpha + x * beta, sigma);\n}\n\ngenerated quantities {\n} // The posterior predictive distribution" attr(,"model_name2") [1] "stan_model1"

Expected Output:

If applicable, the output you expected from RStan.

RStan Version:

RStan version 2.17.3

R Version:

R Version 3.5.1

Operating System:

Windows 8 64bit

RichardIanBarnes avatar Oct 15 '18 16:10 RichardIanBarnes

Can you post the whole ~/.R/Makevars file? It may be that it is not finding it. What is Sys.getenv("R_MAKEVARS_USER")?

On Mon, Oct 15, 2018 at 12:45 PM RichardIanBarnes [email protected] wrote:

Summary:

Error message relating to C++compiler when running a linear model fit. Description:

I am new to Stan and RStan and trying out the tutorial by Max Farrell and Isla Myers-Smith on: https://ourcodingclub.github.io/2018/04/17/stan-intro.html

The step by step process is shown below under 'Reproducible Steps'.

When I run the stanc() it compiles fine. But when I fit the linear model I receive the following error message: Error in compileCode(f, code, language = language, verbose = verbose) : Compilation ERROR, function(s)/method(s) not created! Error in .shlib_internal(commandArgs(TRUE)) : C++14 standard requested but CXX14 is not defined Calls: -> .shlib_internal Execution halted In addition: Warning message: In system(cmd, intern = !verbose) : running command 'C:/PROGRA1/R/R-351.1/bin/x64/R CMD SHLIB file55c71d73e8e.cpp 2> file55c71d73e8e.cpp.err.txt' had status 1

I've searched everywhere for possible solutions. I reviewed the following issue posted by yanys7 #565 https://github.com/stan-dev/rstan/issues/565

As suggested by bgoodri I created a ~/.R/Makevars file and inserted the following: CXX14 = g++

However the problem still persists.

I don't know if this is a bug or if I'm doing something wrong. Thanks in advance for any help you can provide. Reproducible Steps:

This follows almost exactly the steps shown in the tutorial.

Sys.setenv(USE_CXX14 = 1) library(rstan) library(gdata) library(bayesplot) rstan_options(auto_write = TRUE) options(mc.cores = parallel::detectCores()) seaice <- read.csv("seaice.csv", stringsAsFactors = F) colnames(seaice)<-c("year", "extent_north", "extent_south") x <- I(seaice$year - 1978) y <- seaice$extent_north N <- length(seaice$year) stan_data <- list(N = N, x = x, y = y) write("// Stan model for simple linear regression data { int <lower = 1> N; vector[N] x; vector[N] y; }

  parameters {
  real alpha;
  real beta;
  real<lower = 0> sigma;
  }

  model {
  y ~ normal(alpha + x * beta, sigma);
  }
  generated quantities {
  },

"stan_model1.stan") stanc("stan_model1.stan") stan_model1 <- "stan_model1.stan" fit <- stan(file = stan_model1, data = stan_data, warmup = 500, iter = 1000, chains = 4, thin = 1)

Current Output:

The output from stanc("stan_model1.stan") is below: $status [1] TRUE

$model_cppname [1] "model55c23451a60_stan_model1"

$cppcode [1] "// Code generated by Stan version 2.17.0\n\n#include <stan/model/model_header.hpp>\n\nnamespace model55c23451a60_stan_model1_namespace {\n\nusing std::istream;\nusing std::string;\nusing std::stringstream;\nusing std::vector;\nusing stan::io::dump;\nusing stan::math::lgamma;\nusing stan::model::prob_grad;\nusing namespace stan::math;\n\ntypedef Eigen::Matrix<double,Eigen::Dynamic,1> vector_d;\ntypedef Eigen::Matrix<double,1,Eigen::Dynamic> row_vector_d;\ntypedef Eigen::Matrix<double,Eigen::Dynamic,Eigen::Dynamic> matrix_d;\n\nstatic int current_statement_begin__;\n\nstan::io::program_reader prog_reader__() {\n stan::io::program_reader reader;\n reader.add_event(0, 0, "start", "model55c23451a60_stan_model1");\n reader.add_event(19, 19, "end", "model55c23451a60_stan_model1");\n return reader;\n}\n\nclass model55c23451a60_stan_model1 : public prob_grad {\nprivate:\n int N;\n vector_d x;\n vector_d y;\npublic:\n model55c23451a60_stan_model1(stan::io::va...

$model_name [1] "stan_model1"

$model_code [1] "// Stan model for simple linear regression\ndata {\n int <lower = 1> N; // Sample size\n vector[N] x; //Predictor\n vector[N] y; // Outcome\n}\n\nparameters {\n real alpha; //Intercept\n real beta; // Slope\n real<lower = 0> sigma; //Error SD\n}\n\nmodel {\n y ~ normal(alpha

  • x * beta, sigma);\n}\n\ngenerated quantities {\n} // The posterior predictive distribution" attr(,"model_name2") [1] "stan_model1" Expected Output:

If applicable, the output you expected from RStan. RStan Version:

RStan version 2.17.3 R Version:

R Version 3.5.1 Operating System:

Windows 8 64bit

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/stan-dev/rstan/issues/569, or mute the thread https://github.com/notifications/unsubscribe-auth/ADOrqr1TnE-bWhTxjdQ7gDorUc6F8_E6ks5ulLufgaJpZM4XcuVe .

bgoodri avatar Oct 15 '18 16:10 bgoodri

Hi

Thank you very much for replying so soon! The ~/.R/Makevars is attached - I wasn't sure what file extension it should be - I found a similar one in one of the package folders that had a .win extension.

The Sys.getenv("R_MAKEVARS_USER") returns an empty string so it looks like, as you said, it isn't able to find it.

Makevars.txt I must admit I need to do a bit of reading up to understand this aspect but if you could help with any pointers as to what I should be doing that would be great - thanks again.

RichardIanBarnes avatar Oct 15 '18 18:10 RichardIanBarnes

Try it after changing ~/.R/Makevars to

CXX14 = g++ -std=c++1y

You may also want to add -Wno-unused-variable -Wno-unused-function to the CXX14FLAGS line.

bgoodri avatar Oct 17 '18 19:10 bgoodri

Hi

I added those lines to the ~/.R/Makevars and it seems to have resolved this particular issue. Thank you very much for your help.

In fact - much to my shame - I just realised that there was a section on RStan installation for Windows which sets out the contents of the Makevars file! I hadn't followed these steps when I originally installed RStan (I just went straight to install.packages("rstan")) so that would explain how I ended up with this problem. Thank you for your patience and sorry I hadn't fully set out the steps that led to this error.

Having resolved this though I encountered another error with StanHeaders which I thought I had seen in one of the open issues but can't find it at the moment. I will try to find it again and then post on there.

RichardIanBarnes avatar Oct 18 '18 06:10 RichardIanBarnes

I was also getting this error:

ld: chains.o: relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
chains.o: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
make: *** [rstan.so] Error 1
ERROR: compilation failed for package ‘rstan’

and I had to modify my ~/.R/Makevars like this:

CXX14 = g++ -std=c++1y -Wno-unused-variable -Wno-unused-function -fPIC

pescobar avatar Jan 17 '19 10:01 pescobar

I'm having this issue, not locally but when I do a TravisCI build on my package that depends on rstan. Is there a recommended way to setup an rstan dependency to avoid this? Below is the output I get:

* installing *source* package ‘rstan’ ...
** package ‘rstan’ successfully unpacked and MD5 sums checked
** libs
Error in .shlib_internal(args) : 
  C++14 standard requested but CXX14 is not defined
* removing ‘/home/travis/R/Library/rstan’
Error in i.p(...) : 
  (converted from warning) installation of package ‘rstan’ had non-zero exit status
Calls: <Anonymous> ... with_rprofile_user -> with_envvar -> force -> force -> i.p
Execution halted
The command "Rscript -e 'deps <- devtools::dev_package_deps(dependencies = NA);devtools::install_deps(dependencies = TRUE);if (!all(deps$package %in% installed.packages())) { message("missing: ", paste(setdiff(deps$package, installed.packages()), collapse=", ")); q(status = 1, save = "no")}'" failed and exited with 1 during .
Your build has been stopped.

colemonnahan avatar Mar 15 '19 17:03 colemonnahan

Nevermind, after much digging I needed to add this to my travis config file:

# from https://discourse.mc-stan.org/t/building-rstanarm-like-packagee-on-travis-with-c-14/6054/10?
before_install:
  - mkdir -p ~/.R
  - echo "CXX14FLAGS=-O3 -mtune=native -march=native -Wno-unused-variable -Wno-unused-function  -Wno-macro-redefined" >> ~/.R/Makevars
  - echo "CXX14=g++ -std=c++1y -fPIC" >> ~/.R/Makevars

This was necessary even though I'm not packaging a compiled Stan model.

colemonnahan avatar Mar 15 '19 19:03 colemonnahan

I'm afraid I'm getting the same error message and can't resolve the issue.

Sys.getenv("R_MAKEVARS_USER") returns blank but the only makevars I can find is in RccpEigen/skeleton, where there are two of them. I've tried inserting:

CXX14 = g++ -std=c++1y

in both of them, but no luck. I'm afraid I don't have a computer science background so I may not be looking in the right place, or doing the right thing. Any additional guidance would be much appreciated.

willtudorevans avatar Jun 11 '19 11:06 willtudorevans

Hi there - I need to rack my memory on this. Let me have a look later on and I'll try to figure out what I did to resolve it and get back to you.

RichardIanBarnes avatar Jun 11 '19 11:06 RichardIanBarnes

Sorry the doc's so confusing. We're certainly open to suggestions in improving it if you have any. It's really hard with all the platform-specific config that's shared across R applications.

You want the top-level Makevars for R. On my mac, that's in ~/.R/Makevars. You'll need to create it if it doesn't already exist. Mine looks like this:

CXX=g++ -arch x86_64  -ftemplate-depth-256 -stdlib=libstdc++
CXXFLAGS= -O3 -mtune=native $(LTO) -w #set_by_rstan (and Bob)
R_XTRA_CPPFLAGS =  -I$(R_INCLUDE_DIR)      #set_by_rstan
CXX=clang++
CC=clang

I set the -O3 -mtune-native config myself, but that's not the critical part.

bob-carpenter avatar Jun 12 '19 19:06 bob-carpenter

Sorry unfortunately I'm still not having any luck with this.

I'm on Windows, I understand that the ~ means home directory, so home directory for R? I've tried putting the Makevars file in both:

C:\Program Files\R and C:\Users\User\Documents\R

but I still get the same error message when trying to run a stan model:

Error in compileCode(f, code, language = language, verbose = verbose) : Compilation ERROR, function(s)/method(s) not created! Error in .shlib_internal(commandArgs(TRUE)) : C++14 standard requested but CXX14 is not defined Calls: <Anonymous> -> .shlib_internal Execution halted In addition: Warning message: In system(cmd, intern = !verbose) : running command 'C:/PROGRA~1/R/R-36~1.0/bin/x64/R CMD SHLIB file227c6da617cf.cpp 2> file227c6da617cf.cpp.err.txt' had status 1 Error in sink(type = "output") : invalid connection

Stan was working ok on my computer until I upgraded RStudio and R to version 3.6.0.

I've also tried searching for a makevars file on a computer where stan is working, to try and copy that structure for my computer, but I can't locate the file.

willtudorevans avatar Jun 18 '19 17:06 willtudorevans

You have to create a new Makevars.win from scratch (like everything else, the name's different on Windows). Have you tried running the script from section "Configuration of the C++ Toolchain":

  • https://github.com/stan-dev/rstan/wiki/RStan-Getting-Started

The script will show you where it needs to go and I think will just create it all for you if you run it.

I'm re-opening this issue, as nobody's going to react to comments on a closed issue.

bob-carpenter avatar Jun 18 '19 17:06 bob-carpenter

Just do

install.packages(" https://win-builder.r-project.org/1vUk5Gxm9QqM/rstan_2.19.1.zip", repos = NULL)

On Tue, Jun 18, 2019 at 1:55 PM Bob Carpenter [email protected] wrote:

Reopened #569 https://github.com/stan-dev/rstan/issues/569.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/stan-dev/rstan/issues/569?email_source=notifications&email_token=AAZ2XKSETAMPRVC7AV3AO7TP3EOP3A5CNFSM4F3S4VPKYY3PNVWWK3TUL52HS4DFWZEXG43VMVCXMZLOORHG65DJMZUWGYLUNFXW5KTDN5WW2ZLOORPWSZGOSBMPMWA#event-2421749336, or mute the thread https://github.com/notifications/unsubscribe-auth/AAZ2XKR2YCH43PHGQUJPGILP3EOP3ANCNFSM4F3S4VPA .

bgoodri avatar Jun 18 '19 21:06 bgoodri

Just do install.packages(" https://win-builder.r-project.org/1vUk5Gxm9QqM/rstan_2.19.1.zip", repos = NULL)

Unfortunately I receive the following error message:

Error in install.packages : zip file ‘ https://win-builder.r-project.org/1vUk5Gxm9QqM/rstan_2.19.1.zip’ not found

willtudorevans avatar Jun 19 '19 09:06 willtudorevans

The main problem now seems to be R not being able to 'find' Rtools. Every time I run:

pkgbuild::has_build_tools(debug = TRUE)

it determines FALSE and asks me if I want to install 'additional tools'. It then recommends I uninstall the existing Rtools first (version 3.5) before installing Rtools. This process repeats itself now matter how many times i uninstall and reintsall Rtools. This seems to be a new problem only after I tried reinstalling Rtools to see if that solved the original problem. Originally this returned TRUE:

pkgbuild::has_build_tools(debug = TRUE)

Not sure what to try next!I should probably refer to the Rtools debug manual.

willtudorevans avatar Jun 19 '19 10:06 willtudorevans

OK I seem to solve the Rtools issue by setting:

options(buildtools.check = NULL)

as detailed here https://github.com/rstudio/rstudio/issues/3563. I'm still having the Makevars issue even after running the 'Configuration of the C++ Toolchain' script.. I can see the Makevars.win document in the ~/.R/ folder, and no matter if I populate it with the script's default settings or Bob's I get the same error message:

Error in compileCode(f, code, language = language, verbose = verbose) : Compilation ERROR, function(s)/method(s) not created! Error in .shlib_internal(commandArgs(TRUE)) : C++14 standard requested but CXX14 is not defined Calls: <Anonymous> -> .shlib_internal Execution halted In addition: Warning message: In system(cmd, intern = !verbose) : running command 'C:/PROGRA~1/R/R-36~1.0/bin/x64/R CMD SHLIB file22fc4479512d.cpp 2> file22fc4479512d.cpp.err.txt' had status 1 Error in sink(type = "output") : invalid connection

I'm not sure what next to try. I'm tempted to try a complete reinstallation of R, Rstudio, Rtools and Rstan to see if that helps.

willtudorevans avatar Jun 19 '19 10:06 willtudorevans

Just do install.packages(" https://win-builder.r-project.org/1vUk5Gxm9QqM/rstan_2.19.1.zip", repos = NULL)

Unfortunately I receive the following error message:

Error in install.packages : zip file ‘ https://win-builder.r-project.org/1vUk5Gxm9QqM/rstan_2.19.1.zip’ not found

There is a space at the beginning of the string (typo) in bgoodri's comment so just remove that.

qdread avatar Jun 19 '19 12:06 qdread

There is a space at the beginning of the string (typo) in bgoodri's comment so just remove that.

I feel stupid for having missed this. Thanks so much qdread, Bob and Ben everything now seems to be working.

willtudorevans avatar Jun 19 '19 14:06 willtudorevans

I understand that this issue was closed based on: install.packages("https://win-builder.r-project.org/1vUk5Gxm9QqM/rstan_2.19.1.zip", repos = NULL) But that link isn't available anymore: https://win-builder.r-project.org/1vUk5Gxm9QqM

DiegoDVillacreses avatar Sep 25 '19 02:09 DiegoDVillacreses

That link isn't needed anymore. Just install rstan from CRAN.

On Tue, Sep 24, 2019 at 10:55 PM dvillacresesz [email protected] wrote:

I understand that this issue was closed based on: install.packages(" https://win-builder.r-project.org/1vUk5Gxm9QqM/rstan_2.19.1.zip", repos = NULL) But that link isn't available anymore: https://win-builder.r-project.org/1vUk5Gxm9QqM http://url

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/stan-dev/rstan/issues/569?email_source=notifications&email_token=AAZ2XKTG7PVNQGXRG74WVF3QLLHJXA5CNFSM4F3S4VPKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD7QNRUA#issuecomment-534829264, or mute the thread https://github.com/notifications/unsubscribe-auth/AAZ2XKQULFAF64IVYQX2GLLQLLHJXANCNFSM4F3S4VPA .

bgoodri avatar Sep 25 '19 03:09 bgoodri

I am facing the same issue on Linux. Do you have a solution for Linux machines?

ngupta23 avatar Sep 25 '19 14:09 ngupta23

If you don't have CXX14 defined on Linux, then most likely your version of R is much too old.

On Wed, Sep 25, 2019 at 10:06 AM Nikhil Gupta [email protected] wrote:

I am facing the same issue on Linux. Do you have a solution for Linux machines?

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/stan-dev/rstan/issues/569?email_source=notifications&email_token=AAZ2XKUVHUTAB73MFRKVB6TQLNV6JA5CNFSM4F3S4VPKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD7SBBOY#issuecomment-535040187, or mute the thread https://github.com/notifications/unsubscribe-auth/AAZ2XKQPDKQD3MFFNONE5QLQLNV6JANCNFSM4F3S4VPA .

bgoodri avatar Sep 25 '19 14:09 bgoodri

Thank you very much for your quick and accurate response @bgoodri . Actually my problem is when I try: install.packages("OpenMx") I get:

Installing package into ‘~/R/win-library/3.6’
(as ‘lib’ is unspecified)

  There is a binary version available but the source version is later:
       binary  source needs_compilation
OpenMx 2.13.2 2.14.11              TRUE

installing the source package ‘OpenMx’

trying URL 'https://cran.rstudio.com/src/contrib/OpenMx_2.14.11.tar.gz'
Content type 'application/x-gzip' length 3386317 bytes (3.2 MB)
downloaded 3.2 MB

* installing *source* package 'OpenMx' ...
** package 'OpenMx' successfully unpacked and MD5 sums checked
** using staged installation

   **********************************************
   WARNING: this package has a configure script
         It probably needs manual configuration
   **********************************************


** libs
Error in .shlib_internal(args) : 
  C++14 standard requested but CXX14 is not defined
* removing 'C:/Users/dvill/Documents/R/win-library/3.6/OpenMx'
Warning in install.packages :
  installation of package ‘OpenMx’ had non-zero exit status

Specifications:

  1. OS: Windows 10 home-64 bits-x64-based processor
  2. R: x86_64-w64-mingw32; arch x86_64; os mingw32; system x86_64, mingw32
  3. Rtools: 3.5.0.4

I am only having troubles with this package. For example, curl was installed using compilation perfectly.

I have tried everything and this issue is the best documented, it's possible to solve this here or should I open another issue?

Also, @ngupta23 I have in this same machine Ubuntu, and I have no problem whatsoever with any package there (I have the same packages in both OS). I believe you should:

sudo apt update
sudo apt upgrade

DiegoDVillacreses avatar Sep 25 '19 16:09 DiegoDVillacreses

I would just install the binary package, but if you are going to build packages from source on Windows then you need the appropriate configuration, which is given on the wiki https://github.com/stan-dev/rstan/wiki/Installing-RStan-from-source-on-Windows#configuration

On Wed, Sep 25, 2019 at 12:05 PM dvillacresesz [email protected] wrote:

Thank you very much for your quick and accurate response @bgoodri https://github.com/bgoodri . Actually my problem is when I try: install.packages("OpenMx") I get:

Installing package into ‘~/R/win-library/3.6’

(as ‘lib’ is unspecified)

There is a binary version available but the source version is later:

   binary  source needs_compilation

OpenMx 2.13.2 2.14.11 TRUE

installing the source package ‘OpenMx’

trying URL 'https://cran.rstudio.com/src/contrib/OpenMx_2.14.11.tar.gz'

Content type 'application/x-gzip' length 3386317 bytes (3.2 MB)

downloaded 3.2 MB

  • installing source package 'OpenMx' ...

** package 'OpenMx' successfully unpacked and MD5 sums checked

** using staged installation


WARNING: this package has a configure script

     It probably needs manual configuration

** libs

Error in .shlib_internal(args) :

C++14 standard requested but CXX14 is not defined

  • removing 'C:/Users/dvill/Documents/R/win-library/3.6/OpenMx'

Warning in install.packages :

installation of package ‘OpenMx’ had non-zero exit status

Specifications:

  1. OS: Windows 10 home-64 bits-x64-based processor
  2. R: x86_64-w64-mingw32; arch x86_64; os mingw32; system x86_64, mingw32
  3. Rtools: 3.5.0.4

I am only having troubles with this package. For example, curl was installed using compilation perfectly.

I have tried everything and this issue is the best documented, it's possible to solve this here or should I open another issue?

Also, @ngupta23 https://github.com/ngupta23 I have in this same machine Ubuntu, and I have no problem whatsoever with any package there (I have the same packages in both OS). I believe you should:

sudo apt update

sudo apt upgrade

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/stan-dev/rstan/issues/569?email_source=notifications&email_token=AAZ2XKVTM22HM7Z2VY4NS6LQLOD3FA5CNFSM4F3S4VPKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD7SOFCQ#issuecomment-535093898, or mute the thread https://github.com/notifications/unsubscribe-auth/AAZ2XKXMKBK6EDMP5QDA7BTQLOD3FANCNFSM4F3S4VPA .

bgoodri avatar Sep 25 '19 17:09 bgoodri

`cat ~/.R/Makevars

CXX14 = g++ CXX14FLAGS = -O3 CXX14FLAGS += -fPIC #LIBS += -lm `

thistleknot avatar Jan 09 '21 22:01 thistleknot

`cat ~/.R/Makevars

CXX14 = g++ CXX14FLAGS = -O3 CXX14FLAGS += -fPIC #LIBS += -lm `

This allowed me to install the xgboost R package

NikKrieger avatar Aug 30 '21 12:08 NikKrieger