-
-
Notifications
You must be signed in to change notification settings - Fork 193
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
compilation failed for package ‘ranger’ #669
Comments
The problem is that it tries to compile with |
I was coming to write about this same issue, too. I am running into similar errors on Windows. Is there a My errors look like
|
I expected that the C++14 change causes problems here and there. @wangzitiner which R version is this? @aschmidt-amplify here is a list where Makevars.win could be. Generally, a workaround is to install a version <0.14.2 where we switched to C++14. |
@mnwright I tried on both R4.2.2 and R3.6.9, both have the same error. Here is the code: |
And also I tried to install "ranger" by conda, the install seems successful, but I still failed when install URD(a Trajectory analysis R package), and still the same kind of error. 1\ Install ranger through anaconda: 2\ Install URD in R4.2.2:
Hope for your help, thank u! |
The problem is related to R setting the default C++ standard to C++11 on Windows until R version 4.2.3 (for the 4.2.X releases) when the bug was fixed (https://cran.r-project.org/doc/manuals/r-release/NEWS.html). However, I had the same issue on R 4.1.2 even though the corresponding RTools does support C++ 14. My fix was to re-build the package from source myself and adding |
@rps13 Thank you so much. I use macOS system, does this problem still exists? (R setting the default C++ standard to C++11 on Windows until R version 4.2.3). And if it exists, will it be easier to directly update by R to 4.2.3? |
@wangzitiner It was supposed to be a Windows-only issue so I don't think that would be the case for Mac; can you put the contents of your |
@rps13 Sorry, I don't know how to find this content. I use "which" to search "R.framework" and "Resources", both not found. where should I find my Makeconf? |
@wangzitiner How did you install R? That is where the version from CRAN puts the files. |
@rps13 I am still a tyro in this major. And I don't install R by myself, so please wait me a few minutes to check. |
@mnwright @rps13 Should I change the eighth line from "CXX = g++ -std=gnu++11" to "CXX_STD = CXX14"? |
@wangzitiner You would only need to change |
I changed it and it warned me because this file is readonly, and I use :wq! to force it to change. Is this situation same as yours? |
@wangzitiner you should just copy line 8 into |
Actually I only found Makeconf, Makeovers still failed to be found. |
You need to create |
I just try to install URD again, it seems to achieve a further step like this, but the package "destiny" is still not available, which is so disgusting. And the "gcc -std=gnu11" doesn't change successfully. Update all/some/none? [a/s/n]: n 1: All Enter one or more numbers, or an empty line to skip updates: 1 gcc -std=gnu11 -I"/bioware/source/R-4.2.1/include" -DNDEBUG -DUSING_R -I. -Icore -Iinclude -Ivendor -I/mnt/date3/Project/wangzt/anaconda3/include/libxml2 -I/mnt/date3/Project/wangzt/anaconda3/include -DNDEBUG -DNTIMER -DNPRINT -DINTERNAL_ARPACK -DPRPACK_IGRAPH_SUPPORT -DIGRAPH_THREAD_LOCAL=/**/ -I'/bioware/source/R-4.2.1/library/cpp11/include' -I/usr/local/include -fvisibility=hidden -fpic -g -O2 -c vendor/cs/cs_compress.c -o vendor/cs/cs_compress.o |
This is the result, it seems that "ranger" is ok? I am not sure now. URD installed successfully! |
Try loading ranger with |
I created a Makevars yesterday, but still failed in installation . Only after I changed the Makeconf today then it succeeded. And library(ranger) is completely ok!!
Thank you so much for your patience ! |
It's a bit strange |
If this fails for anyone else, please report here. |
I am having the same problem in Debian linux, R 4.04 |
Adding the aforementioned line Makevars worked! |
Here's what we're doing with our students who need
All of our students are RStudio Server users, so executing this via the Terminal... |
@olyerickson They are all working on the same machine? To be clear: On an up-to-date system this should not happen and these workarounds should not be necessary. |
By definition, RStudio Server is a shared, web-accessed service; in a given term we typically might have 60-90 students (plus researchers, et.al.) active on our cluster, most using R. On such a shared resource, updates e.g. to R and its dependencies happen more slowly (often during term breaks). |
Please re-open if necessary. Anything we can improve to avoid such problems? |
Hi! I think it might help to put information about this on the github readme for the package (or a link to this issue thread). There's a big gap between the technical prowess needed to use R vs to diagnose this issue, and folks don't always control whether they have the latest version. Thanks! |
What exactly would you put in the readme? I wouldn't link this issue. It might confuse people and e.g. what @olyerickson writes in their FAQ is wrong (ranger does not specify C++11 anywhere). I think the major problem was the bug in R (fixed in R 4.2.3) that still specified C++11 for Windows (see https://cran.r-project.org/doc/manuals/r-release/NEWS.html). |
I was thinking something like "ranger changed to the C++14 standard with version 0.15.0, if you are using R < 4.2.3 (Windows) or R < 4.1.0 (Mac and Linux) this may cause an error [link to slightly more detailed explanation]" (I'm not totally sure about the latter version, but I came to this issue from R 4.0.2 on an Ubuntu server that I do not have the ability to update). But then I had the epiphany that it would be less noisy and more direct to put it in the error message ( ranger/src/AAA_check_cpp11.cpp Line 3 in 5a04d93
In any case, I think you're within your rights to do neither, there is certainly a point when "you should just have updated R" is a good response. And one I can use to put pressure on the IT department :) |
Thanks! I thought the same with the error message and putting the version requirements somewhere also makes sense. But (as you pointed out) what exactly are those? The R NEWS (linked above) says C++14 is supported since 3.4.0 but the default was changed with 4.1.0 and by accident for Windows only with 4.2.3. Does that mean that people with with R<4.1.0 (Windows: 4.2.3) need something like
When the change was made, CRAN people said we shouldn't do 1). Writing R Extensions says
but also:
If this is all correct, we could add a note on how to install ranger with older R versions. Or even add What we really need is to specify that we need at least C++14 but that is not possible I think. |
That does sort of put you in a bind, although I understand why they'd say not to do # 1. My perspective is that I arrived at "Error: ranger requires a C++14 compiler, e.g., gcc >= 5 or Clang >= 3.4. You probably have to update your C++ compiler." and then found that I had gcc 7.5, and just had no idea what to do for a week, until I eventually noticed the "C++11" on the console output. At which point I was still confused, hah. So I guess I think for most users it's fine to ask THEM to do the fancy part (update their R version or modify their Makevars, the latter covering people like me who can't update the R version), and it would go a long way to give context/guidance in that same message. Like, presumably you made an informed decision on how to set up 0.15.0 and it seems like you should get to keep it that way and then also just add a lil note. |
My R is 4.1, still have the same installation issue. Only the binary version can be successfully installed into my Windows CP, all other installation ways have the similar errors reported above. |
Hello!
I am trying to install "ranger" on linux with CentOS, and then to install URD. But I met this error, and my gcc version is already suitable. Waiting for your advice, thank you very much!!!
The error is like this:
g++ -std=gnu++11 -I"/usr/local/lib64/R/include" -DNDEBUG -DR_BUILD -I'/usr/local/lib64/R/library/Rcpp/include' -I'/usr/local/lib64/R/library/RcppEigen/include' -I/usr/local/include -fpic -g -O2 -c AAA_check_cpp11.cpp -o AAA_check_cpp11.o
AAA_check_cpp11.cpp:3:2: error: #error Error: ranger requires a C++14 compiler, e.g., gcc >= 5 or Clang >= 3.4. You probably have to update your C++ compiler.
#error Error: ranger requires a C++14 compiler, e.g., gcc >= 5 or Clang >= 3.4. You probably have to update your C++ compiler.
^~~~~
make: *** [AAA_check_cpp11.o] Error 1
ERROR: compilation failed for package ‘ranger’
The downloaded source packages are in
‘/tmp/Rtmp1OYeEo/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
Warning message:
In install.packages("ranger") :
installation of package ‘ranger’ had non-zero exit status
This is my gcc version :
g++ --version
g++ (GCC) 8.5.0
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
The text was updated successfully, but these errors were encountered: