LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Compiler OPtimisations (https://www.linuxquestions.org/questions/slackware-14/compiler-optimisations-170909/)

ShockTherapy 04-16-2004 09:39 AM

Compiler Optimisations
 
I would like to inquire about the method in which one passes compiler optimisations, when compiling large programs such as galeon. I edited a Makefile to reflect my prefrences which were:
Code:

-mcpu=athlon -march=athlon -g -O3
These are the relevant optimisations for my AMD Duron 750 Mhz processor but when compiling I noticed it was not using the above optimisations for every thing. I then found out post compile that there were multiple Makefiles. So how would one go about setting default optimisations without editing a large number of Makefiles by hand ?

I have already come across a solution which involved setting environment variables and passing them to make but, the flags in the Makefiles also contain some custom arguements so compilation fails if I just set my optimisations in the shell and pass them to make.

So my question is is there anyway to just append -mcpu=xxx -march=xxx and changing the default -O2 optimisation level to -O3 for multiple Makefiles ?





Edit: spelling

Waldi 04-19-2004 08:30 AM

You have to pass appropriate parameter to make, read "install" info in source package carefully for detailed info.
If you want to use it permanently, add CFLAGS=.... and CXXFLAGS=.... variables to your /etc/profile

BSlack 04-20-2004 10:19 AM

...or you can simply use:

export CFLAGS='-march=athlon -g -O3'

and/or other flags before running configure script.

P.S.: I think -march option implies -mcpu. Check gcc info manual.


All times are GMT -5. The time now is 04:31 AM.