Comments on: Cross-compiling Rebol for your favorite embedded board
REBOL Technologies

Comments on: Cross-compiling Rebol for your favorite embedded board

Carl Sassenrath, CTO
REBOL Technologies
25-Dec-2012 21:37 GMT

Article #0526
Main page || Index || Prior Article [0525] || Next Article [0527] || 29 Comments || Send feedback

So, perhaps you found a nice gift package under the Christmas tree this year? Maybe it's a cute little embedded SoC (system-on-a-chip) board. Perhaps a Broadcom 2835 Raspberry Pi or TI OMAP Beaglebroad or Pandaboard? Cool.

Of course, the first thing you'll want to do after booting the board is to get Rebol running. It's easy, here's how.

To cross-compile Rebol you'll need the development toolchain and library header files for your SoC and Linux version. Usually you can download those from a website related to your specific board.

Next, figure out the paths to the embedded tools and includes (header files). For example on my box:

  1. The crosstools are at /opt/raspi/bin/ and they all begin with a prefix of arm-linux-
  2. The includes are at ~/raspi-linux/include

Assuming you already setup your R3 development environment (from, you can now generate fresh R3 header files for your embedded linux using your local host environment (no crosstools yet):

carl@ub10:~/r3$ cd make
carl@ub10:~/r3/make$ make make OS_ID=0.4.3
carl@ub10:~/r3/make$ make clean prep

Note that the "make make 0.4.3" regenerates a makefile that will work for most embedded linux toolchains. (See src/tools/systems.r) You'll see the prep step rebuild the necessary R3 header files:

./r3-make -qs ../src/tools/make-headers.r
------ Building headers
... REBOL Interface Library
... Function Prototypes
698 function prototypes
... Function Argument Enums
... REBOL Constants Strings

Now, you are ready to make R3 with your crosstools and includes:

carl@ub10:~/r3/make$ make TOOLS=/opt/raspi/bin/arm-linux- INCL=~/raspi-linux/include

It will take just a minute to compile and link...

make[1]: Entering directory `/home/carl/r3/make'
mkdir -p objs
/opt/raspi/bin/arm-linux-gcc ../src/core/a-constants.c -c -DTO_LINUX -DREB_API
  -O2-fvisibility=hidden  -I/home/carl/raspi-linux/include -I../src/include/
  -o objs/a-constants.o
/opt/raspi/bin/arm-linux-gcc ../src/core/a-globals.c -c -DTO_LINUX -DREB_API
  -O2 -fvisibility=hidden  -I/home/carl/raspi-linux/include -I../src/include/
  -o objs/a-globals.o
/opt/raspi/bin/arm-linux-gcc -o r3 objs/a-constants.o objs/a-globals.o objs/a-lib.o ...
/opt/raspi/bin/arm-linux-strip r3
/opt/raspi/bin/arm-linux-nm -a r3
/opt/raspi/bin/arm-linux-nm: r3: no symbols
ls -l r3
-rwxrwxr-x 1 carl carl 449556 Dec 24 17:00 r3

Copy your new r3 over to your embedded system and power up Rebol. Now you've got some real power. It will run your Rebol programs identically to your other systems. You're all set to do great things.

Of course, R3 open source makes this possible now.

Merry Chirstmas. Enjoy.



26-Dec-2012 8:23:57
linux 64 bits and windows 64 bits please pretty pretty please.

if a 32 bits version isn a problem for windows 7 64 bits it is a true problem for linux 64 bits.

Most servers now in days have more than 4 Go of ram use linux 64 bits which is better than a linux-PAE...

I know I could do it my self and contribute but I don want to spoil anyone from the benefits of doing it!

26-Dec-2012 9:13:15
great example Carl anyway it is well detailed on the steps to achieve compilation. Thank you!
Carl Sassenrath
26-Dec-2012 11:29:54
Hello Shadwolf, yes... Rebol in both directions: smaller devices and bigger systems also. Everywhere.

A 64 bit R3 is not too difficult -- just switch off checks for efficiency (because 64 bit systems do not care at all about memory usage - 49% of their memory capacity is just wasted.)

Carl Sassenrath
26-Dec-2012 12:00:01
Added make-make step for generating the 0.4.3 embedded linux makefile. (This step probably should be added makefile.)
Carl Sassenrath
26-Dec-2012 12:35:26
Now part of makefile.
26-Dec-2012 13:33:16
I just got Rebol up and running on my iPad by doing some ugly hacking in the host-main.c file. Yay, this is awesome! :-) I can probably figure out how to get it working on my own, but it would be nice if there was a static library target (libr3.a) in the makefile in addition to the shared object, since iOS still can't use shared objects.
Steven White
26-Dec-2012 14:32:17
I hate to be a whiner, and I suppose I should man up and learn to do this myself, but still, I hope that as these ports to other computers come into being, there will be a place where fully-compiled versions can be downloaded and installed by those of us who are a bit less capable (or is that a bit more lazy?).
26-Dec-2012 20:29:40
(at Carl) Merry Xmas to you too! Here's a day-late present to put under your version tree: a pull request for the minor mods to build on HaikuOS. Also included is a bootstrapping Be binary executable to build with if one were so inclined. :-)

(at Steven) Word on the street is that a build farm and continuous integration is coming...just like in the real world! It hasn't been a month yet even, give us a few seconds...

26-Dec-2012 21:42:02
(at Carl) Thanks for the concise instructions for how to compile on the Raspberry Pi! :-)
26-Dec-2012 21:43:35
(at Carl) BTW, would it be possible for me to get my hands on the WIP Wiki source? We're trying to figure out where to put the "official" R3 documentation, but need to have access to a good Wiki system that is compatible with MakeDoc.

If so, you know how to get in touch with me!

27-Dec-2012 4:51:45
(at) Carl: hum well r3-linux-64 would be better than wine r3.exe isn t it ? :))))

we are doing in french rebol forum (in french language) a list of things we want to see in r3 it like the ultimate wish list and your comment carl make me remember I want since 2003 a command to clear memory when I need once and for all. I know what you will say rebol has a garbage collector it isn necessary but trust me when it comment tu multiple file editing with syntaxe color renderer you need a way to shrink on sight the memory. I know ...I know ... rebol was not design to do things like that ... but well I can do them so I doing them.

We are trying to setup a debug group with a portable debug/dev SDK (I would like to do it in pure rebol but well no gui no sdk :P ). We are trying to see what tools fits best.

27-Dec-2012 5:01:10
(at)Steven White: There is another side to that coin - In order to attract more people to R3 it will definitely need binaries, not everyone has the time or wants to bother with compiling their own.

If simplicity is one of its selling points, that should also be from the installation perspective.



27-Dec-2012 5:18:22
for the debug/dev sdk I have the feeling that eclipse could match our goals of an all purpose portable integrated tool.

I would like to have it with a rebol tool in about 500ko or in a Crimson Editor version but r3/gui isn't ready and Crimson Editor only exists for Ms windows XP +.

27-Dec-2012 6:03:46

re 64 linux: yes, r3-linux-64 would be very nice (, but until then, you can just use the 32b linux builds on 64b linux. no need to resort to wine.

re forced garbage collection: recycle doesn't fit your needs?

Carl Sassenrath
27-Dec-2012 7:50:06

The official R3 docs are on and will stay there, along with the official source and binary release distributions, etc.

The wip wiki can handle individual contributors, but I need to setup a review mechanism and a comment posting method, like the one here. My concern regarding the docs is of course that of incorrect information or bad examples getting posted, because of course, not everyone "gets rebol" correctly right away.

Also note that the Rebol docs are copyrighted and are not Apache licensed.

27-Dec-2012 18:48:35
Happy holidays Carl!

rebol[]g: 12 i: 5 h: i * g j: negate h x: y: z: w: sc: 0 v2: v1: 1 o: now t: :to-image l: :layout c: :cosine s: :sine i1: t l[box red center"Happy Holidays!"]i2: t l[box blue center"Merry Christmas!"]i3: t l[box tan center"Rebol New Year!"]cube:[[h h j][h h h][h j j][h j h][j h j][j h h][j j j][j j h]]view center-face l/tight[f: box white 550x550 rate 15 feel[engage: func[f a e][if a = 'time[b: copy[]x: x + 3 y: y + 3 repeat n 8[if w > 500[v1: 0]if w < 50[v1: 1]either v1 = 1[w: w + 1][w: w - 1]if j >(g * i * 1.4)[v2: 0]if j < 1[v2: 1]either v2 = 1[h: h - 1][h: h + 1]j: negate h p: reduce cube/:n zx: p/1 * c z -(p/2 * s z)- p/1 zy: p/1 * s z +(p/2 * c z)- p/2 yx:(p/1 + zx * c y)-(p/3 * s y)- p/1 - zx yz:(p/1 + zx * s y)+(p/3 * c y)- p/3 xy:(p/2 + zy * c x)-(p/3 + yz * s x)- p/2 - zy append b as-pair(p/1 + yx + zx + w)(p/2 + zy + xy + w)]f/effect:[draw[image i1 b/6 b/2 b/4 b/8 image i2 b/6 b/5 b/1 b/2 image i3 b/1 b/5 b/7 b/3]]show f]]]]

31-Dec-2012 12:48:08

I know you don't need another task on your list. That's why we as a community have been discussing R3 docs on the AltME Rebol4 world.

I totally understand the quality control aspect of keeping tight reigns on the docs. Any ideas how we as a community can help you out with that?

3-Jan-2013 11:14:14
(at) nick: this is a long line of rebol2 code ... isn t it a bit out dated to give your best wishes in 2012 using a deprecated dialect since 2007 ?

don t look at me like that ... I m just asking..

3-Jan-2013 11:15:24
(at) Nick: Don't try to copy my style use pre tags or brianH will be mad at you.
3-Jan-2013 12:07:24
So there's an ubuntu phone now? Perfect for REBOL. Don't kno much details right now.
5-Jan-2013 9:21:10
(at)shadwolf: the intent was just to wish happy holidays in a cute way :)
7-Jan-2013 8:50:11
(at) Nick: cutest and longest oneliner ever ?
17-Jan-2013 9:19:36
(at) Carl: so we are a month later the opensource release of rebol3. ANs I would like you to consider and eventually reply to those ask or preocupations I have.

What is done to centralise working effort?

What open discussion channels are offered? You talked about a need for a forum where is it ?

I see the Gurus assembled in Saphirion but saphirion is intended to be more a separated branch of rebol over skilling the official branch than an effort to be a preview branch of what will be rebol3 official. My consern is that those same people more or less are the people in charge of maintaining the main branch + your opinion/veto. Don't you think that in a near future we will have a Saphirion r3 descendant evolving in its corner and a r3 official stuck in no evolution state until you decide to start coding to it?

What interface is made betwin you, your needs, your plans, your wish for r3 official branch and the public needs vision plans for r3? the success should be in the road in betwin the thing people want to see in r3 and spend time designing coding and and the things you want to see in r3 that you spend time in coding and desining. So what interface is set to discuss those things. Will it be a king/ministry kind of talks where a set of selected people (miniter) will tell you in an appropriate channel and time what they want you to know. And will your vision of the public needs will be narrowed down by the filter of your ministers?

What is the roadmap ? What is your plan for r3 to get out of the alpha stage?

Alpha version along a product name is good when it comes to a game like Street Fighter II version alpha prime turbo plus plus but along a language it makes it just stamped with "pretty unstable do not use"

Should alpha version be public?

Don't you think that calling r3 alpha is a bad image for rebol?

Rebol 3 is officially stamped 2.111.X.X but is that logical to have that link back to rebol 2 when at same time you tell the world that rebol 2 is dead and that rebol3 is a completly different brand ?

Rebol3 is almost a decade long of life, a old thing so, in that time didn t you noticed, like you did for r2 that it was lacking in many core design area and that instead of trying to push to a release version of r3 alpha 10 years old you should promote the building a a r4 with a completly different design that will make it fast and stable?

the more I m into r3 the more it looks like a light version of rebol2 ... So yes it is way easier to maintain, way faster, but it only does a 1/5 of what was doing rebol2... so isn t that better based on a heavy lack of funcionalities?

Will rebol2 be opensourced one day?

Brian Hawley
17-Jan-2013 14:23:12
Good post overall Shad. Minor fix: First work on R3 started in late 2006, so it's closer to 6 years old than it is to 10. We have a long time before we should talk about R4.
chicken little
19-Jan-2013 12:03:40
Ditto shadwolf.

Now, can anyone explain to me how to keep r3-ga6077e8.exe from creating it's own 2nd command window when running a script from the Win 7 command line? WTF is that about?

I'm using Windows console2 and I've got the blasted font size and colors setup so it fits on the screen along side my editor.

But Rebol has to go commando, do it's own thing, being the master of it's own domain, right? Bah!!!

Ruby and Python don't crap all over my screen, why can't Rebol leave stdio the "f" alone?

And is there any downloadable (recent, accurate) Rebol 3 documentation? And I don't mean 10 year old Rebol 2 GUI tutorials.

P.S. I may have found the perfect Rebol 3 mascot!

(No one could figure out how Mike lived without a head either!)

Okay, sorry if I've ruffled any feathers, I'll let the Rebol 3 forum here go back to the spammers.

21-Jan-2013 2:06:03
chicken little: yes, this is a known problem; we are working on that.

I just uploaded an "experimental" console-mode Win32 x86 binary (r3-ga6077e8-console.exe) to, which should improve behaviour for your case by reusing a parent console, if present.

(If you have MSCV installed, you can also do the change yourself: editbin /subsystem:console r3-ga6077e8.exe should give you the same console-mode binary.)

26-Jan-2013 8:30:59
initially I used in area-tc the color-code.r way to color items as it. So the way it was rendering the items was exactly based on what carl said about that study about how the brain attribute collors to import relations etc stuffs.

But in practice I had to much of red items bothering my view and not enough of hierachic interest level.

So I spiced it to make it more agreable and meaning full to see.

27-Jun-2013 18:44:04
Just got my RPi going with Raspbian. I'll try this out tonight.

The commenter at 15-Feb-2013 4:59 is a spammer.

12-Aug-2014 11:33:36
Yes, GUI for the RPi. No question.

This would entice three million new users overnight. Omission from a programming language this size that does so much in a format that is made for encouraging programming would be criminal.

What's more, it's a single hardware item. Build once and the repositories will do the rest....

Post a Comment:

You can post a comment here. Keep it on-topic.


Blog id:



 Note: HTML tags allowed for: b i u li ol ul font p br pre tt blockquote

This is a technical blog related to the above topic. We reserve the right to remove comments that are off-topic, irrelevant links, advertisements, spams, personal attacks, politics, religion, etc.

Updated 3-Dec-2023   -   Copyright Carl Sassenrath   -   WWW.REBOL.COM   -   Edit   -   Blogger Source Code