Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
USE flag problem
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
paraw
Apprentice
Apprentice


Joined: 07 Jan 2005
Posts: 158
Location: Coventry (UK)

PostPosted: Sun Oct 16, 2005 7:31 pm    Post subject: USE flag problem Reply with quote

Hi. I need some help about a strange thing I found. In my make.conf (or in package.use) I set up some use flags. The issue is that while some of the flags are actually used, some others seem to be completely ignored. For example, I put the sse flag in make.conf, but if I run equery or usetool and check I find that no installed package uses that flag. Moreover, if I do emerge --pretend --update --deep --newuse world, no package is needed to be recompiled, just like if everything was compiled with the right flags. How is it possible? I'm talking, of course, about packages that support those flags (e. g. transcode for the sse flag). By the way, this is the emerge --info output, whence you can see that actually sse and the other flags that give problems are not active. Moreover there are some flags I did NOT set neither in make.conf nor in package.use. I really don't understand how this comes.
Code:

Portage 2.0.51.22-r3 (default-linux/amd64/2005.0, gcc-3.4.4, glibc-2.3.5-r2, 2.6.13-gentoo-r3 x86_64)
=================================================================
System uname: 2.6.13-gentoo-r3 x86_64 AMD Athlon(tm) 64 Processor 3400+
Gentoo Base System version 1.6.13
ccache version 2.3 [enabled]
dev-lang/python:     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.15.92.0.2-r10
sys-devel/libtool:   1.5.20
virtual/os-headers:  2.6.11-r2
ACCEPT_KEYWORDS="amd64"
AUTOCLEAN="yes"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=athlon64 -mfpmath=sse -mmmx -msse -msse2 -m3dnow -mno-push-args -maccumulate-outgoing-args -minline-all-stringops -O3 -pipe
-fforce-addr -finline-limit=10000 -ftracer -fprefetch-loop-arrays -fbranch-target-load-optimize"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.4/env /usr/kde/3.4/share/config /usr/kde/3.4/shutdown /usr/kde/3/share/config
/usr/lib/X11/xkb /usr/share/config /usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/
/usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/ /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/splash /etc/terminfo /etc/env.d"
CXXFLAGS="-march=athlon64 -mfpmath=sse -mmmx -msse -msse2 -m3dnow -mno-push-args -maccumulate-outgoing-args -minline-all-stringops -O3 -pipe
-fforce-addr -finline-limit=10000 -ftracer -fprefetch-loop-arrays -fbranch-target-load-optimize"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig candy ccache distlocks sandbox sfperms strict"
GENTOO_MIRRORS="http://adelie.polymtl.ca/ http://gentoo.cs.lewisu.edu/gentoo/ ftp://linux.cs.lewisu.edu/gentoo/"
LANG="it.utf8"
LC_ALL="it.utf8"
LINGUAS="it"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.us.gentoo.org/gentoo-portage"
USE="amd64 X a52 aac alsa arts audiofile avi bash-completion berkdb bitmap-fonts cdr cjk crypt cups curl dga directfb dv dvd dvdr dvdread eds
encode esd exif fam fbcon ffmpeg flac foomaticdb fortran ggi gif gpm gstreamer gtk gtk2 hal ieee1394 imagemagick imlib ipv6 java javascript jpeg
kde kerberos krb4 lcms libwww lzw lzw-tiff mad mikmod mng motif mp3 mpeg mpi nas ncurses nls nptl ogg oggvorbis opengl oss pam pcmcia pdflib perl
png ppds python qt quicktime readline samba sdl slang sndfile socks5 speex spell ssl svg tcltk tcpd tetex theora threads tiff truetype
truetype-fonts type1-fonts unicode usb userlocales vcd vorbis wmf xine xml xml2 xmms xpm xprint xv xvid zlib linguas_it userland_GNU kernel_linux
elibc_glibc"
Unset:  ASFLAGS, CTARGET, LDFLAGS, PORTDIR_OVERLAY


This is my cpuinfo
Code:
processor       : 0
vendor_id       : AuthenticAMD
cpu family      : 15
model           : 4
model name      : AMD Athlon(tm) 64 Processor 3400+
stepping        : 10
cpu MHz         : 1801.061
cache size      : 1024 KB
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 clflush mmx fxsr sse sse2 syscall nx mmxext lm 3dnowext
3dnow
bogomips        : 3606.58
TLB size        : 1024 4K pages
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management: ts fid vid ttp


These are the use flags in make.conf
Code:
USE="3dnow a52 aac audiofile cjk dga divx4linux dv dvd dvdr dvdread exif fbcon ffmpeg hal ieee1394 java javascript kerberos krb4 lcms mmx mng mpi
multilib nptl oggvorbis oss pcmcia ppds slp sndfile socks5 sse svg svga theora threads truetype unicode vcd wmf xml xprint xvid -aalib
-accessibility -acl -afs -altivec -apm -emboss -gnome"


Pls... HELP!
Back to top
View user's profile Send private message
saturas
Tux's lil' helper
Tux's lil' helper


Joined: 06 Dec 2004
Posts: 104
Location: romania

PostPosted: Sun Oct 16, 2005 8:37 pm    Post subject: Reply with quote

the packages have their default (implicit) useflags to see these, use command emerge -vp <package_name>.

the result of this last command is a reunion of the useflags from /etc/make.file, /etc/portage/package.use and the implicit useflags.

maybe your packages that you want to copmpile with a specific useflag have been compiled already with that flag.
_________________
"I can't go on. I'll go on."
S.B
Back to top
View user's profile Send private message
chunderbunny
Veteran
Veteran


Joined: 31 May 2004
Posts: 1281
Location: 51°24'27" N, 0°57'15" W

PostPosted: Sun Oct 16, 2005 8:46 pm    Post subject: Reply with quote

In your make.conf are all the flags listed on the same line? Perhaps you should split the lines up a little, just to make sure
Code:
USE="3dnow a52 aac audiofile cjk dga divx4linux dv dvd dvdr dvdread\
exif fbcon ffmpeg hal ieee1394 java javascript kerberos krb4 lcms mmx\
mng mpi multilib nptl oggvorbis oss pcmcia ppds slp sndfile socks5\
sse svg svga theora threads truetype unicode vcd wmf xml xprint xvid -aalib\
-accessibility -acl -afs -altivec -apm -emboss -gnome"

The "\" is used to specify a continuation of a line, without portage won't see the USE flags you have specified.
Back to top
View user's profile Send private message
paraw
Apprentice
Apprentice


Joined: 07 Jan 2005
Posts: 158
Location: Coventry (UK)

PostPosted: Sun Oct 16, 2005 9:14 pm    Post subject: Reply with quote

OK... probably I've not been clear enough... look at this
Code:
NBparaw ~ # equery u transcode
[ Searching for packages matching transcode... ]
[ Colour Code : set unset ]
[ Legend    : Left column  (U) - USE flags from make.conf              ]
[           : Right column (I) - USE flags packages was installed with ]
[ Found these USE variables for media-video/transcode-0.6.14-r2 ]
 U I
 + + X           : Adds support for X11
 - - 3dnow       : Adds support for 3dnow multimedia processor instructions
 + + a52         : Enables support for decoding ATSC A/52 streams used in DVD
 + + avi         : Adds avifile (Library for avi) support
 - - altivec     : Adds support for optimizations for G4 and G5/ppc970 processors
 - - divx4linux  : Adds support for divx.com's DivX(tm) mpeg4 libary
 + + dv          : Enables support for a codec used by many camcorders
 + + dvdread     : Enables usage of Ogle's libdvdread for DVD playback
 + + encode      : Adds support for encoding of audio or video files
 + + fame        : Enables libfame support
 + + truetype    : Adds support for FreeType and/or FreeType2 fonts
 + + gtk         : Adds support for x11-libs/gtk+ (The GIMP Toolkit)
 - + imagemagick : Enables support for Imagemagick (image converter)
 + + jpeg        : Adds JPEG image support
 + + lzo         : Enables LZO compression support
 + + mjpeg       : Enables mjpegtools support
 + + mpeg        : Adds libmpeg3 support to various packages.
 - - mmx         : Adds support for optimizations for Pentium MMX and Athlon class processors
 - - network     : Enables network streaming support
 + + ogg         : Adds support for the Ogg container format (commonly used by Vorbis, Theora and flac)
 + + vorbis      : Adds support for the OggVorbis audio codec
 - - pvm         : Enables private virtual machine support
 + + quicktime   : Adds support for OpenQuickTime
 + + sdl         : Adds support for Simple Direct Layer (media library)
 - - sse         : fast floating point optimization for PentiumIII+ class chips
 - - sse2        : Enables sse2 support
 + + theora      : Adds support for the Theora Video Compression Codec
 - - v4l         : Enables video4linux support
 + + xvid        : Adds support for xvid.org's open-source mpeg-4 codec
 - + xml2        : Check/Support flag for XML library (version 2)
 - - debug       : Tells configure and the makefiles to build for debugging. Effects vary across packages, but generally it will at least add -g to CFLAGS.

As you can see, sse and sse2, but also mmx have not been used to compile this package. If you look in my previous post I have mmx, sse and sse2 in my make.conf. Moreover, if I try to emerge --update --deep --newuse transcode, it says it doesn't need to be recompiled. But again, if you look in my previous post you see that mmx, sse and sse2 are not active in the output of emerge --info. By the way the USE line in make.conf IS spit in many lines. Moreover, as you can see from http://www.gentoo-portage.com/media-video/transcode this package HAS mmx, sse and sse2 as use flags. I think the problem is that the system doesn't recognize correctly the flags in the make.conf, because only some of those are present in the emerge --info output, where, by the way, there are also other flags I didn't set. Any ideas?
Back to top
View user's profile Send private message
surfmasta
n00b
n00b


Joined: 23 Jul 2005
Posts: 36

PostPosted: Sun Oct 16, 2005 9:44 pm    Post subject: Reply with quote

what will say:
USE="sse sse2 mmx" emerge -vp transcode

And like chunderbunny means don't forget the backslashes, cos we cant see them in your first posting. I only can see the lines in your USE separated by enter-strokes.
Back to top
View user's profile Send private message
Genone
Retired Dev
Retired Dev


Joined: 14 Mar 2003
Posts: 9521
Location: beyond the rim

PostPosted: Sun Oct 16, 2005 10:55 pm    Post subject: Reply with quote

Those flags are masked on amd64 (as they involve 32 Bit assembly code not working there).
Back to top
View user's profile Send private message
paraw
Apprentice
Apprentice


Joined: 07 Jan 2005
Posts: 158
Location: Coventry (UK)

PostPosted: Sun Oct 16, 2005 11:22 pm    Post subject: Reply with quote

Oh...
So... there IS a reason... :D
Thanks, didn't know that!
By the way, does that mean that I cannot use those optimizations on my laptop? Is there a way to make them work on AMD64?
Thx again. :)
Back to top
View user's profile Send private message
Genone
Retired Dev
Retired Dev


Joined: 14 Mar 2003
Posts: 9521
Location: beyond the rim

PostPosted: Mon Oct 17, 2005 1:40 am    Post subject: Reply with quote

paraw wrote:
By the way, does that mean that I cannot use those optimizations on my laptop? Is there a way to make them work on AMD64?

Well, gcc will generate code for sse/mmx/3dnow/... (that's not affected by use flags), but any patches involving hand optimized 32 bit assembly cannot be used in a 64 bit program.
Back to top
View user's profile Send private message
Genone
Retired Dev
Retired Dev


Joined: 14 Mar 2003
Posts: 9521
Location: beyond the rim

PostPosted: Mon Oct 17, 2005 1:42 am    Post subject: Reply with quote

paraw wrote:
By the way, does that mean that I cannot use those optimizations on my laptop? Is there a way to make them work on AMD64?

Well, gcc will generate code for sse/mmx/3dnow/... (that's not affected by use flags), but any hand optimized 32 bit assembly code cannot be used in a 64 bit program.
Back to top
View user's profile Send private message
squeegee
n00b
n00b


Joined: 04 Nov 2005
Posts: 10

PostPosted: Sat Nov 05, 2005 5:40 pm    Post subject: Reply with quote

Well,

USE="X 3dnow avi dv dvdread encode truetype gtk imagemagick jpeg lzo mjpeg mpeg mmx ogg vorbis quicktime sdl sse sse2 sse3 xvid xml2" emerge -vp transcode

on my box (an X2 3800+) gives

[ebuild R ] media-video/transcode-0.6.14-r2 (-3dnow) +X -a52 (-altivec) +avi -dv +dvdread +encode -fame +gtk +imagemagick +jpeg +lzo* +mjpeg* (-mmx) +mpeg -network +ogg (-pvm) +quicktime +sdl (-sse) (-sse2) -theora +truetype -v4l +vorbis +xml2 +xvid 0 kB


transcode takes more than twice as long to encode a file on this box as it does on another box I have with a 3GHz P4

[EDIT] I found out where these flags are masked - in a parent profile of the profile I'm using, specifically for me in

/usr/portage/profiles/default-linux/use.mask

the relevant portion from this file:

# x86/amd64 only:
mmx
mmx2
sse
sse2
3dnow
3dnowext

the problem is that these use flags are not unmasked in the amd64-specific use.mask files.
Back to top
View user's profile Send private message
d0wn_under
Guru
Guru


Joined: 13 Mar 2003
Posts: 300
Location: Sheffield, England

PostPosted: Wed Nov 16, 2005 9:04 pm    Post subject: Reply with quote

Quote:

/usr/portage/profiles/default-linux/use.mask

the relevant portion from this file:

# x86/amd64 only:
mmx
mmx2
sse
sse2
3dnow
3dnowext

the problem is that these use flags are not unmasked in the amd64-specific use.mask files.


Are you implying that they should be or that there is a way to get these flags enabled?
_________________
This sig left intentionally blank.
Back to top
View user's profile Send private message
kallamej
Administrator
Administrator


Joined: 27 Jun 2003
Posts: 4975
Location: Gothenburg, Sweden

PostPosted: Thu Nov 17, 2005 11:47 am    Post subject: Reply with quote

squeegee wrote:

[EDIT] I found out where these flags are masked - in a parent profile of the profile I'm using, specifically for me in

/usr/portage/profiles/default-linux/use.mask

the relevant portion from this file:

# x86/amd64 only:
mmx
mmx2
sse
sse2
3dnow
3dnowext

the problem is that these use flags are not unmasked in the amd64-specific use.mask files.

Actually, they used to be masked in the default-linux/amd64/use.mask with the comment
Code:
# 2004/06/22 - Taken from 2004.0 profile
# Too many packages assume that mmx/sse/sse2/3dnow are 86-32 only things to
# make them useful on amd64. Anyway, all amd64 cpus have them, so they should
# not be many flag dependant in this case

It was later cleaned out due to it already being masked in the parent. Packages that support it, such as Mplayer hard enables it for amd64, though.
Code:
# mplayer now contains SIMD assembler code for amd64
# AMD64 Team decided to hardenable SIMD assembler for all users

You can use /etc/portage/profile/use.mask to override the profile use.mask. If you find packages that do contain assembler for amd64 and would benefit from the functionality, please file bugs accordingly. Please see also Testing 3dnow, sse, etc...
_________________
Please read our FAQ Forum, it answers many of your questions.
irc: #gentoo-forums on irc.libera.chat
Back to top
View user's profile Send private message
d0wn_under
Guru
Guru


Joined: 13 Mar 2003
Posts: 300
Location: Sheffield, England

PostPosted: Thu Nov 17, 2005 12:01 pm    Post subject: Reply with quote

Do you mean that some packages which can use these flags are using them by default and ignoring the USE flags? If so then is there anyway to tell if the package, e.g. xorg is using the flag, e.g. 3dnow?
_________________
This sig left intentionally blank.
Back to top
View user's profile Send private message
kallamej
Administrator
Administrator


Joined: 27 Jun 2003
Posts: 4975
Location: Gothenburg, Sweden

PostPosted: Thu Nov 17, 2005 12:15 pm    Post subject: Reply with quote

d0wn_under wrote:
Do you mean that some packages which can use these flags are using them by default and ignoring the USE flags? If so then is there anyway to tell if the package, e.g. xorg is using the flag, e.g. 3dnow?

On amd64, yes, or rather, they enable it based on the amd64 profile-enabled USE-flag. You can look in the ebuild to see what is done. Xorg-x11 has the following.
Code:
                if use x86; then
                        # optimize Mesa for architecture
                        use_build mmx HasMMXSupport
                        use_build 3dnow Has3DNowSupport
                        use_build sse HasSSESupport
                fi

                # optimize Mesa for architecture
                if use amd64; then
                        use_build amd64 HasMMXSupport
                        use_build amd64 Has3DNowSupport
                        use_build amd64 HasSSESupport
                fi

Thus, on x86 it checks for the 3dnow USE-flag, whilst on amd64 it is hard enabled.
_________________
Please read our FAQ Forum, it answers many of your questions.
irc: #gentoo-forums on irc.libera.chat
Back to top
View user's profile Send private message
d0wn_under
Guru
Guru


Joined: 13 Mar 2003
Posts: 300
Location: Sheffield, England

PostPosted: Thu Nov 17, 2005 12:37 pm    Post subject: Reply with quote

That makes sense.

Is there any easy way to find which packages have the values hardcoded so that when you do an emerge -pv xorg and it shows that it will ignore the 3dnow flags that it could say that even though it is ignoring the USE flag it is actually hardcoding the values in.
_________________
This sig left intentionally blank.
Back to top
View user's profile Send private message
kallamej
Administrator
Administrator


Joined: 27 Jun 2003
Posts: 4975
Location: Gothenburg, Sweden

PostPosted: Thu Nov 17, 2005 12:56 pm    Post subject: Reply with quote

Other than looking in the ebuild, not that I know of.
_________________
Please read our FAQ Forum, it answers many of your questions.
irc: #gentoo-forums on irc.libera.chat
Back to top
View user's profile Send private message
d0wn_under
Guru
Guru


Joined: 13 Mar 2003
Posts: 300
Location: Sheffield, England

PostPosted: Thu Nov 17, 2005 1:06 pm    Post subject: Reply with quote

Oh well, if I see a flag being ignored that I would expect to be used I'll check the ebuild.

If I find any, such as xorg, is it worth reporting the fact to anywhere/anybody?
_________________
This sig left intentionally blank.
Back to top
View user's profile Send private message
kallamej
Administrator
Administrator


Joined: 27 Jun 2003
Posts: 4975
Location: Gothenburg, Sweden

PostPosted: Fri Nov 18, 2005 9:11 pm    Post subject: Reply with quote

Not sure exactly what your question is. If you mean compiling a list of ebuilds that hard enable SIMD assembler for amd64 there may perhaps be users interested in that. Chances are that the amd64 team already has such a list, though. If you mean packages that support it, but the ebuild doesn't, then please file a bug on our bugzilla.
_________________
Please read our FAQ Forum, it answers many of your questions.
irc: #gentoo-forums on irc.libera.chat
Back to top
View user's profile Send private message
d0wn_under
Guru
Guru


Joined: 13 Mar 2003
Posts: 300
Location: Sheffield, England

PostPosted: Mon Nov 21, 2005 12:16 pm    Post subject: Reply with quote

What I meant was finding a list of apps where the emerge -pv shows USE flags being ignored but the ebuild being hardcoded to use it anyway as in the example of 3dnow and xorg.
_________________
This sig left intentionally blank.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming 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