How do I cross compile R packages for MacOS from a

2019-02-18 16:17发布

问题:

I'm running Linux and trying to compile an R package for use on a Mac. I could only find Linux->Windows and MacOS->Windows cross-compiling instructions. Does anybody know what I should do to compile a MacOS binary package for R?

Or, I'll settle for I build server. Again, there's a Windows build-server for R packages, but does anybody know of a MacOS build-server?

回答1:

By first building a gcc crosscompiler -- see its documentation.

Available libraries may be a limiting factor, though. You'd have to rebuild everything from OS X you'd like to link against.



回答2:

Just a side note:

While in R packages can be installed (from pre-compiled binary packages for all major platforms Windows, Mac, Linux) there are also tools for building packages from source as part of the installation process.

Example for installation from source (more info):

install.packages("Simpsons", type="source")

Depending on the package (pure R or with some other language like C/C++ in it) and depending on the OS you use, you need additional tools to build the packages from source (e.g. Rtools for Windows, r-base-dev for Linux systems ...)