Closed zaphot closed 6 years ago
Ah, I bet this has something to do with the switch to MRO earlier this year. Sorry for my earlier comments, I removed them because they were irrelevant. Please ignore them.
There's no need to build binaries for yourself on R on Windows since binaries are provided, either by conda
when using the older R
infrastructure and/or MRO
or from MRAN
when using MRO
.
install.packages("readxl_1.0.0.tar.gz", repos=NULL, type="source")
You should use: conda install r-readxl
. That will work just fine on both MRO
and the older R
infrastructure, otherwise you should use just install.packages("readxl")
if you want to use binaries from MRAN
.
I am surprised by this harsh reaction. Of course there IS need to build binaries for yourself... I am developing an R package with C++ code and so far I used cran R and Rtools to generate binaries to distribute them to my colleagues. Now I attempted to use anaconda MRO for this.
R-readxl should thus only be an example (as stated above), which seems to be quite tested and even was successfully compiled by other in the linked issue.
I am surprised by this harsh reaction
I see no harsh reaction. You didn't explain that you were a software developer working on R packages. One of the key things AD does is to take away the pain of compiling software.
If you want to compile your own packages then just follow the 'normal' instructions for installing and using Rtools. Everything should work just the same.
If you want a conda-package for Rtools then you can use conda-build to build https://github.com/AnacondaRecipes/aggregateMRO/tree/master/rtools-feedstock/recipe
If you do that then you can use conda skeleton cran --r-interp mro-base
to make other conda-recipes that will use this Rtools conda-package.
@zaphot I believe you can also change your r from mro to r-base as it says in the linked anaconda docs above. Then you can build & install cran r packages the way I did and in the previous issue.
thx a lot for the answers and links. However, i will just use cran R and Rtools, since I think it's probably better/safer to use both toolchain and R environment from the same provider.
Would be cool if anaconda could also integrate an easy toolchain package (like it's done on linux). Just something like "conda install r-rtools" and start building your code independent of the os would be awesome. Of course it's nice that one doesn't have to compile every package. But besides compiling own code, i think it is also getting more and more common that publications provide new code just as source on github.
Thanks for the feedback.
However, i will just use cran R and Rtools, since I think it's probably better/safer to use both toolchain and R environment from the same provider
If you use MRO on Windows then you are using upstream packages (for nearly everything). All I do is repackage the binaries in the installer and those on MRAN (which are snapshotted mirrors from CRAN) .. apart from on Linux, in which case I repackage the binaries in the installer and build everything else from source using our compilers. I am not sure what I will need to do with macOS yet.
Providing an Rtools package is very easy since I've written the recipe already (and used it to build some of the AD MRO packages). I am hesitant to do it because R upstream is working on modernising Rtools and I might want to wait until that's done, but I'll ask my team what they'd prefer here.
Pinging @csoja.
@zaphot This is a possible solution for the error reported during compilation of R packages from source, using the conda msys2 packages.
It seems that R expects to find the C++ compilers or headers at the dir defined in variable BINPREF
inside the file Makeconf
to be found at <R installation dir>/etc/x64
. In my installations of R, both from CRAN or MRO, this setting defaults to c:/Rtools/mingw_64/bin/
. A simple solution, that worked for me, was to
edit <R installation dir>/etc/x64/makeconf
and
change line
BINPREF ?= c:/Rtools/mingw_64/bin/
to
BINPREF ?= <Anaconda or Anaconda environment root>/Library/mingw-w64/bin/
(the trailing slash is really important)
BTW, the problem also arises when people using Rtools do not installed it in the default dir c:/Rtools
, see, for instance,
r.789695.n4.nabble.com/Setting-the-path-to-Rtools-for-package-compilation-on-Windows-td4748266.html
Hope it works for you.
You should use the official Rtools when compiling packages to work with MRO on Windows. We don't want to handle that for you since it involves writing files outside of CONDA_PREFIX
though we can maybe do something to make an Rtools package and then change Makeconf
to be dynamic about this.
Conda R (non-MRO version) already uses a dynamic BINPREF
of BINPREF ?= $(R_HOME)/../../Library/mingw-w64/bin/
. CRAN/official R is out of scope for the Anaconda Distribution.
I cannot build/install R packages which require compilation.
i followed the steps provided here https://github.com/ContinuumIO/anaconda-issues/issues/729 and https://github.com/ContinuumIO/anaconda-issues/wiki/Install-R-Packages and installed the following packages:
conda install m2w64-toolchain m2-make m2-sed m2-zip m2-gzip m2-tar m2-texinfo m2-coreutils m2-diffutils r-devtools
. Moreover i created a tmp folder in my anaconda installationmkdir %HOMEPATH%\Anaconda3\Library\tmp
But what is the cran Rtools equivalent in conda or should one install Rtools from cran? Moreover, can one integrate the build tools in Rstudio?
As an example the readxl package from https://cran.r-project.org/src/contrib/readxl_1.0.0.tar.gz is downloaded.
Using the command line:
From within R:
conda info:
conda list --show-channel-urls