Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] Make.conf optimization
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
AngrySeaBone
n00b
n00b


Joined: 13 Nov 2020
Posts: 20
Location: Between the mountains and the lake

PostPosted: Mon Dec 07, 2020 12:43 pm    Post subject: [SOLVED] Make.conf optimization Reply with quote

Hi guys
I've seen many people online, such as youtuber or other gentoo users on various forums, with a very complete make.conf file. Many options, many optimizations, full of features...

So I took a look at mine make.conf, which is REALLY basic (and felt slightly bad :( ):

https://pastebin.com/WDrgcffi

So I'm asking you if you do know any site, document, datasheet, youtube channel, holy documentations written on stone or everything good in order to optimize this important and mighty file.

I know that there's a wiki (& manpage) about it, obviously I've seen it, but I feel like it's not complete, or however, it wouldn't allow me to create such a "full looking" conf file like the others I've seen. For example there are many USE flags or FEATURES which are not present in those pages.

I don't really have problems with the actual configuration but I really feel like that the main point of Portage, or more in general, Gentoo, it's the granular control of your system, which translates into optimization and, having a "generic" config file, would kill this purpose.


Last edited by AngrySeaBone on Wed Dec 09, 2020 8:05 am; edited 1 time in total
Back to top
View user's profile Send private message
mike155
Advocate
Advocate


Joined: 17 Sep 2010
Posts: 4438
Location: Frankfurt, Germany

PostPosted: Mon Dec 07, 2020 1:11 pm    Post subject: Reply with quote

My recommendation: the less your machine setup deviates from the default settings, the better! It's good to have a very small make.conf. :)

Your make.conf looks pretty good. Two minor nits:
  1. USE flag 'qt4' doesn't exist anymore. Remove it.

  2. Your CFLAGS are
    Code:
    CFLAGS="-O2 -march=znver1 -pipe"

    while your CXXFLAGS are
    Code:
    CXXFLAGS="-march=native -O2 -pipe"

    Why do you use 'znver1' for CFLAGS and 'native' for CXXFLAGS?
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54317
Location: 56N 3W

PostPosted: Mon Dec 07, 2020 1:13 pm    Post subject: Reply with quote

AngrySeaBone,

make.conf alone is not very useful. Its contents modify you your profile.
We need to see the output of
Code:
emerge --info
to see what is in effect globally.

Many users with full to overflowing make.conf files hae lots of redundant entries too because they include things that are already set in their selected profile.

Conversely, some users deliberately choose a minimal profile and make up for that with make.conf entries.

Its two different ways to get to the the same thing. Both are equally correct.
Paranoid users will do the latter as the profiles can be and are changed by developers.

I would expect your
Code:
USE="-systemd elogind udev"
to be redundant.
Also
Code:
PORTDIR="/var/db/repos/gentoo"
DISTDIR="/var/cache/distfiles"
as they are defaults.

PORTDIR= is no longer used :) Its been moved to /etc/portage/repos.conf/gentoo.conf and become location =

There is more ... unless you are one of the paranoid users I mentioned above.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Ionen
Developer
Developer


Joined: 06 Dec 2018
Posts: 2727

PostPosted: Mon Dec 07, 2020 1:14 pm    Post subject: Reply with quote

I'll talk about simplifying it instead, and making it a tiny file with almost nothing in it.

For one thing, not "needed" but personally like moving every USE+USE_EXPAND to package.use nowadays (given I like all USE being in 1 place). e.g. using your make.conf as example:
Code:
*/* -gnome -consolekit -systemd X qt4 qt5 kde alsa pulseaudio policykit udisks dbus elogind udev
*/* VIDEO_CARDS: -* nvidia
(...but some of those USE won't be needed with defaults, and consolekit/qt4 are gone either way)

CHOST: not needed

PORTDIR: deprecated and shouldn't be used, in the event the value is different than repos.conf it can also cause weird issues.

PKGDIR
DISTDIR: not needed given you're using defaults

INPUT_DEVICES: not needed given "just libinput" is the profile default, but can be set in package.use like VIDEO_CARDS if ever need something else

GRUB_PLATFORMS: efi-64+pc is default on a amd64 profile so not really needed, but can be set in package.use if really must disable pc for some reason

And `man 5 make.conf` does document FEATURES if you want to check them, but defaults are pretty sane.

For USE, may (optionally) want to use a proper desktop profile so you don't end up guessing basic things, seeing the USE you've set I'm assuming you may want a desktop/plasma profile. It would notably set things like USE="alsa kde dbus qt5 policykit udev udisks elogind" by itself

Edit: aw, neddy was faster :) Guess I have some redundant lines. Also good catch on znver1 vs native from mike, totally missed that. Preferably stick to =native rather than =specific if not cross-compiling, native can have extra fine-tuning for your exact hardware.
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 4249
Location: Bavaria

PostPosted: Mon Dec 07, 2020 2:08 pm    Post subject: Reply with quote

Finally, you dont need two definitions for the same thing. Leave MAKEOPTS unchanged and change the default options to:
Code:
MAKEOPTS="-j6 -l6"
EMERGE_DEFAULT_OPTS="--with-bdeps=y"
Back to top
View user's profile Send private message
Ionen
Developer
Developer


Joined: 06 Dec 2018
Posts: 2727

PostPosted: Mon Dec 07, 2020 2:22 pm    Post subject: Reply with quote

pietinger wrote:
Finally, you dont need two definitions for the same thing. Leave MAKEOPTS unchanged and change the default options to:
Code:
MAKEOPTS="-j6 -l6"
EMERGE_DEFAULT_OPTS="--with-bdeps=y"
--with-bdeps=y is a default for non-binpkgs operations since portage 2.3.5 (~3.5 years ago), no need to set it anymore.

And portage's --jobs doesn't mean the same thing as MAKEOPTS'. portage's --jobs is nice to speed up single-threaded operations like autoconf checks by running multiple packages at once when possible, but it's to be used with care given it'll multiply with MAKEOPTS during building. Given have a loadavg check it's likely fine though, straight up 6x6 may(?) be excessive (haven't seen the emerge --info).
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 4249
Location: Bavaria

PostPosted: Mon Dec 07, 2020 2:43 pm    Post subject: Reply with quote

Ionen,

thanks a lot for your information ... 3,5 years ... I am getting old ... ;-)
Back to top
View user's profile Send private message
AngrySeaBone
n00b
n00b


Joined: 13 Nov 2020
Posts: 20
Location: Between the mountains and the lake

PostPosted: Mon Dec 07, 2020 3:14 pm    Post subject: Reply with quote

Ok wow, thanks for the fast replys :) I'm loving this community.

After reading your advices, I think I misunderstood some settings :roll: .

1. mike155 I set znver1 in CFLAGS since it was written in the Safe CFLAGS page (https://wiki.gentoo.org/wiki/Safe_CFLAGS#Ryzen_.28Zen.2FZen.2B.2FZen2.29), my CPU is a Ryzen 1500x. I may be wrong but doesn't the entry

Code:
CXXFLAGS="${CFLAGS}"


refer to CFLAGS? Because what you have written is what's in the COMMON_FLAGS entry.

2. Got it, I'll remove "qt4" :wink: (also added because it was on the handbook, I forgot it could have been outdated).

3. NeddySeagoon
Quote:
I would expect your
Code:
USE="-systemd elogind udev"
to be redundant.
Also
Code:
PORTDIR="/var/db/repos/gentoo"
DISTDIR="/var/cache/distfiles"
as they are defaults.


So, Do I have to remove DISTDIR, PKGDIR, PORTDIR and "-systemd"? Am I right?


4. CHOST is present for the same reason, I just copied and pasted the settings of the previous link during the installation phase. I'm going to remove it.


5. pietinger I'll add that ASAP

6. Ionen Yes I'm trying to build a systemd-free, plasma system

I'll post here my actual "emerge --info" and also a little preview of what my new make.conf should look like according to what I've understood from your messages.

SPECS:
-Ryzen 5 1500x
-Nvidia 1050ti
-Ram 8GBs 2400mhz (I know, it sucks, It will be my next upgrade :P)

Emerge --info
1)https://pastebin.com/sJgThs1G

Make.conf.workinprogress
2)https://pastebin.com/Kn5ixsjr
Back to top
View user's profile Send private message
389292
Guru
Guru


Joined: 26 Mar 2019
Posts: 504

PostPosted: Mon Dec 07, 2020 8:24 pm    Post subject: Reply with quote

why do you need so many mirrors? are you preparing for a nuclear war?
Back to top
View user's profile Send private message
AngrySeaBone
n00b
n00b


Joined: 13 Nov 2020
Posts: 20
Location: Between the mountains and the lake

PostPosted: Mon Dec 07, 2020 11:43 pm    Post subject: Reply with quote

etnull Well actually I did it for safety reasons. Didn't know I needed far less of them. Also, I've always used more than 20 mirrors on every arch installations. Guess I'll downsize my mirrors section :lol: .
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54317
Location: 56N 3W

PostPosted: Tue Dec 08, 2020 9:21 am    Post subject: Reply with quote

AngrySeaBone,

I'm not going to give you yes/no answers. That's not the Gentoo way.
I will point the way for you to answer your own questions.

Rename your make.conf so that portage does not see it. You will rename it back later.
Run
Code:
emerge --info

The settings reported come from your profile because make.conf was not found.
As make.conf contains modifications to your profile, you gentoo will work perfectly will with no make.conf at all.
It probably won't be to your taste though.
Save that emerge --info output. You will need to refer to it later.

As make.conf is a set of modifications, anything set in both places is redundant in make.conf.

Restore your make.conf and run
Code:
emerge --info
again.
The differences are due to make.conf.

Now you have most of the information to answer your own questions and a method.

For USE flags, there is a tool called ufed that will let you see where USE flags are set and how many times.
Its the Use Flag EDitor.

The settings hierarchy is The profile you set with
Code:
eselect profile

That is modified by make.conf. (Additions and subtractions)
The result is applied to everything.
Then that are files in /etc/portage/ that provide per package changes. These are missing until you create them.

Lastly, its possible to make changes on the command line. Don't do that because portage will not record the command line changes and you get to keep all the pieces later.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
AngrySeaBone
n00b
n00b


Joined: 13 Nov 2020
Posts: 20
Location: Between the mountains and the lake

PostPosted: Wed Dec 09, 2020 8:04 am    Post subject: Reply with quote

Ok, this helped me a lot. Thanks for all the replys. :)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo 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