I am writing a server application which has a large amount of source code. Compiling the application on my Intel Atom z510 takes around 15-20 minutes, and about 2-3 minutes on my Intel i7.
I am very new to cross compiling, new as in I’ve never done it. I can’t find any reference on how to cross compile to the Z510. I found a great SO article on optimization flags for the atom here. However, no description on how to use them on my Intel i7 pc for my Intel Atom CPU.
I am making the assumption that anything compiled on my i7 will be default to being optimized for my i7, causing performance drops on the Atom. Any advice/search terms/websites would be greatly appreciated.
As always, thank you so much ahead of time.
Edit: I am using gcc 4.4. Apologies. (The one that comes with Ubuntu 10.04)
Constantin
I think your assumption that code compiled on the Atom is automatically optimized for the Atom is faulty.
Even if you request that behavior via
-march=native -mtune=native, gcc 4.4 doesn’t know how to optimize for Atom.And code optimized for the Core i7 would run more slowly than code compiled on the Atom only if you are passing those flags to get code optimized for the Core i7 (which I think also requires a later version of gcc). Getting rid of those flags would cause the compiler on the i7 to generate the same code as the one on the Atom.