Fast PhotoBridge Builds with Distcc
SummaryWhile the PhotoBridge SDK installs easily on a CompactFlash card, the 300 MHz processor takes a long time to compile all but the smallest files.
Distcc offers an elegant solution. After installing a cross-compiler on a fast computer on the same network, you can use distcc to send the compilation work to that server from the PhotoBridge. However, since preprocessing still takes place on the PhotoBridge, there is no need to copy the SDK files onto the server. This solution really provides the best of both worlds -- easy installation of the SDK as provided by Roku, and fast compilation on a server instead of the slow PhotoBridge processor.
RequirementsYou should have:
Step 1: Install the Cross-Compiler on the ServerOn the server, install a gcc cross-compiler that targets the MIPS instruction set used on the PhotoBridge. I found one created by Jon Lech Johansen that comes in an RPM called rokutools-20020423-1.src.rpm. Installation is a two-step process described here. In short, as root:
Step 2: Install Distcc on the ServerDownload distcc and compile it. On my server it compiled cleanly using the usual steps:
Step 3: Install Distcc on the PhotoBridgeTake the same version of distcc that you installed on the server and place it in a folder accessible to the PhotoBridge. The same steps as above should be performed, but with some extra steps.
Step 4: Start Distccd on the ServerFirst, add the cross-compiler directory (
distccd --jobs 8 --allow 10.1.1.1/8
Step 5: Setup "volunteer" list on the PhotoBridge and BuildOn the PhotoBridge, setup the DISTCC_HOSTS environment variable to include the server address. Add "/2" or "/3" if the server can handle 2 or three simultaneous builds.
Then, when you run make, tell make to do parallel builds and use distcc:
make -j4 CC="distcc gcc" CPP="distcc gcc" CXX="distcc gcc"All .c and .cpp files should now be built on your fast server. Enjoy your vastly shortened build times!
Copyright © 2016 Andrew Oliver