Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Wait you ssh into a BeagleBoneBlack and compile C on the device?

I’ve seen some janky envs in my life but this is pretty high up. Do you never enable LTO when linking deps? These devices are literally 1000x slower than a typical 8 core desktop.



Yes, and edit/debug code in the device too. Setting up an identical cross compilation environment with all the same shared libraries (it's a full Linux system after all) and such is non-trivial and C compiles fast enough it's fine... (1000 times is a bit of an exaggeration anyway...)

Now maybe if I were an emacs user this setup wouldn't work...


Compiling a single C file program, linking glib, libarchive and some other stuff (repeated runs, to allow for caching inputs):

Orange Pi 3:

    real 0m0.916s
    user 0m0.839s
    sys 0m0.074s
5950X

    real 0m0.080s
    user 0m0.064s
    sys 0m0.016s
Slower, but not nearly 1000x in practice. Cortex-A8 is a bit slower, still, but not by much.


well, one project I work on compiles ~100 times faster on my desktop (Ryzen 5 3600) than the BBB if building from scratch, and that's not accounting for multiple cores, so 1000x might be reasonable for a project with sufficient compile-time parallelization. But it's still fast enough (< 10 seconds ) on the BBB that setting up a cross-compilation environment isn't worth it (and obviously incremental compiles are faster).


> Wait you ssh into a BeagleBoneBlack and compile C on the device?

Exactly how am I supposed to access the hardware that only exists on the Beaglebone Black itself, otherwise?

You can cross-compile all day, but, in the end, I need to code to be running over there to toggle those GPIOs. I need the debugging to be over there. I need VSCode to be running over there.

Not all programming is web programming.


I mean, theoretically it's possible to set up a cross-compilation environment (which would require mirroring basically the entire /usr of the BBB) and copy over compiled files for running / debugging. But it's only worth it if compiling takes a long time (or I suppose if you were to use templaty C++ or rust or something, you may not have enough memory on the BBB to actually compile things... but maybe don't do that?).


rust actually does okay on the BBB unless you activate heavy macros at which point the memory blows up, and it grinds to a halt.

rust-analyzer, for example, could be built (slowly) on the BBB until recently. The last refactoring of it ... ooof ... did something to macros and now the memory footprint is gargantuan.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: