Can I cross-compile racket code?

194 views
Skip to first unread message

DonRyuDragoni

unread,
Jan 7, 2016, 11:10:24 AM1/7/16
to Racket Users
After reading the documentation for raco exe, make and distribute, googling and asking /r/racket (https://www.reddit.com/r/Racket/comments/3zhe79/crosscompilation/), I could only find this link https://groups.google.com/forum/#!topic/racket-users/LLB6oV1VsPo from 2013, and, since I'm planning to build a game with a friend, having one command to compile them all would be really useful (and the only way we could target Macs).

Was any progress made? Can I hope to have the raco cross-compile command in the future? How can I help us achieve this, if it is not yet possible?

Matthew Flatt

unread,
Jan 7, 2016, 11:46:24 AM1/7/16
to DonRyuDragoni, Racket Users
We've made some progress, although it's not yet as easy as we'd like.

See

http://docs.racket-lang.org/raco/cross-system.html

Suppose you're running on platform X. If you have a Racket installation
on X and also a Racket installation for platform Y, then you can use X
as described in the docs to run `raco exe` or `raco dist` for Y.
Probably.

There are two potential obstacles:

* You need an installation for platform Y.

If Y is Windows, that's kind of a pain, because racket-lang.org
currently only provides an ".exe" installer for Windows. You'd have
to install on some Windows machine and then copy over the
installation's directory.

We should probably provide builds for each platform in ".tgz" or
".zip" format, but we haven't set that up, yet.

* It might not work after all.

We're using cross-compilation for Windows to build the main Racket
distribution, so things are likely to work if Y is Windows. I
haven't even tried Y as something like OS X or Linux, though.
> --
> You received this message because you are subscribed to the Google Groups
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to racket-users...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

DonRyuDragoni

unread,
Jan 7, 2016, 3:08:33 PM1/7/16
to Racket Users, ani.v...@gmail.com

Well, not the extremely good news I hoped for, but anything helps. I still have hopes for a brighter (and easier) cross-compilable future, and I'll wait anxiously for it.

Thanks for the help!

Daniel Brunner

unread,
Jan 8, 2016, 2:56:34 AM1/8/16
to racket...@googlegroups.com
Am 07.01.2016 um 21:08 schrieb DonRyuDragoni:
> (...)
>
> Well, not the extremely good news I hoped for, but anything helps. I still have hopes for a brighter (and easier) cross-compilable future, and I'll wait anxiously for it.

I did some experiments with Wine on Linux to cross-compile to Windows.
The experiments worked but I did not invested a lot of time. But it may
be an option for you.

Kind regards,
Daniel

DonRyuDragoni

unread,
Jan 8, 2016, 5:26:24 PM1/8/16
to Racket Users
My major problem is Mac, actually. We do have a Windows machine, I just prefer to code on Linux.

And, of course, it would make things easier if I could run one command and wait until all executables are created.

Reply all
Reply to author
Forward
0 new messages