-
-
Notifications
You must be signed in to change notification settings - Fork 264
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
C++14 standard requested but CXX14 is not defined #892
Comments
I think the best fix is to add a $ cat ~/.R/Makevars
MAKEFLAGS = -j8
## C++ flags
CXX=g++
CXX11=g++
CXX14=g++
CXX17=g++
CXXFLAGS=-O3 -march=native -Wno-ignored-attributes
CXX11FLAGS=-O3 -march=native -Wno-ignored-attributes
CXX14FLAGS=-O3 -march=native -Wno-ignored-attributes
CXX17FLAGS=-O3 -march=native -Wno-ignored-attributes
CXXPICFLAGS=-fPIC
CXX11PICFLAGS=-fPIC
CXX14PICFLAGS=-fPIC
CXX17PICFLAGS=-fPIC
CXX11STD=-std=c++11
CXX14STD=-std=c++14
CXX17STD=-std=c++17
## C flags
CC=gcc
CFLAGS=-O3 -march=native
## Fortran flags
FC=gfortran
F77=gfortran
FFLAGS=-O3 -march=native
FCFLAGS=-O3 -march=native |
can I simply copy paste this? im not able to find the Makevars |
You could try, I don't know what c/c++ compilers you have on your system so using g++ etc might not be right for you. Also in the first line I set -j8 as I have 8 cores on my machine. You won't have this file by default so you'll need to create it. If you Google "R Makevars" you should get some more information. |
I got:
|
@gersonjr what C++ compiler + version are you using? Could be quite old and wouldn't have c++14 support. |
@jeffpollock9 , that's probably the case.
|
@gersonjr that's a really old compiler which I don't think has full C++14 support, IIRC you can turn on partial support with |
Unfortunately the minimum supported gcc version is 4.9.3 |
@jeffpollock9 That |
I also faced similar problems with C++14 flags errors and @jeffpollock9 's solution solved my problems. Thanks to @jeffpollock9 for your kind sharing :) |
The Makevars posted by @jeffpollock9 still shines bright! Thanks. |
Under the following settings: Using the following codes: install.packages("pkgbuild") rt_path = gsub("\","/",pkgbuild::rtools_path(),fixed=T) dotR <- file.path(Sys.getenv("HOME"), ".R") cat("\nCXX14FLAGS=-O3 -Wno-unused-variable -Wno-unused-function", made it for me. |
@gersonjr did you ever end up getting this working? I have the same gcc version as you on the server I am working on and I am trying to get this working for my dissertation. |
If you only need to fit models, you might want to try cmdstanr. It has fewer dependencies with R and is thus easier to install. If you need to do Laplace approximations or evaluate log densities or gradients or transforms or run Stan functions in R, you'll still need RStan. |
@bob-carpenter I think I just need to run models and get estimates, I bet I can pipe the output back into R if I need to. Thanks for the suggested workaround! |
Exactly--- |
@silvaden If your If you have no other choice, then you may have to resort to using a much older version of Stan which did not need the c++14 features. I previously worked out which versions of |
How do i get around this? the above issue
The text was updated successfully, but these errors were encountered: