Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
altivec under gcc-3.4.4-r1[SOLVED]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo on PPC
View previous topic :: View next topic  
Author Message
iMike
Apprentice
Apprentice


Joined: 01 Apr 2005
Posts: 217
Location: Stockholm, Sweden

PostPosted: Fri Dec 23, 2005 6:45 pm    Post subject: altivec under gcc-3.4.4-r1[SOLVED] Reply with quote

I'm new to using Gentoo under PPC and have a simple optimization question. I'm running a newly installed Gentoo on a G4 (7400, 400MHz, PowerMac3,3 AGP Graphics) Mac. I installed recently enough that everything is under gcc-3.4.4-r1. When I installed, I chose the G4 profile, i.e., currently:

Code:

ls -FGg /etc/make.profile
lrwxrwxrwx  1 53 Dec 11 18:28 /etc/make.profile -> /usr/portage/profiles/default-linux/ppc/2005.1/ppc/G4/

If you look at "make.default" under that profile, you see some nice optimization:
Code:

cat /usr/portage/profiles/default-linux/ppc/2005.1/ppc/G4/make.defaults
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/profiles/default-linux/ppc/2005.1/ppc/G4/make.defaults,v 1.2 2005/07/25 14:47:26 dostrow Exp $

CFLAGS="-O2 -mtune=G4 -mcpu=G4 -mabi=altivec -pipe"
CXXFLAGS="${CFLAGS}"

STAGE1_USE="altivec unicode"

However, when I emerge stuff, I notice no altivec, etc and a quick check of emerge --info give:
Code:

 emerge --info
Portage 2.0.51.22-r3 (default-linux/ppc/2005.1/ppc/G4, gcc-3.4.4, glibc-2.3.5-r2                                                           
, 2.6.14-gentoo-r2 ppc)
=================================================================
System uname: 2.6.14-gentoo-r2 ppc 7400, altivec supported
Gentoo Base System version 1.6.13
dev-lang/python:     2.3.5, 2.4.2
sys-apps/sandbox:    1.2.12
sys-devel/autoconf:  2.13, 2.59-r6
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r1
sys-devel/binutils:  2.16.1
sys-devel/libtool:   1.5.20
virtual/os-headers:  2.6.11-r2
ACCEPT_KEYWORDS="ppc"
AUTOCLEAN="yes"
CBUILD="powerpc-unknown-linux-gnu"
CFLAGS="-O2 -mtune=powerpc -pipe -fomit-frame-pointer"
CHOST="powerpc-unknown-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config /usr/lib/X1                                                           
1/xkb /usr/share/config /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-O2 -mtune=powerpc -pipe -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig distlocks sandbox sfperms strict"
GENTOO_MIRRORS="http://ftp.rhnet.is/pub/gentoo/ http://mirror.gentoo.no/ http://                                                           
ftp.du.se/pub/os/gentoo http://ds.thn.htu.se/linux/gentoo http://mirror.pudas.ne                                                           
t/gentoo"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="ppc X alsa berkdb bitmap-fonts bzip2 crypt cups eds emboss exif expat fam f                                                           
ortran gdbm gif glut gnome gpm gstreamer gtk gtk2 ipv6 jpeg kde lcms libwww mng                                                           
motif mp3 mpeg ncurses nls ogg oggvorbis opengl pam pdflib perl png python qt re                                                           
adline spell ssl tcltk tcpd tiff truetype truetype-fonts type1-fonts udev unicod                                                           
e vorbis xml2 xv zlib userland_GNU kernel_linux elibc_glibc"
Unset:  ASFLAGS, CTARGET, LANG, LC_ALL, LDFLAGS, LINGUAS, PORTDIR_OVERLAY

Are the following lines in my /etc/make.conf essentially overriding the nice default optimizations?
Code:

CFLAGS="-O2 -mtune=powerpc -pipe -fomit-frame-pointer"
CHOST="powerpc-unknown-linux-gnu"
CXXFLAGS="${CFLAGS}"

Or is there some deeper scheme going on here? My understanding of the handbook is that stuff in make.conf overrides the make.profile stuff. Bun in that case, shouldn't altivec still show up during compiles? An emerge -pv gcc shows that gcc itself is built without altivec (-altivec). Is that info some how being used to eliminate using altivec when compiling other apps (as I guess it should be)?

If my make.conf is the problem and I remove all CFLAGS/CXXFLAGS to get the default, then do I basicaly need to rebuild my system in a similar way to the recent gcc upgrade (i.e., emerge -e system, emerge -e world)?

My system has been nice and stable since the beginning and I'm not looking to go overboad on optimization. Just want "reasonably fast" :D

Thanks


Last edited by iMike on Wed Jan 04, 2006 9:18 am; edited 1 time in total
Back to top
View user's profile Send private message
davidgurvich
Veteran
Veteran


Joined: 23 Apr 2004
Posts: 1063

PostPosted: Sat Dec 24, 2005 2:33 am    Post subject: Reply with quote

I don't know it it's still the case but alltivec was disabled in 3.4
You could try adding the altivec USE flag to make.conf. Also there is
another altivec option for CFLAGS, but I am currently not at my computer.
Back to top
View user's profile Send private message
corsair
Retired Dev
Retired Dev


Joined: 06 Oct 2003
Posts: 451
Location: Aachen, Germany

PostPosted: Sat Dec 24, 2005 10:23 am    Post subject: Reply with quote

yes, your make.conf is overwriting CFLAGS from profile. you could copy over the correct lines from your profile to /etc/make.conf.

EDIT: sure, you have to recompile your software to let the changes take effect.
Back to top
View user's profile Send private message
iMike
Apprentice
Apprentice


Joined: 01 Apr 2005
Posts: 217
Location: Stockholm, Sweden

PostPosted: Mon Dec 26, 2005 10:42 pm    Post subject: Reply with quote

Quote:
I don't know it it's still the case but alltivec was disabled in 3.4


I couldn't find any reference to this anywhere. Can you give me a pointer?

By the way, I am giving altivec a go now. I have already rebuilt the system with it (emerge -e system) and am working on emerge -e world. However, I have run into my first problem: an internal compiler error trying to build glext in x11-base/xorg-x11-6.8.2-r4. Perhaps not a good sign????

(I realize that rebuilding the system and world just because of adding +altivec and building altivec into gcc-3.4.4 is probably overkill. From what I could see, only one application I had installed was even flagged for altivec, namely gimp. However, I also updated my CFLAGS to "-mtune=7400 -mcpu=7400 etc" from the previous "G4" so I thought a rebuild was in order. A waste?)
Back to top
View user's profile Send private message
iMike
Apprentice
Apprentice


Joined: 01 Apr 2005
Posts: 217
Location: Stockholm, Sweden

PostPosted: Wed Jan 04, 2006 9:16 am    Post subject: Reply with quote

Just to follow up with my experience so far, after a few days running I'm having no problems with altivec (and the other options I mentioned above). Everything rebuilt fine using Gentoo's GCC upgrade document as a guide.

Will have to wait until GCC 4 to get some real effect from altivec, but perhaps it was good to get started already with 3.4.4.
Back to top
View user's profile Send private message
NewBlackDak
Guru
Guru


Joined: 02 Nov 2003
Posts: 512
Location: Utah County, UT

PostPosted: Thu Jan 05, 2006 6:46 pm    Post subject: Reply with quote

You would need -maltivec in your CFLAGS, and altivec in your use flags for good measure.

Altivec gives a good boost to gimp, mplayer, ffmpeg, and xine. Some say gcc gets a good boost when compile with altivec, but I haven't seen a major difference either way.
_________________
Gentoo systems.
X2 4200+@2.6 - Athy
X2 3600+ - Myth
UltraSparc5 440 - sparcy
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on PPC All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum