Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Slackware This Forum is for the discussion of Slackware Linux.


  Search this Thread
Old 04-16-2004, 09:39 AM   #1
LQ Newbie
Registered: Nov 2003
Location: London, U.K
Distribution: RedHat 9, Gentoo, I'm Working On More so Don't Bug Me.
Posts: 23

Rep: Reputation: 15
Question 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:
-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

Last edited by ShockTherapy; 04-16-2004 at 11:07 AM.
Old 04-19-2004, 08:30 AM   #2
Registered: Apr 2003
Location: Warsaw, Poland
Distribution: Slackware current
Posts: 133

Rep: Reputation: 15
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

Last edited by Waldi; 04-19-2004 at 08:34 AM.
Old 04-20-2004, 10:19 AM   #3
Registered: Nov 2003
Location: Italy: 44 42' N - 12 11' E
Distribution: Slackware, what else?!!
Posts: 63

Rep: Reputation: 15
...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.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
checking for C compiler default output... configure: error: C compiler cannot create fiorejm Linux - Software 6 11-12-2009 12:35 PM
Identifying CPU/Architecture for GCC Optimisations detly Linux - Hardware 3 04-27-2005 09:44 PM
advice on -O optimisations for different parts of gentoo ? qwijibow Programming 6 08-06-2004 06:27 PM
Compiling mpeglib without optimisations seb3579 Linux - Software 1 06-21-2004 08:51 PM
Compiler conundrum: Which came first, a compiler, or it's source code? fr0zen Programming 21 01-29-2004 04:31 AM > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 08:13 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration