How do I cross compile R packages for MacOS from a Linux environment?
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.
How to cross compile from Mac OS X to Linux x86?
Your simplest solution is to just run CentOS 5.3 in a VM (e.g. Sun VirtualBox). This requires minimal setup, has quite reasonable overhead (assuming an Intel Mac), and you'll be able to actually test and debug what you are building.
If you really insist on cross-compiling, you must build a cross-compiler. Instructions are here and here, but beware: it will likely take you several days to get it right, and then you'll still need a VM to test the result, so I don't see any point in doing it that way.
Creating package for Mac in Windows / Linux
The package that was created using R CMD build
can be installed on other OS types. Even if your package contains source code other than R (c or c++) this is the case. Only when you create a binary distribution (I think by adding --binary to the r cmd build call) the package becomes platform specific. The tools needed to build packages are often already installed under linux or mac. So if you create a source distribution, it should work under all the major distributions. To create a mac binary, you need either a mac, or create a cross-compiler environment. The second option could be quite a challenge, I say you could give to a google. Do note that if you upload your package to CRAN, all building of packages is done for you.
Cross compile Go on OSX?
With Go 1.5 they seem to have improved the cross compilation process, meaning it is built in now. No ./make.bash
-ing or brew
-ing required. The process is described here but for the TLDR-ers (like me) out there: you just set the GOOS
and the GOARCH
environment variables and run the go build.
For the even lazier copy-pasters (like me) out there, do something like this if you're on a *nix system:
env GOOS=linux GOARCH=arm go build -v github.com/path/to/your/app
You even learned the env
trick, which let you set environment variables for that command only, completely free of charge.
Related Topics
How to Write to Tty from a Kernel Module
What Does Grep -Po '...\K...' Do? How Else Can That Effect Be Achieved
If Adding a Command That Repeats Every 10 Minutes to Crontab, When Does the First Job Run
How to Export a Modified Kernel Header
Kubernetes Can't Start Due to Too Many Open Files in System
Case in Bash: "Line 4: Syntax Error Near Unexpected Token ')'"
How to Disable Specific Warning When -Wall Is Enabled
Mod_Rewrite with Relative Path Redirects
Why Is Execution Time of a Process Shorter When Another Process Shares the Same Ht Core
Syntax Error: Operand Expected When Using Bash
Nginx Loadbalancer Too Many Open Files
Difference Between Trap Flag (Tf) and Monitor Trap Flag
How to Uniquely Identify an Usb-Device
Get a Spectrum of Frequencies from Wav/Riff Using Linux Command Line
How to Make the Watch Command Interpret Vt100 Sequences
How Can a Process Try to Access Other Process's Memory in Linux Virtual Memory System