Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
USE option questions
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
wilburpan
l33t
l33t


Joined: 21 Jan 2003
Posts: 977

PostPosted: Tue Feb 11, 2003 2:15 am    Post subject: USE option questions Reply with quote

I have some questions that aren't addressed in the Gentoo Guide to USE flags:

1. I understand the attractiveness of using USE flags to optimize at the time of compilation. What are the downsides of having a USE flag off if you emerge a package that would use it? For example, one of the first packages I emerged was KDE, so my USE flags were set to "kde qt -gnome -gtk", as suggested in the Gentoo Desktop installation guide. What really is the difference between emerging KDE with gnome and gtk turned off and with gnome and gtk turned on? Faster compile time? Quicker execution speed? More compact code?

2. What would happen if I then emerged Evolution without changing my USE flags? I am pretty sure would need the gnome and gtk options turned on.

3. Is there a list of which USE flags should be turned on/off for each packages before emerging?

4. If I don't specify a USE flag setting in make.conf, does gentoo default to the setting in make.defaults, or is it automatically set to off?
Back to top
View user's profile Send private message
Sargonas
Apprentice
Apprentice


Joined: 10 Feb 2003
Posts: 213
Location: user@localhost

PostPosted: Tue Feb 11, 2003 2:41 am    Post subject: Reply with quote

While I dont know the specifics of the use variables here is the docs and list of them:


http://www.gentoo.org/doc/en/use-howto.xml
_________________
I do not consider it an insult, but rather a compliment to be called an agnostic. I do not pretend to know where many ignorant men are sure -- that is all Agnosticism means. - Clarence Darrow
Back to top
View user's profile Send private message
InvsbleChuck
n00b
n00b


Joined: 17 Jul 2002
Posts: 28
Location: Brooklyn, NY

PostPosted: Tue Feb 11, 2003 3:08 am    Post subject: Reply with quote

This is probably duped somewhere, but here is how I understand it.

1. The use flags AFAIK are only used when a package has the option to use something or not, IOW, not a requirement but a feature. For instance you emerge a program that uses graphic file formats. It supports GIF JPEG PNG and TIFF. If you don't have TIFF in you USE var, then that option is not compiled in.

So in your example it would not have any effect on KDE. But if a package in KDE used a gtk or gnome library as a feature (doubtful, but for the sake of argument) if you have it disabled in your USE variable it would still compile just without the GTK/GNOME specific features.

2. It would pick up gnome and gtk because it is a requirement and not an optional feature.

3. Since the use flags only affect optional features, the choices of which flags to keep and which to leave in are really entirely up to you.

4. The way I understand it is that whatever is in make.conf overrides what is in make.defaults. So if the package does not appear in either file it is automatically off. That is why there is the '-' setting in use so that you can turn off what is in make.defaults without editing the file directly.

Hope this helps
Back to top
View user's profile Send private message
wilburpan
l33t
l33t


Joined: 21 Jan 2003
Posts: 977

PostPosted: Tue Feb 11, 2003 4:16 am    Post subject: Reply with quote

chamiltonj wrote:
So in your example [setting flags to "kde qt -gnome -gtk" while emerging KDE] would not have any effect on KDE. But if a package in KDE used a gtk or gnome library as a feature (doubtful, but for the sake of argument) if you have it disabled in your USE variable it would still compile just without the GTK/GNOME specific features.

So why would I ever want to turn USE flags off, then? The way the USE how-to is written, it seems that to turn off unused flags is a very desirable thing to do.
Back to top
View user's profile Send private message
OddFox
Apprentice
Apprentice


Joined: 28 Nov 2002
Posts: 270
Location: Spokane, WA

PostPosted: Tue Feb 11, 2003 4:51 am    Post subject: Reply with quote

wilburpan wrote:

So why would I ever want to turn USE flags off, then? The way the USE how-to is written, it seems that to turn off unused flags is a very desirable thing to do.


Well a lot of people simply don't want some thing to be installed... period. Setting a USE flag to off makes sure it won't be installed.
_________________
Now the rainy season reminds me of Maria
The way she danced, the color of her hair
Now I'm locked inside a stall at the cantina
Eating the bananas and the cocaine off the mirror
Looking for a ticket to take me away from here
Back to top
View user's profile Send private message
David_Escott
l33t
l33t


Joined: 12 Jan 2003
Posts: 952
Location: Boston, MA

PostPosted: Tue Feb 11, 2003 4:55 am    Post subject: Reply with quote

it adds a little to bloat especially in multimedia/gui
for instance I have no interest in kde or qt or any of that my box is gtk only
but if I wanted to build some applications that have bindings/ui's for kde then they will want to build qt and kde
another example is that i dont use xmms but gstreamer has plugins for xmms so building gnome wants to build gstreamer wants to build xmms etc

basically unset a use flag if you really arent interested in what it offers thats about it
Back to top
View user's profile Send private message
wilburpan
l33t
l33t


Joined: 21 Jan 2003
Posts: 977

PostPosted: Tue Feb 11, 2003 9:08 pm    Post subject: Reply with quote

At the risk of sounding like a broken record, I haven't seen a really comprhensive answer to my questions.

I realize that some "people simply don't want some thing to be installed... period." Also that having excessive flags turned on may add to bloat.

What I guess I am asking is how much does this impact on actual performance? Given that it takes 24 hours for me to emerge KDE, I would like to know if having all possible flags turned on will hurt performance because of excessive bloat, or improve performance because of tight code in the final product. On the flip side, would turning off a flag result in suboptimal code due to the compiled program not being able to take advantage of a plugin?

This is not a trivial question, since obviously a lot of effort was put into implementing the USE flag function into Gentoo. Therefore, it would be nice to demonstrate that this function adds to performance in some way, as well as recommendations for each package. Maybe benchmarks would be useful.
Back to top
View user's profile Send private message
mrgalihad
Tux's lil' helper
Tux's lil' helper


Joined: 30 Jan 2003
Posts: 91

PostPosted: Tue Feb 11, 2003 9:24 pm    Post subject: Reply with quote

I may not be a 100% correct in this, as I am new to gentoo as well, but I don't really think anything in the USE space would either add to or take away from performance. It simply addes extensible features to the application you are trying to merge in.

Many things have little features that are designed to fit in with other applications. If you turn it on or off in your USE flags, then you simply won't have those features available to you when you use the application. If there is a feature you want, then you can add it in your USE variable. Its not more or less efficicient when the build is done, because in order to use that feature, it would have had to have been compiled against those libraries somewhere in the process anyway.

I can see an argument that removing things from the USE space could increase perforamance in given application, just bacuase there isn't as many libraries to load when the application loads, but the overhead of doing that is pretty minimal, and really shouldn't affect things much, as its pretty probable that the library its accessing has already been loaded and is in the file cache anyway (unless your system is stressed for CPU and or memory of course)
Back to top
View user's profile Send private message
InvsbleChuck
n00b
n00b


Joined: 17 Jul 2002
Posts: 28
Location: Brooklyn, NY

PostPosted: Wed Feb 12, 2003 4:22 am    Post subject: Reply with quote

Quote:
What I guess I am asking is how much does this impact on actual performance? Given that it takes 24 hours for me to emerge KDE, I would like to know if having all possible flags turned on will hurt performance because of excessive bloat, or improve performance because of tight code in the final product. On the flip side, would turning off a flag result in suboptimal code due to the compiled program not being able to take advantage of a plugin?


My guess would be that if the feature is common to a lot of applications that you use often, adding it in would increase performance because you are using a library is most likley already cached in memory.

If it's something that you don't use often, and you can do without it, leave it out for the opposite reason.

If it's a tossup between KDE and GNOME try to find the best app that will work in the environment you want natively. That way the likelihood that the lib is already in memory would be greater. If you use an app from another environment, I've found that you usually bring all it's plumbing with it. (DCOP for KDE and OAF for GNOME). Please correct me if im wrong.
Back to top
View user's profile Send private message
rac
Bodhisattva
Bodhisattva


Joined: 30 May 2002
Posts: 6553
Location: Japanifornia

PostPosted: Wed Feb 12, 2003 6:36 pm    Post subject: Reply with quote

If you're talking about something as drastic as taking X support out, it can dramatically reduce the size of binaries and also increase the free hard disk space you have for other things. When I compile XEmacs without X and Mule support, it starts about 20-30% faster.

USE variables are not just about performance. Sometimes you may like a program, but its support for something optional is buggy or incompatible with other software you have. For example, I need Japanese support in Mozilla. If I compile it with XFt support, that breaks. So I need to use the "moznoxft" USE variable to get what I want.

I am personally of the opinion "when in doubt, leave it out". This simplifies debugging. I understand that many other people prefer to toss everything unknown on, because they figure they may need it later. That's certainly another reasonable position. The great thing about Gentoo is that the distribution itself doesn't have to make tradeoffs between these two schools of thought, because it doesn't distribute binaries.
_________________
For every higher wall, there is a taller ladder
Back to top
View user's profile Send private message
mr-simon
Guru
Guru


Joined: 22 Nov 2002
Posts: 314
Location: Leamington Spa, Warks, UK

PostPosted: Thu Feb 13, 2003 12:50 am    Post subject: Reply with quote

rac wrote:
I am personally of the opinion "when in doubt, leave it out".


I agree... Although, it *can* be a pain when you suddenly decide you need something compiled into an important library halfway down the dependancy tree. I prefer "If I haven't heard of it, or I know I don't want it, leave it out" - but that dosen't rhyme.
_________________
"Pokey, are you drunk on love?"
"Yes. Also whiskey. But mostly love... and whiskey."
Adopt an unanswered post
Back to top
View user's profile Send private message
wilburpan
l33t
l33t


Joined: 21 Jan 2003
Posts: 977

PostPosted: Thu Feb 13, 2003 3:21 am    Post subject: Reply with quote

rac wrote:
I am personally of the opinion "when in doubt, leave it out". This simplifies debugging. I understand that many other people prefer to toss everything unknown on, because they figure they may need it later. That's certainly another reasonable position. The great thing about Gentoo is that the distribution itself doesn't have to make tradeoffs between these two schools of thought, because it doesn't distribute binaries.

I see. Thanks for the explanation.

So how does one figure out what USE flag a package can/cannot make use of (no pun intended). Some of them I guess are pretty straight forward -- Gnome probably does not need the kde flag set, but others may not be as clear.

For example, I have no idea as to whether Mozilla/Phoenix will be drawing on gtk or qt, both or neither. It makes sense to me that Mozilla/Phoenix might be able to take advantage of both, but how do you find out for sure?
Back to top
View user's profile Send private message
Delphiki
Guru
Guru


Joined: 04 Oct 2002
Posts: 337
Location: A2

PostPosted: Thu Feb 13, 2003 3:27 am    Post subject: Reply with quote

wilburpan wrote:
So how does one figure out what USE flag a package can/cannot make use of (no pun intended). Some of them I guess are pretty straight forward -- Gnome probably does not need the kde flag set, but others may not be as clear.

For example, I have no idea as to whether Mozilla/Phoenix will be drawing on gtk or qt, both or neither. It makes sense to me that Mozilla/Phoenix might be able to take advantage of both, but how do you find out for sure?


In the case of Mozilla/Phoenix they can use the gtk, gtk2 use flags but not qt. They can use others of course being the large packages they are.. Anyway, if you look at the ebuild you can see which use variables a package uses, though there might be an easier way.
_________________
Excellent..
Back to top
View user's profile Send private message
plate
Bodhisattva
Bodhisattva


Joined: 25 Jul 2002
Posts: 1663
Location: Berlin

PostPosted: Thu Feb 13, 2003 4:11 am    Post subject: Reply with quote

Moved from Installing Gentoo.
Back to top
View user's profile Send private message
David_Escott
l33t
l33t


Joined: 12 Jan 2003
Posts: 952
Location: Boston, MA

PostPosted: Fri Feb 14, 2003 5:48 am    Post subject: Reply with quote

mozilla doesnt draw with gtk or gtk2, it uses its own library but provides bindings to gtk and gtk2 for use in galeon, and can emulate the look and feel of gtk and gtk2
Back to top
View user's profile Send private message
rac
Bodhisattva
Bodhisattva


Joined: 30 May 2002
Posts: 6553
Location: Japanifornia

PostPosted: Fri Feb 14, 2003 6:12 pm    Post subject: Reply with quote

wilburpan wrote:
So how does one figure out what USE flag a package can/cannot make use of
With Portage >=2.0.46-r12, the '-v' flag will tell you this.
_________________
For every higher wall, there is a taller ladder
Back to top
View user's profile Send private message
wilburpan
l33t
l33t


Joined: 21 Jan 2003
Posts: 977

PostPosted: Tue Feb 18, 2003 4:50 am    Post subject: Reply with quote

Perhaps this could be added to the portage documentation. I just looked, and the closest thing to a -v flag that is mentioned in either documentation file is the --verbose flag, which does not look to be the same at all.
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