LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 05-05-2004, 01:40 AM   #1
melinda_sayang
Member
 
Registered: Dec 2003
Location: Petaling Jaya
Distribution: Ubuntu
Posts: 475

Rep: Reputation: 31
automatically compile with i686 optimation


I compile a lot of softwares, And I want them optimized for my machine Pentium IV. So..... how do I make sure that everytime I compile the software, it is automatically optimized for Pentium IV.

For example: I compile kmymoney. After typing ./configure, I got this message:
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking target system type... i686-pc-linux-gnu
.....................

Is this mean that everytime I compile from sources, the software will recognize my machine. So I dont need to do anything to make sure that softwares compiled from sources are optimized for Pentium IV. Or not every softwares smart like this? Maybe some are stupid that not recognized my machine so that this stupid softwares are compiled for i386?

What should I do? Just make it simple, please..... Should I play with $CFLAGS environment variables???
 
Old 05-05-2004, 08:47 AM   #2
dopefish
Member
 
Registered: Nov 2003
Location: Northcliffe, WA
Distribution: Slackware 12.0
Posts: 481

Rep: Reputation: 30
Add -march=pentium4 to your CFLAGS
 
Old 05-05-2004, 11:05 AM   #3
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,552

Rep: Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872
Can someone know where I can find a list of all possible values for the arch parameter ?
 
Old 05-05-2004, 12:32 PM   #4
alhobbel
LQ Newbie
 
Registered: Mar 2004
Location: The Netherlands
Distribution: Slackware
Posts: 18

Rep: Reputation: 0
You can find more info on the -march option by looking at the gcc-info page ('info gcc') and going to node 'i386 and x86-64 Options'.
 
Old 05-05-2004, 01:57 PM   #5
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,552

Rep: Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872
thank you sir. I have an athlon duron and I have to choose between the various athlon CPU-TYPE now, I will try 'athlon'
 
Old 05-06-2004, 06:56 AM   #6
thegeekster
Member
 
Registered: Dec 2003
Location: USA (Pacific coast)
Distribution: Vector 5.8-SOHO, FreeBSD 6.2
Posts: 513

Rep: Reputation: 34
<Edit>
FYI..........Quite a few of the Slackware pkgs are optimized for i686, even tho' they may say name-1.2.3-i486-1.tgz...........After looking at the SlackBuild scripts, the standard compiler optimization flags are: -O2 -march=i486 -mcpu=i686....................At least for the newer build scripts that have the name of "<package_name>.SlackBuild". The older build scripts don't seem to use any optimization. or only the -O2 flag. You can see for yourself by either looking in the source directory on a Slack installation CD, or going to a ftp mirror and looking in the source directory.....
</Edit>

The -mcpu flag is the one that will optimize the binary for the named cpu architecture. The -march flag just makes it compatible for a particular cpu architecture. And they both use the same values.......So, to optimize for a particular arch, remember to use the -mcpu flag.......

For example, I have an Athlon 900 and use -march=i586 -mcpu=athlon 'cause I also have an old Compaq desktop with a P100 chip (i586) which I can use them on as well


-------------------------
Edited to avoid possible misconceptions about the official Slackpacks.

Last edited by thegeekster; 05-06-2004 at 06:07 PM.
 
Old 05-06-2004, 01:27 PM   #7
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,552

Rep: Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872
Very usefull features, gcc rocks... and also linuxquestions.org, thank you for clear up this point.
 
Old 05-06-2004, 02:19 PM   #8
g452
Member
 
Registered: May 2003
Location: tswane
Distribution: Slackware 9.1
Posts: 113

Rep: Reputation: 15
well

i learned something new today - nice - thanx
 
  


Reply



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
glibc-2.3.5 for i686: compile error ludovanput Linux - Software 0 10-04-2005 06:57 AM
2.6.12-1.1398_FC4-i686 compile error at2marty Fedora 1 08-29-2005 07:21 AM
cross compile for i686 Law1213 Linux - Software 2 06-20-2005 08:36 PM
2.6.9-5.EL-hugemem-i686, 2.6.9-5.EL-i686, 2.6.9-5.EL-smp-i686 , Which? arsham Linux - General 2 05-07-2005 11:21 PM
compile kernel for athlon, but boots as i686 ? bdp Linux - General 1 12-10-2003 04:18 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

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

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