Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Portage & Programming
  • Search

CFLAGS Central (Part 2)

Problems with emerge or ebuilds? Have a basic programming question about C, PHP, Perl, BASH or something else?
Post Reply
Advanced search
408 posts
  • Page 12 of 17
    • Jump to page:
  • Previous
  • 1
  • …
  • 10
  • 11
  • 12
  • 13
  • 14
  • …
  • 17
  • Next
Author
Message
CosminG
Apprentice
Apprentice
User avatar
Posts: 166
Joined: Wed Jan 19, 2005 1:26 am

  • Quote

Post by CosminG » Mon Sep 04, 2006 7:53 am

Thank you nxsty. :D
Top
Gooserider
Apprentice
Apprentice
User avatar
Posts: 165
Joined: Fri Dec 30, 2005 5:30 am
Location: Universe, Milky Way Galaxy, Solar System, Earth, North America, USA, MA, North Billerica

Need help ID'ing CPU for CFLAGS

  • Quote

Post by Gooserider » Wed Sep 13, 2006 5:44 am

Hi, I have an interesting CPU that seems to be unclear about just what it is... I aquired it second hand, and don't have any paperwork on it.

According to this article on Safe Cflags I have two possible CPU's that it could be, depending on which things one looks at. Unfortunately, each has a slightly different set of CFLAGS, and I'm not sure which I should use, or even if it makes much of a difference. (the GNU Online GCC docs weren't clear about what if any difference there was.)
Doing "cat /proc/cpuinfo" gives me
processor : 0
vendor_id : AuthenticAMD
cpu family : 6
model : 10
model name : AMD Athlon(tm) XP 2500+
stepping : 0

cpu MHz : 1830.030
cache size : 512 KB
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 1
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 mmx fxsr sse syscall mmxext 3dnowext 3dnow up ts
bogomips : 3664.15
Note the model, model name, and stepping :!:

The article says (in part):
Athlon XP/Geode NX (AMD)
vendor_id : AuthenticAMD
cpu family : 6
model : 6
stepping : 2

CHOST="i686-pc-linux-gnu"
CFLAGS="-march=athlon-xp -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"

Athlon MP (AMD)
vendor_id : AuthenticAMD
cpu family : 6
model : 10
model name : AMD Sempron(tm)
stepping : 0

CHOST="i686-pc-linux-gnu"
CFLAGS="-march=athlon-mp -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"
As you can see, the model name clearly says its an XP, which is what I was expecting, given that it is a single CPU mobo, and that I was told it was an XP when I got it. However, the model and stepping numbers say that it's an MP. Which is it :?: and which -march=flag should I use, athlon-xp or athlon-mp :?: Does it matter that much? My recollection is that the only significant difference between the XP and MP CPU's is that the MP was intended for use in multi-cpu boards, and the XP was intended for single CPU applications. Given that this is a single CPU box, does it make much difference if I possibly have a "wrong" CPU in it?

BTW, I intend to go back and update the article when I get an answer.

Thanks,

Gooserider
Box 1: P2 Celeron 400, 320mb RAM, 80GB HD, Cirrus Logic 4614/22/24 sound card, ATI 3D RAGE PRO AGP 1X/2X (sound & video onboard)
Box 2: AMD Athlon 2500+ 512mb RAM, 80GB HD, Gigabyte K7 Triton (Nvidia) mobo, GeForce2 video
Top
dalek
Veteran
Veteran
User avatar
Posts: 1354
Joined: Fri Sep 19, 2003 3:35 pm
Location: Mississippi USA

  • Quote

Post by dalek » Wed Sep 13, 2006 6:35 am

I have a known Athlon XP 2500+ bought form newegg. This is what I get:

Code: Select all

root@smoker / # cat /proc/cpuinfo
processor       : 0
vendor_id       : AuthenticAMD
cpu family      : 6
model           : 10
model name      : AMD Athlon(tm) XP 2500+
stepping        : 0
cpu MHz         : 1830.130
cache size      : 512 KB
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 1
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 mmx fxsr sse syscall mmxext 3dnowext 3dnow up ts
bogomips        : 3665.02

root@smoker / # 
Maybe that will help you some.

:D :D :D :D :
My rig: Gigabyte GA-970A-UD3P mobo, AMD FX-8350 Eight-Core CPU, ZALMAN CNPS10X Performa CPU cooler,
G.SKILL 32GB DDR3 PC3 12800 Memory Nvidia GTX-650 video card LG W2253 Monitor
60TBs of hard drive space using LVM
Cooler Master HAF-932 Case
Top
Gooserider
Apprentice
Apprentice
User avatar
Posts: 165
Joined: Fri Dec 30, 2005 5:30 am
Location: Universe, Milky Way Galaxy, Solar System, Earth, North America, USA, MA, North Billerica

  • Quote

Post by Gooserider » Wed Sep 13, 2006 7:19 pm

Thanks Dalek :!: :!: :!:

That is exactly what I needed to know. I will go edit the article (assuming it lets me) to reflect that XP's can also show the info that you and I have.

Gooserider
Box 1: P2 Celeron 400, 320mb RAM, 80GB HD, Cirrus Logic 4614/22/24 sound card, ATI 3D RAGE PRO AGP 1X/2X (sound & video onboard)
Box 2: AMD Athlon 2500+ 512mb RAM, 80GB HD, Gigabyte K7 Triton (Nvidia) mobo, GeForce2 video
Top
dalek
Veteran
Veteran
User avatar
Posts: 1354
Joined: Fri Sep 19, 2003 3:35 pm
Location: Mississippi USA

  • Quote

Post by dalek » Wed Sep 13, 2006 8:49 pm

I was hoping that would help since I new for sure what I had. I bought mine brand new and in pretty wrappings.

Glad that helped though.

:D :D :D :D :D
My rig: Gigabyte GA-970A-UD3P mobo, AMD FX-8350 Eight-Core CPU, ZALMAN CNPS10X Performa CPU cooler,
G.SKILL 32GB DDR3 PC3 12800 Memory Nvidia GTX-650 video card LG W2253 Monitor
60TBs of hard drive space using LVM
Cooler Master HAF-932 Case
Top
BaYGoN
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 109
Joined: Tue Sep 21, 2004 8:07 pm
Location: Brasília - DF (Brasil)

  • Quote

Post by BaYGoN » Thu Sep 21, 2006 2:07 pm

Hi all.

In the next few days, i'll be installing Gentoo 2006.1 on my machine (see my signature) and i want some feedback on my CFLAGS of choice.
This time i want a pure 32 bit enviroment (i have a amd64 enviroment running right now), and after much reading, i picked up these flags:

Code: Select all

CFLAGS="-march=athlon-xp -msse2 -msse3 -O2 -pipe -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
CXXFLAGS="${CFLAGS}"
As you can see, i'm very conservative about the flags, simply because i want a good balance between a fast and stable system.
My processor has SSE3 support, i'm very sure of that.

I've seen posts of people with Athlons 64 compiling a 32 enviroment, using athlon64 as -march, and i'm confused about one think:

(From GCC 4.1.1 manual)
k8, opteron, athlon64, athlon-fx
AMD K8 core based CPUs with x86-64 instruction set support. (This supersets MMX, SSE, SSE2, 3dNOW!, enhanced 3dNOW! and 64-bit instruction set extensions.)
Using athlon64 as march implies/activates the 64-bit instruction set extensions, as per the GCC Manual.

Wouldnt be wiser to choose athlon-xp as march and activating sse2 and sse3, as i intend to do?
Or i'm getting it wrong and won't make any difference anyway, given the CHOST being set to i686?

I appreciate any comments on that.

[edit]
Another question: I'll be upgrading my processor with an Athlon X2 before the end of this year. If i use the CFLAGS i have chosen, will i have any sort of problems?

Thanks.
Linux User #433896
HP DV6-6190US / Linux 3.4.6-pf #1 SMP PREEMPT Fri Aug 10 13:19:26 BRT 2012 x86_64 Intel(R) Core(TM) i7-2630QM CPU @ 2.00GHz GenuineIntel GNU/Linux
"The destiny of every guru is to be a noob for eternity"
Top
letto
n00b
n00b
Posts: 6
Joined: Sat Aug 26, 2006 3:59 pm

  • Quote

Post by letto » Mon Sep 25, 2006 9:06 am

Hi ,
I've just recently build two gentoo instalation on the same machine. They were meant to be identical so that i could compare the different CFLAGS and how the size increased with different options.

To make a clone of the firs gentoo install i just copied the /var/lib/portage/world to the second instalation and after updating and emerging kde and koffice did this

Code: Select all

emerge --noreplace `cat world.new`
As the systems were synced at the same time and i copied /etc/portage over, this gave me two almost identical systems.
After a little extra uninstalling the difference was minimal.

Code: Select all

letto@localhost ~/devel/genscript $ diff pkg_list.O2 pkg_list.O3
442c442
< sys-apps/dbus-0.62-r1
---
> sys-apps/dbus-0.62
letto@localhost ~/devel/genscript $                                                                                      
The important difference was in make.conf. For the first system:

Code: Select all

letto@localhost ~/devel/genscript $ cat /etc/make.conf|grep -e FLAGS -e ACCEPT
CFLAGS="-march=k8 -O3 -pipe -msse3 -fprefetch-loop-arrays -fmerge-all-constants -funroll-loops -fpeel-loops -ftracer -ftree-loop-ivcanon -funswitch-loops -ftree-vectorize -fivopts -ftree-loop-im -ftree-loop-linear"
CXXFLAGS="${CFLAGS}"
ACCEPT_KEYWORDS="~amd64"
LDFLAGS="-Wl,-O1 -Wl,--sort-common -Wl,-z,now"
letto@localhost ~/devel/genscript $
It's important to note that the majority of packages were build without -fivopts here.
And for the second system:

Code: Select all

(chr) letto@localhost ~/devel/genscript $ cat /etc/make.conf|grep -e FLAGS -e ACCEPT
CFLAGS="-march=k8 -O2 -pipe -msse3 -ftree-vectorize"
CXXFLAGS="${CFLAGS}"
ACCEPT_KEYWORDS="~amd64"
LDFLAGS="-Wl,-O1"
(chr) letto@localhost ~/devel/genscript $
Now to measure the difference in size of the binaries i made a bash script:

Code: Select all

letto@localhost ~/devel/genscript $ cat bin_size.sh
#!/bin/bash

TOTAL=0
LIBS=0

for i in `seq 1 20`;
do
        DIR=`echo $PATH|cut -d: -f$i`
        if [[ -e $DIR ]] ; then
                TOTAL=`expr $TOTAL + $(du $DIR |cut -f1)`
                du -h $DIR
        fi
done

echo binaries $TOTAL

echo
for i in `cat /etc/ld.so.conf |grep -v \#`
do
        #echo $i
        if [[ -e $i ]] ; then
                LIBS=`expr $LIBS + $( du -s $i|cut -f1) `
                du -hs $i
        fi
done

TOTAL=`expr $TOTAL + $LIBS`
echo libs $LIBS
echo $TOTAL

letto@localhost ~/devel/genscript $
and the result of running the script

Code: Select all

letto@localhost ~/devel/genscript $ ./bin_size.sh
0       /usr/local/bin
191M    /usr/bin
11M     /bin
0       /opt/bin
581K    /usr/x86_64-pc-linux-gnu/gcc-bin/4.1.1
2.0M    /opt/blackdown-jdk-1.4.2.03/bin
904K    /opt/blackdown-jdk-1.4.2.03/jre/bin
56M     /usr/kde/3.5/bin
7.6M    /usr/qt/3/bin
13M     /usr/games/bin
binaries 286729

0       /usr/local/lib
8.4M    //usr/lib32/opengl/nvidia/lib
8.3M    //usr/lib64/opengl/nvidia/lib
0       /lib
0       /usr/lib
0       /usr/local/lib
22M     /lib64
817M    /usr/lib64
0       /usr/local/lib64
2.3M    /lib32
44M     /usr/lib32
0       /usr/local/lib32
0       /usr/x86_64-pc-linux-gnu/lib
80M     /usr/lib/gcc/x86_64-pc-linux-gnu/4.1.1
5.0M    /usr/lib/gcc/x86_64-pc-linux-gnu/4.1.1/32
969K    /usr/lib64/nspr
4.7M    /usr/lib64/nss
0       /usr/lib
14M     /opt/blackdown-jdk-1.4.2.03/jre/lib/amd64/
44K     /opt/blackdown-jdk-1.4.2.03/jre/lib/amd64/native_threads/
6.5M    /opt/blackdown-jdk-1.4.2.03/jre/lib/amd64/server/
7.3M    /emul/linux/x86/usr/qt/3/lib
0       /usr/kde/3.5/lib
184M    /usr/kde/3.5//lib64
0       /usr/qt/3/lib
19M     /usr/qt/3/lib64
2.8M    /emul/linux/x86/lib
43M     /emul/linux/x86/usr/lib
2.8M    /emul/linux/x86/lib
43M     /emul/linux/x86/usr/lib
5.8M    /usr/games/lib
809K    /usr/lib64/libstdc++-v3/
libs 1347635
1634364
letto@localhost ~/devel/genscript $
and on the second system

Code: Select all

(chr) letto@localhost ~/devel/genscript $ ./bin_size.sh
0       /usr/local/bin
160M    /usr/bin
9.0M    /bin
0       /opt/bin
581K    /usr/x86_64-pc-linux-gnu/gcc-bin/4.1.1
2.0M    /opt/blackdown-jdk-1.4.2.03/bin
904K    /opt/blackdown-jdk-1.4.2.03/jre/bin
49M     /usr/kde/3.5/bin
7.0M    /usr/qt/3/bin
9.9M    /usr/games/bin
binaries 243084

0       /usr/local/lib
8.4M    /usr/lib32/opengl/nvidia/lib
8.3M    /usr/lib64/opengl/nvidia/lib
0       /lib
0       /usr/lib
0       /usr/local/lib
21M     /lib64
804M    /usr/lib64
0       /usr/local/lib64
2.3M    /lib32
44M     /usr/lib32
0       /usr/local/lib32
0       /usr/x86_64-pc-linux-gnu/lib
80M     /usr/lib/gcc/x86_64-pc-linux-gnu/4.1.1
5.0M    /usr/lib/gcc/x86_64-pc-linux-gnu/4.1.1/32
877K    /usr/lib64/nspr
4.7M    /usr/lib64/nss
0       /usr/lib
14M     /opt/blackdown-jdk-1.4.2.03/jre/lib/amd64/
44K     /opt/blackdown-jdk-1.4.2.03/jre/lib/amd64/native_threads/
6.5M    /opt/blackdown-jdk-1.4.2.03/jre/lib/amd64/server/
7.3M    /emul/linux/x86/usr/qt/3/lib
0       /usr/kde/3.5/lib
171M    /usr/kde/3.5//lib64
0       /usr/qt/3/lib
19M     /usr/qt/3/lib64
2.8M    /emul/linux/x86/lib
43M     /emul/linux/x86/usr/lib
2.8M    /emul/linux/x86/lib
43M     /emul/linux/x86/usr/lib
4.6M    /usr/games/lib
817K    /usr/lib64/libstdc++-v3/
libs 1318182
1561266
(chr) letto@localhost ~/devel/genscript $
Seems that for the executables i got a 17.95% size increase and for the libraries a 2.23% while having an overall 4.68% increase. It's important to note however that this includes some -bin packages and packages that filter CFLAGS out.
Anyway now i wanted to measure the difference between the files in /usr/bin and this is what i did :

Code: Select all

letto@localhost ~/devel/genscript $ cat bin_dir.sh
#!/bin/bash

TOTAL=0

for i in `ls /usr/bin`
do
        B1=$(ls -l /mnt/disk/usr/bin/$i|cut -f3 -dt|cut -f1 -dS)
        B2=$(ls -l /usr/bin/$i|cut -f3 -dt|cut -f1 -dS)
        echo $(./proc $B1 $B2) $i $B1 $B2
done
letto@localhost ~/devel/genscript $
proc is a little c program that divides the numbers and outputs a float number
Here is an interesting section of the output of ./bin_dir.sh |sort :

Code: Select all

100.9 % paperconf 9448 9368
101.2 % giffiltr 7168 7080
101.3 % gnome-cups-manager 108624 107232
101.6 % osx 77720 76472
101.9 % epsilon_thumb_test 7560 7416
102.9 % pat2dat 144296 140248
106.3 % dat2c 27552 25920
107.5 % cupstestdsc 11136 10360
108.0 % autoconf 27 25
108.0 % autoheader 27 25
108.0 % autom4te 27 25
108.0 % autoreconf 27 25
108.0 % autoscan 27 25
108.0 % autoupdate 27 25
108.0 % ifnames 27 25
110.1 % ecore-config 2585 2347
110.8 % textconv 15576 14056
111.0 % ospent 19576 17632
19.3 % pgmtexture 19576 101464
42.8 % pnmconvol 32176 75136
43.0 % pbmupc 12200 28360
47.5 % cabextract 52792 111200
47.5 % dc 40512 85232
49.3 % ppmtoilbm 37000 75032
49.7 % pgmmorphconv 8264 16632
50.9 % cxpm 23728 46592
52.9 % pbmpage 8016 15144
53.0 % ilbmtoppm 33400 63064
53.2 % funzip 21880 41096
53.5 % tcrequant 76920 143776
53.7 % rletopaint 37368 69608
54.0 % pcxtoppm 11640 21560
54.3 % bc 77864 143416
54.6 % cameratopam 93624 171424
55.7 % grotty 82320 147888
56.6 % eyuvtoppm 8776 15512
56.6 % gpgv 325728 574984
57.1 % unrar 175488 307408
57.3 % grolj4 82360 143832
57.6 % unarj 21040 36504
57.8 % fant 44872 77680
57.8 % rleldmap 44880 77688
57.9 % mpeg2encode 78880 136232
58.0 % pbmtoln03 8096 13952
58.2 % grn 60952 104696
58.3 % pre-grohtml 74400 127680
58.4 % grodvi 86456 147928
58.5 % pgmmedian 10296 17592
58.9 % ppmrough 10048 17072
59.3 % pnmtoddif 12408 20928
59.3 % rletorla 41120 69392
59.3 % texindex 23976 40400
59.4 % ppmtopcx 13272 22336
59.6 % gif2epsn 17528 29392
59.6 % pnmtofiasco 145744 244512
59.7 % grops 128808 215752
59.8 % install-info 29136 48744
59.9 % msggrep 97944 163544
60.1 % refer 123304 205256
60.4 % mpeg3cat 162440 268944
60.4 % mpeg3dump 162440 268944
60.7 % bggen 11816 19480
60.9 % pktopbm 11760 19296
61.0 % mpeg3toc 166504 273008
61.0 % soxmix 309416 506992
61.1 % sox 309096 506032
61.2 % ppmtogif 15512 25328
61.3 % gpgsplit 41288 67408
61.5 % gif2x11 19624 31888
61.5 % rlesplice 40744 66256
61.8 % grolbp 95664 154768
61.8 % picttoppm 48592 78624
pgmtexture seems to be a very good example of a program that is affected gcc optimizations. There are also a lot of programs that are at 100% wich probably means that they are not affected by the optimizations. The "program density" tends to be higher as the number aproaches 100%
Top
ann0
n00b
n00b
Posts: 1
Joined: Tue Oct 03, 2006 3:11 pm

  • Quote

Post by ann0 » Tue Oct 03, 2006 3:17 pm

Here's mine, what do you think?

Code: Select all

CFLAGS="-march=pentium2 -mtune=pentium2 -O2 -pipe -ftracer -fweb -fforce-addr -fomit-frame-pointer 
-fexpensive-optimizations -frerun-cse-after-loop -frerun-loop-opt -falign-functions=4 -Qn -fno-ident"
Top
golding
Apprentice
Apprentice
User avatar
Posts: 232
Joined: Tue Jun 07, 2005 12:20 am
Location: Adelaide / South Australia

  • Quote

Post by golding » Wed Oct 04, 2006 6:13 am

I have bought an AMD Athlon64-3800+ 939 and re-used my existing install, AMD Athlon XP 2500+ Barton, and everything is running fast and really sweet.

What I would like to do, as I don't want to use a chrooted env for the odd 32bit app, is run my AMD64 in a 32bit enhanced environment.

I would like to know, providing any body knows of course, if I left my CHOST ("i686-pc-linux-gnu") as is and ONLY changed my CFLAGS to reflect the CPU, will this run 32bit compile or will the 64 bit CFLAGS automatically produce a 64bit compiled system?

Current config:

Code: Select all

CFLAGS="-march=athlon-xp -mtune=athlon-xp -O2 -mmmx -m3dnow -msse -pipe -fomit-frame-pointer -momit-leaf-frame-pointer -fno-ident"
CHOST="i686-pc-linux-gnu"
Proposed config:

Code: Select all

CFLAGS="-march=athlon64 -mtune=athlon64 -O3 -mmmx -mmmxext -m3dnow -m3dnowext -msse -msse2 -pipe -fomit-frame-pointer -momit-leaf-frame-pointer -fno-ident"
CHOST="i686-pc-linux-gnu"
Regards, Robert

..... Some people can tell what time it is by looking at the sun, but I have never been able to make out the numbers.
Top
cybermonkey
Apprentice
Apprentice
User avatar
Posts: 194
Joined: Mon Aug 11, 2003 10:54 am

  • Quote

Post by cybermonkey » Wed Oct 04, 2006 9:41 am

Hi all,

I'm building a new system this weekend, A celeron D 2.53ghz.

I don't need 64 bitness and have mainly used AMD in the past so a few pointers from the CFLAGS god's
that dwell in this thread would be appreciated :D So....... :arrow:

What would be the best cflags to use?

Excuse me if this has already been posted, But this is one hell of a thread to get through :(
Top
cybermonkey
Apprentice
Apprentice
User avatar
Posts: 194
Joined: Mon Aug 11, 2003 10:54 am

  • Quote

Post by cybermonkey » Wed Oct 04, 2006 11:03 am

cybermonkey wrote:Hi all,

I'm building a new system this weekend, A celeron D 2.53ghz.

I don't need 64 bitness and have mainly used AMD in the past so a few pointers from the CFLAGS god's
that dwell in this thread would be appreciated :D So....... :arrow:

What would be the best cflags to use?

Excuse me if this has already been posted, But this is one hell of a thread to get through :(
[SOLVED]:

Found this on the wiki:-

Code: Select all

CHOST="i686-pc-linux-gnu"
CFLAGS="-march=prescott -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"
[/SOLVED]
Top
cybermonkey
Apprentice
Apprentice
User avatar
Posts: 194
Joined: Mon Aug 11, 2003 10:54 am

  • Quote

Post by cybermonkey » Wed Oct 04, 2006 11:19 am

golding wrote:I have bought an AMD Athlon64-3800+ 939 and re-used my existing install, AMD Athlon XP 2500+ Barton, and everything is running fast and really sweet.

What I would like to do, as I don't want to use a chrooted env for the odd 32bit app, is run my AMD64 in a 32bit enhanced environment.

I would like to know, providing any body knows of course, if I left my CHOST ("i686-pc-linux-gnu") as is and ONLY changed my CFLAGS to reflect the CPU, will this run 32bit compile or will the 64 bit CFLAGS automatically produce a 64bit compiled system?

Current config:

Code: Select all

CFLAGS="-march=athlon-xp -mtune=athlon-xp -O2 -mmmx -m3dnow -msse -pipe -fomit-frame-pointer -momit-leaf-frame-pointer -fno-ident"
CHOST="i686-pc-linux-gnu"
Proposed config:

Code: Select all

CFLAGS="-march=athlon64 -mtune=athlon64 -O3 -mmmx -mmmxext -m3dnow -m3dnowext -msse -msse2 -pipe -fomit-frame-pointer -momit-leaf-frame-pointer -fno-ident"
CHOST="i686-pc-linux-gnu"
Also from the gentoo-wiki:

Code: Select all

Athlon 64 X2 (AMD) 
vendor_id: AuthenticAMD
cpu family: 15
model: 43
stepping: 1 or 2
model name: AMD Athlon(tm) X2 Dual Core Processor



32 bit 

CHOST="i686-pc-linux-gnu"
CFLAGS="-march=athlon64 -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"
64 bit 

CHOST="x86_64-pc-linux-gnu"
CFLAGS="-march=athlon64 -O2 -pipe"
CXXFLAGS="${CFLAGS}"
If you have a newer Athlon64("Venice" or "San Diego")/Athlon64-X2("Manchester" or "Toledo") (check for pni in cat /proc/cpuinfo) you can also add -msse3 to your CFLAGS to enable SSE3 support. Any chip using the 90nm process except for the "Winchester" class Athlon64 supports SSE3. 

Also bear in mind that all Athlon64 X2 and Opteron 165, 170, 175, 180, and 185 processors are dual-core CPUs so make sure that you use MAKEOPTS="-j3" in your make.conf. This doesn't affect the code but might reduce compile times. 
Top
golding
Apprentice
Apprentice
User avatar
Posts: 232
Joined: Tue Jun 07, 2005 12:20 am
Location: Adelaide / South Australia

  • Quote

Post by golding » Wed Oct 04, 2006 12:39 pm

Thankyou cybermonkey, I must be going blind in my dotage, didn't even see that when I checked the wiki :-)
Regards, Robert

..... Some people can tell what time it is by looking at the sun, but I have never been able to make out the numbers.
Top
ConiKost
Developer
Developer
User avatar
Posts: 1371
Joined: Tue Jan 11, 2005 5:24 pm

  • Quote

Post by ConiKost » Sun Nov 05, 2006 7:28 pm

Could I use -mfpmath=sse on a AMD Athlon 64 X2 4600+ ?

Or not a good idea?
Top
golding
Apprentice
Apprentice
User avatar
Posts: 232
Joined: Tue Jun 07, 2005 12:20 am
Location: Adelaide / South Australia

  • Quote

Post by golding » Mon Nov 06, 2006 1:40 am

ConiKost wrote:Could I use -mfpmath=sse on a AMD Athlon 64 X2 4600+ ?

Or not a good idea?
My understanding is that it doesn't really improve anything as it is assumed by the compiler from the -march=athlon64 flag.
But it can, sometimes, break compilation on a couple of apps, like OpenOffice.org from source (not the bin) & mozilla for example.

BTW, don't forget to change MAKEOPTS (in make.conf) to "-j3" for the extra, internal, cpu, i.e.

Code: Select all

MAKEOPTS="-j3"
Regards, Robert

..... Some people can tell what time it is by looking at the sun, but I have never been able to make out the numbers.
Top
baigsabeeh
Guru
Guru
User avatar
Posts: 520
Joined: Wed Sep 28, 2005 7:51 pm
Location: North Brunswick, NJ

  • Quote

Post by baigsabeeh » Wed Nov 08, 2006 9:49 pm

Is -O3 safe and what are the benefits of it? The wiki makes it a little too vague.
BSD > SysV > Linux
BSD FTW!
Top
baigsabeeh
Guru
Guru
User avatar
Posts: 520
Joined: Wed Sep 28, 2005 7:51 pm
Location: North Brunswick, NJ

  • Quote

Post by baigsabeeh » Thu Nov 09, 2006 3:39 pm

What is -fPIC for and how is it dangerous? I'm using it right now to complement the hashstyles and I've compiled half of my system without a hitch. Whereas when I didn't have it, it would stop after every 10 or 15 packages.
BSD > SysV > Linux
BSD FTW!
Top
-JeaN-
Apprentice
Apprentice
User avatar
Posts: 211
Joined: Mon Nov 25, 2002 1:09 pm
Location: PaRiS :D

  • Quote

Post by -JeaN- » Wed Nov 29, 2006 9:28 am

baigsabeeh wrote:Is -O3 safe and what are the benefits of it? The wiki makes it a little too vague.
It seems -O3 makes bigger binaries, and implies a very little performance gain ( 2% or 3% ).
Therefore, if you really want to have that little extra, do it, but be aware that the bigger binaries is only suitable if your CPU cache and installed RAM is big enough, and even further more it takes lot more compile time.

I have an Intel Core 2 Duo T7200 on my laptop, with 2GB of RAM, and still I didn't find it important enough over -O2.

Here are my parameters on my make.conf :

Code: Select all

CHOST="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -march=nocona -fomit-frame-pointer -fno-ident"
CXXFLAGS="${CFLAGS}"
MAKEOPTS="-j3"
And I'm very happy with it, I think it's very stable and compiles fast.

Btw, the -f-inline-hidden-visibles ( don't know the exact syntax ) was breaking my compiles, specially for Koffice. Since I removed it, everything went smooth, so I suggest you remove it too.

And the -momit-leaf-frame-pointer shouldn't be used with -fomit-frame-pointer.

Good luck and have fun :)
Top
-JeaN-
Apprentice
Apprentice
User avatar
Posts: 211
Joined: Mon Nov 25, 2002 1:09 pm
Location: PaRiS :D

  • Quote

Post by -JeaN- » Wed Nov 29, 2006 9:32 am

baigsabeeh wrote:What is -fPIC for and how is it dangerous? I'm using it right now to complement the hashstyles and I've compiled half of my system without a hitch. Whereas when I didn't have it, it would stop after every 10 or 15 packages.
From the "man gcc" :
-fpic
If supported for the target machines, generate position-independent code, suitable for use in a shared library.
-fPIC
If supported for the target machine, emit position-independent code, suitable for dynamic linking, even if branches need large displacements.
So basically, it's important in some cases, but overall you can get happily rid of it, since I suppose most ebuilds which will need it will commit this flag when needed.

I suggest you take it out of your CFLAGS and only include it on package base, if needed. I don't think it improves any of the performance.

Cheers :)
Top
VeliuX
n00b
n00b
User avatar
Posts: 17
Joined: Tue Oct 04, 2005 11:31 am
Location: Washington/Illinois/USA

  • Quote

Post by VeliuX » Fri Dec 01, 2006 6:29 am

Hello, i own an athlon64 3800+ x2, on an a8n32-sli delux mobo, i was wondering if there were any dual core amd64 cflags other than "O2 -march=athlon64 -pipe" That i could possibly use? I mean flags that would increase some speed but not hurt stability in a major way?
I set "Makeopts="-j3"" cause i have a dual core proc. Also when i put -march=athlon64.....now will theses flags that are included in the athlon64 part be beneficial to the athlon64 dual cores or x2s, or is there another -march setting i could set? Thanks
-Baer
Top
#2
n00b
n00b
Posts: 11
Joined: Fri Jun 04, 2004 7:42 am

Optimising a Sabayon 3.2 instalation on Athlon XP, GCC 4.1.1

  • Quote

Post by #2 » Sat Dec 02, 2006 8:06 pm

This is what I have so far.

Code: Select all

CFLAGS="-O2 -march=athlon-xp -mno-tls-direct-seg-refs -m32 -pipe -fomit-frame-pointer -momit-leaf-frame-pointer" 

USE="... sse 3dnow" 

LDFLAGS="-Wl,-O1 -Wl,--enable-new-dtags -Wl,--sort-common -s" 

LINGUAS="en_GB"
Should I add:
-fforce-addr
-falign-functions=16 -fno-align-jumps -fno-align-labels -falign-loops=4
-fprefetch-loop-arrays

Also I have read. http://gcc.gnu.org/gcc-4.0/changes.html#visibility and http://gcc.gnu.org/wiki/Visibility I'm not sure how to implement this.
I this correct? CXXFLAGS="${CFLAGS} -fvisibility=hidden -fvisibility-inlines-hidden"

My CHOST is i586. :/ I know it's a same about that with Sabayon.

Thanks in advance.
Top
Arfrever
Bodhisattva
Bodhisattva
Posts: 2463
Joined: Sat Apr 29, 2006 5:27 pm
Location: 異世界

Re: Optimising a Sabayon 3.2 instalation on Athlon XP, GCC 4

  • Quote

Post by Arfrever » Sat Dec 02, 2006 9:20 pm

#2 wrote:

Code: Select all

CFLAGS="(...) -fomit-frame-pointer -momit-leaf-frame-pointer"
"-fomit-frame-pointer" includes all actions caused by "-momit-leaf-frame-pointer", so remove "-momit-leaf-frame-pointer".
#2 wrote:

Code: Select all

LDFLAGS="(...) -Wl,--enable-new-dtags (...)"
"--enable-new-dtags" is default in Gentoo, so remove it.
#2 wrote:-fforce-addr
"spidermonkey" will fail to build.
#2 wrote:-fprefetch-loop-arrays
Yes.
#2 wrote:Also I have read. http://gcc.gnu.org/gcc-4.0/changes.html#visibility and http://gcc.gnu.org/wiki/Visibility I'm not sure how to implement this.
I this correct? CXXFLAGS="${CFLAGS} -fvisibility=hidden -fvisibility-inlines-hidden"
Yes, but use only "-fvisibility-inlines-hidden". Some packages will fail to build even with alone "-fvisibility-inlines-hidden" (Maybe KOffice?).

Sveikinu
Arfrever
Top
#2
n00b
n00b
Posts: 11
Joined: Fri Jun 04, 2004 7:42 am

  • Quote

Post by #2 » Sat Dec 02, 2006 10:05 pm

Ačiū Arfrever. :)

What do you think of the -falign-functions=16 -fno-align-jumps -fno-align-labels -falign-loops=4 for the Athlon XP?

Any thing else you would add?
Top
Zvezda
n00b
n00b
User avatar
Posts: 28
Joined: Wed Nov 26, 2003 5:44 am
Location: Tulsa NERV Center
Contact:
Contact Zvezda
Website

  • Quote

Post by Zvezda » Wed Dec 06, 2006 6:56 pm

Here's a semi C-flag related question:

What is a good (common) program that uses lots and lots of floating point instructions to test the benefits/disadvantages of -mfpmath=sse vs 387 on?

[edit]

This is an Athlon-xp system compiled only with -march=athlon-xp -O2 -fomit-frame-pointer -pipe
Everything I am about to tell you is wrong...
Top
mv
Watchman
Watchman
User avatar
Posts: 6795
Joined: Wed Apr 20, 2005 12:12 pm

  • Quote

Post by mv » Wed Dec 06, 2006 10:38 pm

-JeaN- wrote:[...] -fPIC [...]
So basically, it's important in some cases, but overall you can get happily rid of it, since I suppose most ebuilds which will need it will commit this flag when needed.

I suggest you take it out of your CFLAGS and only include it on package base, if needed. I don't think it improves any of the performance.
I have very bad experience not using it in many cases: Many packages will then not be able to link with -Wl,-z,now, because some libraries were compiled without this flag (i.e. my experience is that a huge amount of ebuilds is buggy w.r.t. -fPIC). What is worse is that linking without -Wl,-z,now might even be a security issue. So I would suggest to use these flags whenever possible and only omit them if something breaks (despite the annoying warnings of portage). It does probably not improve the performance (on x86 actually quite the opposite, on amd64 it might improve the performance slightly), but it improves the security.
Top
Post Reply

408 posts
  • Page 12 of 17
    • Jump to page:
  • Previous
  • 1
  • …
  • 10
  • 11
  • 12
  • 13
  • 14
  • …
  • 17
  • Next

Return to “Portage & Programming”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy