optimizing compilations for my hardware.
Hi. I'm running LFS 4.0. It has worked out quite well. But I didn't use any optimization flags during the compilations. How do I find out what optimization flags to use if I want to compile things? I did look at the man page of gcc, but that's an intimidating peace of documentation to say the least.
Will my software actually run faster when I compile it with optimization flags? And if so, how much faster will my software, in a typical case run? I have AMD CPU running at 900 MHz. Does it matter what mobo I have? Hope I'm making sence. Bey. |
Use CFLAGS & CXXFLAGS to change the defaults.
For instance I've used CFLAGS=-O3 -march=athlon-xp CXXFLAGS=-O3 -march=athlon-xp The mobo type is rather not important. Above makes the gcc to produce the code for CPU and optimize it for the CPU architecture. Some of the source package configs ignore these environment variables so I've changed them manually by editing configure scripts or Makefile files. The only packages I've left with default settings were the ones clearly mentioned in LFS books as "working badly" when compiled with optimization. |
Thanks
|
All times are GMT -5. The time now is 12:41 PM. |