LinuxQuestions.org
Review your favorite Linux distribution.
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-14-2004, 02:02 PM   #1
sethgeekx86
Member
 
Registered: Jan 2004
Distribution: Slackware 9.1 SUSE 9.0
Posts: 131

Rep: Reputation: 15
optimizing to Athlon XP


What file do i edit so every time i run make it optimizing to An Athlon XP cpu.
 
Old 05-14-2004, 02:25 PM   #2
J.W.
LQ Veteran
 
Registered: Mar 2003
Location: Boise, ID
Distribution: Mint
Posts: 6,642

Rep: Reputation: 87
I think what you're asking about is a custom compile of your kernel. One of the configurable options is the Processor family; you would just want to choose Athlon. -- J.W.
 
Old 05-14-2004, 03:01 PM   #3
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,552

Rep: Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872
You can ./configure your program with cpu optimisation like this :

CFLAGS="-O2 -march=i486 -mcpu=athlon-xp" ./configure

Edit :
- O2 (note : O like Optimise not 0 like 0 + 1) add optimisation (level 2)
-march set the binary compatibility
-mcpu set optimisation for processor

For more details do 'info gcc'

Last edited by keefaz; 05-14-2004 at 04:45 PM.
 
Old 05-14-2004, 05:07 PM   #4
sethgeekx86
Member
 
Registered: Jan 2004
Distribution: Slackware 9.1 SUSE 9.0
Posts: 131

Original Poster
Rep: Reputation: 15
I wondering if there is one file i can edit so every time i build something it goes to Athlon XP.
 
Old 05-14-2004, 05:11 PM   #5
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,552

Rep: Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872
I don't think it is possible due to the diversity of software package structures, and for those written in c++ there are more flags to do optimisation.
 
Old 05-14-2004, 08:03 PM   #6
thegeekster
Member
 
Registered: Dec 2003
Location: USA (Pacific coast)
Distribution: Vector 5.8-SOHO, FreeBSD 6.2
Posts: 513

Rep: Reputation: 34
Quote:
Originally posted by sethgeekx86
I wondering if there is one file i can edit so every time i build something it goes to Athlon XP.
Why not add that CFLAGS variable keefaz posted as an environment variable to your startup script, such as ~/.bashrc.......I use the following entries in my startup script:
Code:
CFLAGS='-O2 -march=i586 -mcpu=athlon -pipe'
CXXFLAGS="$CFLAGS"
export CFLAGS CXXFLAGS
The "CXXFLAGS" variable is for C++ binary optimization, "CFLAGS" is for C binary optimization

By doing this, when configuring an app, these variables are usually picked up by automake and added to the Makefile created from the ./configure command.........There are a few exceptions where an app will ignore these evironment variables, but for the most part they will be included automatically.......One app I know that ignores these variables is compiling QT, it uses '-O2 -march=i486 -mcpu=i686', no matter what you try to pass it.......

BTW.....the '-pipe' option is compiler option that tells the compiler it can pipe it's commands while compiling an app......helps speed up compiling

Also, after adding anything to the startup script. be sure to update it by using the 'source' command. For example:

source ~/.bashrc


Last edited by thegeekster; 05-14-2004 at 08:12 PM.
 
Old 05-15-2004, 07:44 AM   #7
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,552

Rep: Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872
Nice tip thegeekster, I hadn't the idea to add CFLAGS to .bashrc, I will do now
 
Old 05-20-2004, 09:03 AM   #8
tank728
Member
 
Registered: Sep 2003
Posts: 142

Rep: Reputation: 17
fells I have a pentium4 so I can just put -mcp=pentium4 right? But also I do not have ~/.bashrc should I create it with jsut those 3 lines of code that thegeekster mentioned? The closest file I have to ~/.bashrc is ~/.bash_history.

-tank
 
Old 05-20-2004, 03:28 PM   #9
thegeekster
Member
 
Registered: Dec 2003
Location: USA (Pacific coast)
Distribution: Vector 5.8-SOHO, FreeBSD 6.2
Posts: 513

Rep: Reputation: 34
tank:

.bashrc in a user's home directory is not created by default.............so yes, create one with those variables
 
  


Reply


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
MythTV Optimizing Kdr Kane Linux - Software 6 07-09-2005 05:29 AM
Optimizing Apache SiLiCoN Linux - Networking 2 06-15-2005 02:56 AM
Optimizing XP for Gaming nuka_t General 11 08-18-2004 03:21 PM
Is it an ATHLON, or ATHLON-THUNDERBIRD ? qwijibow Linux - General 5 07-27-2004 06:33 AM
optimizing LINUX nautilus_1987 Linux - General 10 11-03-2002 11:24 AM

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

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

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