Rockbox Technical Forums

Rockbox Development => Starting Development and Compiling => Topic started by: Rcdude10tc32 on January 02, 2008, 09:45:02 AM

Title: Writing Code Quicker
Post by: Rcdude10tc32 on January 02, 2008, 09:45:02 AM
hey guys, I have a feeling i might be answering my own question here but just curious how you all write code and not kill someone doing it.

-I've setup cygwin
-Wrote and compiled code using cygwin
-Ran it on the simulator and my rockbox
Everythings cool but it takes about 6 or 7 minutes for each compile of cygwin for the simulator build.

Is there any quicker way to compile just what i've changed?  Does anyone have it setup so a program like Eclipse automates the whole process and launches the simulator instantly?

Thanks
 -Justin
Title: Re: Writing Code Quicker
Post by: Bagder on January 02, 2008, 09:51:07 AM
Using Linux (even on vmware) is much quicker, 2-3 times faster on the same hardware than using cygwin. Then you can also use ccache and gain even more speedups when doing rebuilds of not too much changes.
Title: Re: Writing Code Quicker
Post by: LambdaCalculus on January 02, 2008, 09:59:26 AM
Does anyone have it setup so a program like Eclipse automates the whole process and launches the simulator instantly?

There are instructions for Eclipse floating around somewhere in the wiki, but they're old and depreciated now.

All you need is Linux, a good text editor (vi, Emacs, Kate, etc.), SVN, and the source to Rockbox (which also gives you the other tools you need via shell scripts).
Title: Re: Writing Code Quicker
Post by: Lear on January 02, 2008, 10:21:04 AM
-I've setup cygwin
-Wrote and compiled code using cygwin
-Ran it on the simulator and my rockbox
Everythings cool but it takes about 6 or 7 minutes for each compile of cygwin for the simulator build.

Is there any quicker way to compile just what i've changed?  Does anyone have it setup so a program like Eclipse automates the whole process and launches the simulator instantly?

Unless you have a very slow computer, or you're always making a full rebuild (which usually isn't necessary), I'd suspect a problem on your PC. In order to do its thing, Cygwin does some unusual things, which can cause slowdowns with some other applications (firewalls and antivirus programs typically). E.g., a firewall I used to use make Cygwin several times slower...
Title: Re: Writing Code Quicker
Post by: Rcdude10tc32 on January 02, 2008, 11:05:03 AM
...or you're always making a full rebuild (which usually isn't necessary...

My computers pretty good,
but you pretty much nailed it, it compiles Everything, all the rock plugins, doom, etc.  I didn't know you could only do part of it.  How do you compile just a part?
Title: Re: Writing Code Quicker
Post by: Mad Cow on January 02, 2008, 02:33:29 PM
If your computer's pretty good I would suggest vmware, it's a lot faster than Cygwin.
Title: Re: Writing Code Quicker
Post by: digerati1338 on January 02, 2008, 04:09:29 PM
Try using linux.  Much better than windows for development.  Of course you know the distro that gets recommended to anyone new is Ubuntu.  You can use it as a live CD if you don't want to install it, though that might negate any performance gains.

I recommend a good text editor instead of Eclipse.  Emacs is great.  M-x compile runs make, and it has an integrated shell.
Title: Re: Writing Code Quicker
Post by: tdtooke on January 02, 2008, 08:34:43 PM
I'm finding out linux is a million times faster than cygwin now myself.  Can't believe I never tried it before since most of my compiling environments on windows were basically linux simulators.  Depending on how much you want to change the source code you might want something like codeblocks for the heavy lifting so to speak.  Jumping through various files in a project with no tools to jump you to right where you want to be can be a pain.
Title: Re: Writing Code Quicker
Post by: digerati1338 on January 02, 2008, 10:04:17 PM
Good text editors (code oriented) should be able to do that.  Its must more hidden than in an IDE.
Title: Re: Writing Code Quicker
Post by: Rcdude10tc32 on January 03, 2008, 05:02:57 AM
Thanks guys,
its about time I get more into linux anyway, i've been poppin in live cds and not really doing anything with them for too long.  Should be some fun.
Thanks again
-Justin
Title: Re: Writing Code Quicker
Post by: crash91 on January 03, 2008, 08:18:00 AM
Good to hear youre switching to linux ;) Also, if you have a dual(or multi) core processor, i remember reading in the wiki, that you should do make -j to make it use all of your cores, or something like that. IT did speed up compile times for me.
Title: Re: Writing Code Quicker
Post by: MaW on January 08, 2008, 12:28:14 PM
make -j tells make to try and run builds in parallel if possible. It does this by invoking multiple compiles at the same time, where it thinks that it's safe to do so. The number after -j tells it how many jobs to do at once - typically they say (number of processors or cores) + 1 is a good number.

However, it is known that in some situations it can cause programs to not compile right (or not compile at all), so that's something to be aware of unless Rockbox's Makefiles have been specifically checked to make sure they're okay with make's parallel build system.
Title: Re: Writing Code Quicker
Post by: AlexP on January 08, 2008, 12:46:34 PM
make -j[whateveryouwant] works just fine to compile rockbox.
Title: Re: Writing Code Quicker
Post by: GodEater on January 08, 2008, 12:48:24 PM
Even "make -j" without the following number, where make tries to work out the best number of things to do at once on it's own works. Llorean and I had a race once, him using just -j, and me using -j3 (number of cores I had plus 1) - I lost!
Title: Re: Writing Code Quicker
Post by: Llorean on January 08, 2008, 03:48:59 PM
Just for you cygwin people looking for a point of reference, it takes my Linux computer at home, that cost me $250 to build total, 4 minutes and 41 seconds to SVN update, make clean, and then compile a build for H120, Gigabeat F, Archos Recorder, Nano, and Sansa, and then make zips out of each of those builds and move them to a folder that I can download from over the web.

So, five builds plus zip creation when I frequently hear of 7-10 minute build times for a single build in cygwin.
Title: Re: Writing Code Quicker
Post by: Rincewind on January 08, 2008, 11:42:58 PM
Just for you cygwin people looking for a point of reference, it takes my Linux computer at home, that cost me $250 to build total, 4 minutes and 41 seconds to SVN update, make clean, and then compile a build for H120, Gigabeat F, Archos Recorder, Nano, and Sansa, and then make zips out of each of those builds and move them to a folder that I can download from over the web.

So, five builds plus zip creation when I frequently hear of 7-10 minute build times for a single build in cygwin.

you should say _when_ you paid $250 for it. My Computer cost more than that but has a Athlon 1600 and a single clean compile (without svn up and make zip) takes me 5 minutes on linux already. I know this has mostly to do with my slow sdram, but my point is, price is not a good comparison point here.
Title: Re: Writing Code Quicker
Post by: Llorean on January 08, 2008, 11:49:10 PM
It cost me $250 a few months ago. But my point is more "Cygwin is very, VERY slow"
Title: Re: Writing Code Quicker
Post by: tdtooke on January 11, 2008, 11:41:58 PM
Anybody ever tried it in MSYS?  I could be wrong, but in theory you might be able to setup the cross-complier with that developers script in tools.  It wouldn't be as fast as linux native, but it might be a noticeable improvement on Cygwin.
Title: Re: Writing Code Quicker
Post by: Llorean on January 11, 2008, 11:45:23 PM
I tried MSYS, but was unable to get it to work effectively. MSYS itself turned out too unstable on my test system to ever get things set up. It also seemed *very* slow, from an interactive perspective, but again that could've been problems with my setup.

It's worth a shot, I suppose.