Compile For Pabdora Under Pandora?


Sphinxter said:
I usually use two 120x48 character xterms and it's not worth going blind, does not make that much sense outside of the novelty of it when there's a 25.5" display and two cores at 5ghz I could be using instead. Even if I wrote something on it compiling there sounds more painful than fun.
Building will be *no worse* than doing it on a desktop machine; most of the time it's just the normal "configure; make" litany.

In fact, cross-compilation is the more difficult option. Of course, if you're building something you wrote from scratch, it's normally fairly straightforward. But when you want to build/port something else...
 
Last edited by a moderator:
Any platform based on a 32-bit CPU and with greater than 32megs of RAM is more than sufficiently powerful enough to compile its own software onboard. If its 'painful' to do so on such a system, its only because the codebase is bloated, unwieldy, and not very well designed... ;)

<---- remembers the day when having 32megs of RAM to build an entire OS image plus applications would have been a *DREAM come true* .. so count me in the "I'll be putting all the compilers I can find onboard my Pandora" camp ..
 
I've needed to set up swap on my zaurus (64MB mem) on occasion to build certain things. GCC can suck up a surprising amount of memory when optimisations are enabled - it's not just due to bloat.

Of course, the Pandora has 4 times the memory of the Z, so you probably wouldn't hit that problem often. :)
 
torpor said:
Any platform based on a 32-bit CPU and with greater than 32megs of RAM is more than sufficiently powerful enough to compile its own software onboard. If its 'painful' to do so on such a system, its only because the codebase is bloated, unwieldy, and not very well designed... ;)

<---- remembers the day when having 32megs of RAM to build an entire OS image plus applications would have been a *DREAM come true* .. so count me in the "I'll be putting all the compilers I can find onboard my Pandora" camp ..
i also remember that time. i even remember further back when self-hosted linux development was done on a 4MB machine (when linux was a little more than a bastad spawn of minix), and a tad later when the whole frakin CS deparment of my university was charging like mad on a 16MB rs6k station, and our collective effort never managed to put a dent on it (in contrast to our older SCO 386 server, which was getting it on a daily basis).

i'm afraid that since then, though, build tools have plumped a bit. optimizing compilers in particularly (gcc, i'm looking at you) tend to produce quite 'impressive' readings in the top charts today.
 
Last edited by a moderator:
pelrun said:
Sphinxter said:
I usually use two 120x48 character xterms and it's not worth going blind, does not make that much sense outside of the novelty of it when there's a 25.5" display and two cores at 5ghz I could be using instead. Even if I wrote something on it compiling there sounds more painful than fun.
Building will be *no worse* than doing it on a desktop machine; most of the time it's just the normal "configure; make" litany.

In fact, cross-compilation is the more difficult option. Of course, if you're building something you wrote from scratch, it's normally fairly straightforward. But when you want to build/port something else...


No worse? if you can read the compiler output it's too damn slow. Cross compiling changes the format and instruction set output, nothing more or less. There's nothing difficult of magical about it and it's going to suck no matter what you commands you type. Working at 5ghz is always going to be a major improvement over trying to work at 500mhz and having a 25 inch display over a 4 inch display, wait what was your argument? Am I insane? The only difference between porting the code of someone else and yours is you didn't write it originally.
 
Last edited by a moderator:
Speed is not a big deal - if you're repeatedly building your own project during development you normally only have to rebuild a few object files at a time, not the whole thing (and if that's not the case, fix your build system!) Or you can always have swordfights on the office furniture while you wait. Even my Zaurus could build big projects from scratch reasonably quickly, and the Pandora is far, far faster.

When you spend a few hours struggling with the build environment just to get something to cross-compile, *that* is what I call painful.

Oh, and the screen size isn't particularly relevant either - that's what SSH is for. :D
 
Here's my thoughts:

I like to do hobby programming. None of my projects are likely to get big enough to need a lot of actual build time.
I know compilers just enough to use them. Cross-compiling sounds ... complicated.
So I'm thinking:

1. Code on the Pandora, compile on the Pandora [awesome portability]
2. USB keyboard on the Pandora [A bit more comfortable, need to be near a keyboard]
3. SSHFS + Scite + SSH from my laptop to the Pandora [Much easier to read, need to be near my laptop]

I could even:

1. SSH from laptop to Pandora [Let's say the Pandora is closed or in another room]
2. SSHFS back to laptop
3. Write my program on the laptop
4. Use the SSH to make the Pandora's GCC compile the source code that's mounted via SSHFS
5. Run the executable from the SSHFS mount

So even if I don't have an SD card, I can do basically everything on my laptop until I actually need to check the program's graphical output.

Even then, unless I'm using OpenGL, I can still X forward.
I could have the Pandora in my pocket on a wireless network and compile and run programs on it without ever touching it.

now if you'll excuse me, I think I see a nail over there that could use some of this SSH hammer.
 
lulzfish said:
Here's my thoughts:

I like to do hobby programming. None of my projects are likely to get big enough to need a lot of actual build time.
I know compilers just enough to use them. Cross-compiling sounds ... complicated.
So I'm thinking:

...

now if you'll excuse me, I think I see a nail over there that could use some of this SSH hammer.
You gotta be kidding. I had to buy a 24" monitor because I felt my 20" didn't have enough room for coding. I need a big screen to code, I just can't without one.

That said, I'm still going to be using my Pandora for programming if I'm bored on the train or something. I will probably link it to my Windows machine via Samba to compile my binaries too. But coding on it when I have a perfectly good computer around? No way.
 
Last edited by a moderator:
I just use my laptop for everything, it's 1920 x 1200 and 17 inches diagonal.

As for version control, I don't do anything big or important enough to really warrant it, but I'll probably use git or something if I have to. My point is that I can compile files remotely, so I don't need to use an SD card, which could potientally will, over the course of millennia, wear out or act as a compiling bottleneck. Most likely the latter.
 
lulzfish said:
I know compilers just enough to use them. Cross-compiling sounds ... complicated.
It's not. You have a compiler for the target platform on your computer. You call it the same as your x86 compiler. It compiles. Then you copy it to your SD card or whatever and run it on the target platform.

Ok, so it's not always that easy, there can be errors compiling sometimes or other problems, but they're generally the same problems you'll have with your x86 compiler. It's really not that difficult unless you're doing complicated stuff with it, so basically it's as difficult as compiling on x86.
 
Last edited by a moderator:
I don't know where to find a compiler that compiles for a different architecture though, I've only ever used the regular GCC that compiles [x86 / x64] on [x86 / x64].

For example, I'm running 64-bit Linux on my laptop, and I really have no idea how to compile binaries for a 32-bit Linux system or for the Pandora's ARM.
 
Generally you would get the compilers you need from the project that supplies them. For the GP2X, the best place was to get it from the Open2X people, though GPH also provided an ARM toolchain and libraries that was much older. Installation documentation is usually also provided by the project, either as a real document or in their community wiki or whatever. The 32-bit gcc would probably be in the repositories for your distro.

Seriously though, this is probably something you should consider learning if you're going to be doing any C/C++ programming past "hello world". Setting this stuff up is one of the easiest parts of programming. You may want to consider interpreted languages if this is beyond you and you're just doing it to play around. There's a lot less dicking around with weird shit with Python or Lua or even Java than there is with the C family.

Edit: I just realised this may come across more harsh than was intended. I don't want to talk down to you here, just get across that it's not as tough as you think. If you want to be serious about this stuff, the biggest barrier is the mental one.
 
lulzfish said:
I don't know where to find a compiler that compiles for a different architecture though, I've only ever used the regular GCC that compiles [x86 / x64] on [x86 / x64].

For example, I'm running 64-bit Linux on my laptop, and I really have no idea how to compile binaries for a 32-bit Linux system or for the Pandora's ARM.
You need a cross-compiler for that. Look for packages called arm-gcc or stuff like that.
 
Last edited by a moderator:
I didn't think it was harsh, but I have tried Python and Java and I don't really like either of them, and they aren't applicable to this specific task [Compiling for a Pentium II that has no hard drive and about 100 MB of RAM left to install anything in]

And if the Pandora can compile its own stuff anyway, I'll just do that.

But what's really starting to bother me is that NONE of my Computer Science classes have taught me how to compile anything. At all.

I took an Assembly class where we used NASM, and a few Java classes with the standard JDK, but even in my Intro. to C++ classes, we never learned how to actually compile anything. We were told, "Dev-cpp is pretty good, you should use that."

I've had 3 classes in C++ now and I don't officially know how to compile a program without an IDE helping me. I mean, I do 'know' how, but they certainly didn't tell me.

sindbad said:
You need a cross-compiler for that. Look for packages called arm-gcc or stuff like that.
I tried both "arm-gcc" and "gcc-arm" and Synaptic gave me a whole bunch of weird crap like "gcc-doc" and "gcc-4.3-source" and "gcc-avr" [close, no cigar] and "bugsquish"

Synaptic's search sucks. I'll see what Google thinks.

edit: www.gnuarm.com
Well, duh.

more edit: "On AMD64 systems GCC generates 64-bit code by default. The option -m32 allows 32-bit code to be generated instead."
... Is that seriously all I have to do? [for the Pentium II, I mean]
 
Last edited by a moderator:
Yeah that should work. I haven't used gcc on a 64-bit system so I couldn't tell you the options, I always just install a 32-bit OS to save myself some hassle.
 
Back
Top