Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
make.conf advice
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
Budoka
l33t
l33t


Joined: 03 Jun 2012
Posts: 777
Location: Tokyo, Japan

PostPosted: Thu Dec 11, 2014 3:14 am    Post subject: make.conf advice Reply with quote

Would Gentoo community mind taking a look at my make.conf and letting me know if they have any suggestions or see anything that I should or shouldn't have in it? Trying to run lean and mean and optimized as best as possible.Thanks.


Code:
# These settings were set by the catalyst build script that automatically
# built this stage.
# Please consult /usr/share/portage/config/make.conf.example for a more
# detailed example.
CFLAGS="-O2 -march=native -pipe"
CXXFLAGS="${CFLAGS}"
# WARNING: Changing your CHOST is not something that should be done lightly.
# Please consult http://www.gentoo.org/doc/en/change-chost.xml before changing.
CHOST="x86_64-pc-linux-gnu"
# These are the USE flags that were used in addition to what is provided by the
# profile used for building.
USE="cryptsetup lm_sensors lua sensord video -bindist -emboss -gdbm -gnome
     -minimal -pulseaudio -static-libs -systemd -systemd-units"

# Added for handbook-amd64
#MAKEOPTS="-j2"
# Added for http://forums.gentoo.org/viewtopic-t-953956-highlight-.html
MAKEOPTS="-j4"

#Depricated as indicated at http://wiki.gentoo.org/wiki/Mirrorselect and http://forums.gentoo.org/viewtopic-t-986518-highlight-sync+variable.html
#SYNC="rsync://rsync.jp.gentoo.org/gentoo-portage"

# Added for grub2 handbook
GRUB_PLATFORMS="emu gentoo_platforms_efi-32 gentoo_platforms_efi-64 pc"

#Added for http://en.gentoo-wiki.com/wiki/Fglrx
#VIDEO_CARDS="fglrx"

#Added for http://wiki.gentoo.org/wiki/Fglrx
VIDEO_CARDS="fglrx intel"

#Added for http://wiki.gentoo.org/wiki/Intel
#VIDEO_CARDS="intel"

#Added for http://wiki.gentoo.org/wiki/Radeon
#VIDEO_CARDS="radeon"

LINGUAS="en en_US ja ja_JP"

#Added for http://forums.gentoo.org/viewtopic-t-959200-highlight-.html
EMERGE_DEFAULT_OPTS="--exclude gentoo-sources"

# Set PORTDIR for backward compatibility with various tools:
#   gentoo-bashcomp - bug #478444
#   euse - bug #474574
#   euses and ufed - bug #478318
PORTDIR="/usr/portage"

# Added for http://forums.gentoo.org/viewtopic-t-970418-highlight-.html
source /var/lib/layman/make.conf

GENTOO_MIRRORS="ftp://ftp-stud.hs-esslingen.de/pub/Mirrors/gentoo/ http://mirror.qubenet.net/mirror/gentoo/ http://ftp.df.lth.se/pub/gentoo/"

#GENTOO_MIRRORS="rsync://mirrors.rit.edu/gentoo/ ftp://mirrors.rit.edu/gentoo/ http://mirrors.rit.edu/gentoo/"

#GENTOO_MIRRORS="http://gentoo.channelx.biz/ http://gentoo.gg3.net/ ftp://gg3.net/pub/linux/gentoo/ ftp://ftp.iij.ad.jp/pub/linux/gentoo/ http://ftp.iij.ad.jp/pub/linux/gentoo/ rsync://ftp.iij.ad.jp/pub/linux/gentoo/ http://ftp.jaist.ac.jp/pub/Linux/Gentoo/ rsync://ftp.jaist.ac.jp/pub/Linux/Gentoo/ ftp://ftp.jaist.ac.jp/pub/Linux/Gentoo/ rsync://mirrors.rit.edu/gentoo/ ftp://mirrors.rit.edu/gentoo/ http://mirrors.rit.edu/gentoo/"

# Added for signed portage sync. https://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=2&chap=3#webrsync-gpg
FEATURES="webrsync-gpg"
PORTAGE_GPG_DIR="/etc/portage/gpg"


My box...
64bit running Luks on LVM2.

Code:
# lspci
00:00.0 Host bridge: Intel Corporation 2nd Generation Core Processor Family DRAM Controller (rev 09)
00:01.0 PCI bridge: Intel Corporation Xeon E3-1200/2nd Generation Core Processor Family PCI Express Root Port (rev 09)
00:02.0 VGA compatible controller: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09)
00:16.0 Communication controller: Intel Corporation 6 Series/C200 Series Chipset Family MEI Controller #1 (rev 04)
00:1a.0 USB controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #2 (rev 04)
00:1b.0 Audio device: Intel Corporation 6 Series/C200 Series Chipset Family High Definition Audio Controller (rev 04)
00:1c.0 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 1 (rev b4)
00:1c.3 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 4 (rev b4)
00:1c.4 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 5 (rev b4)
00:1d.0 USB controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #1 (rev 04)
00:1f.0 ISA bridge: Intel Corporation HM65 Express Chipset Family LPC Controller (rev 04)
00:1f.2 SATA controller: Intel Corporation 6 Series/C200 Series Chipset Family 6 port SATA AHCI Controller (rev 04)
00:1f.3 SMBus: Intel Corporation 6 Series/C200 Series Chipset Family SMBus Controller (rev 04)
01:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Seymour [Radeon HD 6400M/7400M Series] (rev ff)
02:00.0 Network controller: Intel Corporation Centrino Advanced-N 6230 [Rainbow Peak] (rev 34)
03:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 06)
04:00.0 USB controller: ASMedia Technology Inc. ASM1042 SuperSpeed USB Host Controller
Back to top
View user's profile Send private message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 3664

PostPosted: Thu Dec 11, 2014 11:00 am    Post subject: Reply with quote

Regarding the USE flags, I think you'd better completely move them to package.use (see https://forums.gentoo.org/viewtopic-p-7649360.html#7649360 )
Back to top
View user's profile Send private message
dataking
Apprentice
Apprentice


Joined: 20 Apr 2005
Posts: 251

PostPosted: Thu Dec 11, 2014 6:26 pm    Post subject: Re: make.conf advice Reply with quote

Budoka wrote:

# Added for handbook-amd64
#MAKEOPTS="-j2"
# Added for https://forums.gentoo.org/viewtopic-t-953956-highlight-.html
MAKEOPTS="-j4"


I scanned through the referenced thread but didn't really see anything relevant, except the "-j4". (Maybe I missed something?)

Unless the convention has changed, and I'm just not aware, MAKEOPTS should be the number of (virtual) processor cores + 1. So a Core2 Duo, with 2 cores, would use MAKEOPTS="-j3". My AMD Phenom II with 8 cores would use MAKEOPTS="-j9", etc.
_________________
-= the D@7@k|n& =-
Back to top
View user's profile Send private message
Budoka
l33t
l33t


Joined: 03 Jun 2012
Posts: 777
Location: Tokyo, Japan

PostPosted: Sat Jan 24, 2015 6:32 pm    Post subject: Re: make.conf advice Reply with quote

dataking wrote:
Budoka wrote:

# Added for handbook-amd64
#MAKEOPTS="-j2"
# Added for https://forums.gentoo.org/viewtopic-t-953956-highlight-.html
MAKEOPTS="-j4"


I scanned through the referenced thread but didn't really see anything relevant, except the "-j4". (Maybe I missed something?)

Unless the convention has changed, and I'm just not aware, MAKEOPTS should be the number of (virtual) processor cores + 1. So a Core2 Duo, with 2 cores, would use MAKEOPTS="-j3". My AMD Phenom II with 8 cores would use MAKEOPTS="-j9", etc.


Thanks. It was a misunderstanding on my part. BillWho made the comment in the thread that
Quote:
You might want to look through /etc/genkernel.conf for anything you'd like to tweak. You can set MAKEOPTS="-j4" for a faster compile
so I changed it to that. I didn't catch that he meant in the genkernel.conf not the make.conf.

But still begs the question what should I set it to?

I have a Core i7 on a laptop (Intel(R) Core(TM) i7-2675QM CPU @ 2.20GHz). http://ark.intel.com/products/53470/Intel-Core-i7-2675QM-Processor-6M-Cache-up-to-3_10-GHz If I am reading this correctly it is indicating four cores? So I should set it to -j5? I don't know what the recommended formula is. I saw somebody in another thread said it is better to be set to the number of threads which in my case would be 8.
Quote:
I tested this script on ~20 different machines and in the majority of the cases, the best optimization was ${core} or more exactly ${threads} of your CPU.
Full can be found here. https://blogs.gentoo.org/ago/2013/01/14/makeopts-jcore-1-is-not-the-best-optimization/

What do the experts think?
Back to top
View user's profile Send private message
John R. Graham
Administrator
Administrator


Joined: 08 Mar 2005
Posts: 10587
Location: Somewhere over Atlanta, Georgia

PostPosted: Sat Jan 24, 2015 6:40 pm    Post subject: Reply with quote

See how many virtual cores that
Code:
cat /proc/cpuinfo
shows. The thumb rule is one more than that, but the actuality is more complicated. For instance, if you have a modest amount of memory, you may want to reduce the number if you see your free memory bottoming out during compiles.The goal is to keep all your cores occupied during builds, unless there are other adverse effects.

- John
_________________
I can confirm that I have received between 0 and 499 National Security Letters.
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6227
Location: Room 101

PostPosted: Sat Jan 24, 2015 8:39 pm    Post subject: Re: make.conf advice Reply with quote

Budoka wrote:
USE="cryptsetup lm_sensors lua sensord video -bindist -emboss -gdbm -gnome
-minimal -pulseaudio -static-libs -systemd -systemd-units"

Budoka ... as someone already pointed out some of these are so specific that they are probably best set via package.use. Also, with your processor you probably want mmx, sse, sse2, sse4_1, etc ... or whatever features your cpu supports:

Code:
# awk '/^flags/{print ; exit}' /proc/cpuinfo

I'm not sure what profile you have set but '-minimal', and '-static-libs', are, I believe, defaults. This is probably true of other useflags (ie, -systemd-units). So, I would go over the above and either remove them or relocate them to package.use (all perhaps except, -gnome, -pulseaudio, -systemd as they make sense to set globaly). A good rule of thumb is the make.conf is for enabling/disabling globaly, package.use is for fine grained control on a per-package basis.

Also, if you don't know of it already app-portage/gentoolkit provides 'euse' (amoung other useful tools) this can provide useful information about what useflags are used by what, and what they enable on the package, for for instance:

Code:
# euse -i systemd-units
global use flags (searching: systemd-units)
************************************************************
no matching entries found

local use flags (searching: systemd-units)
************************************************************
[-  ] systemd-units
  sys-auth/consolekit: Install systemd unit files to replace the modern functionality of logind in sys-apps/systemd. Not recommended.
     [-  ] 0.4.6 [gentoo]
           0.9.2 [gentoo]

Budoka wrote:
#Depricated as indicated at http://wiki.gentoo.org/wiki/Mirrorselect and https://forums.gentoo.org/viewtopic-t-986518-highlight-sync+variable.html
#SYNC="rsync://rsync.jp.gentoo.org/gentoo-portage"

Its also depricated in general (ie, for layman and local overlays) rather than 'source /var/lib/layman/make.conf' (as you do) they can also be defined in repos.conf, eg:

/etc/portage/repo.conf/foo.overlay.conf
Code:
[foo-overlay]
location = /var/pkg/foo-overlay

Budoka wrote:
# Added for grub2 handbook
GRUB_PLATFORMS="emu gentoo_platforms_efi-32 gentoo_platforms_efi-64 pc"

Your building grub2.efi for both 32bit and 64bit? Given your processor you probably only need 'gentoo_platforms_efi-64' (if you're using efi).

Budoka wrote:
#Added for https://forums.gentoo.org/viewtopic-t-959200-highlight-.html
EMERGE_DEFAULT_OPTS="--exclude gentoo-sources"

That really isn't the place to exclude a package, there is package.mask and profile/packages, or even package.accept_keywords, for that. I'm not sure what you are trying to achieve but you might simply mask those packages equal to, or higher than, the series you want, or currently have installed (ie, 3.14.27). This way you will only get the package updates for that series, eg:

/etc/portage/package.mask
Code:
>=sys-kernel/gentoo-sources-3.17.7

Also for EMERGE_DEFAULT_OPT I'd suggest you add the variable itself (so that you can use it, like any other variable, from the command line) and also '--with-bdeps=y'

Code:
EMERGE_DEFAULT_OPTS="${EMERGE_DEFAULT_OPTS} --with-bdeps=y"

Other things you are missing, but might want to add:

Code:
LANG=C
LC_CTYPE="${LANG}"
LC_COLLATE="${LANG}"
LC_MESSAGES="${LANG}"

HTH & best ... khay
Back to top
View user's profile Send private message
Budoka
l33t
l33t


Joined: 03 Jun 2012
Posts: 777
Location: Tokyo, Japan

PostPosted: Mon Jan 26, 2015 4:18 pm    Post subject: Reply with quote

First let me thank everybody for their help and excellent advice. Slowly but surely I am making progress with my Gentoo box and learning loads in the process.

I have a question about my CFLAGS.

After reading https://wiki.gentoo.org/wiki/Safe_CFLAGS (which I must confess was a little confusing language wise) and https://software.intel.com/en-us/blogs/2012/09/26/gcc-x86-performance-hints I set my CFLAGS to
Quote:
CFLAGS="-march=corei7-avx -mcx16 -msahf -m64 -Ofast -flto -funroll-loops -O2 -pipe"


As instructed I did the following:

Quote:
$ LANG="en"
$ touch native.cc
$ touch march.cc
$ gcc -fverbose-asm -march=native native.cc -S
$ grep march native.s
# options passed: -D_GNU_SOURCE native.cc -march=corei7-avx -mcx16 -msahf
$ gcc -fverbose-asm -march=corei7-avx march.cc -S
$ sed -i 1,/options\ enabled/d march.s
$ sed -i 1,/options\ enabled/d native.s
$ diff march.s native.s


Diff came up empty so I concluded that my arch is
Code:
-march=corei7-avx
and also used the
Code:
-mcx16 -msahf
it kicked out. Then I saw at Intel for 64 bit they recommend
Code:
-m64 -Ofast -flto -march=native -funroll-loops
which I added substituting march=native for my own arch march=corei7-avx.

Does this seem correct or did I botch it?
Back to top
View user's profile Send private message
Budoka
l33t
l33t


Joined: 03 Jun 2012
Posts: 777
Location: Tokyo, Japan

PostPosted: Mon Jan 26, 2015 4:50 pm    Post subject: Re: make.conf advice Reply with quote

khayyam wrote:
Budoka wrote:
USE="cryptsetup lm_sensors lua sensord video -bindist -emboss -gdbm -gnome
-minimal -pulseaudio -static-libs -systemd -systemd-units"

Budoka ... as someone already pointed out some of these are so specific that they are probably best set via package.use. Also, with your processor you probably want mmx, sse, sse2, sse4_1, etc ... or whatever features your cpu supports:

Code:
# awk '/^flags/{print ; exit}' /proc/cpuinfo

I'm not sure what profile you have set but '-minimal', and '-static-libs', are, I believe, defaults. This is probably true of other useflags (ie, -systemd-units). So, I would go over the above and either remove them or relocate them to package.use (all perhaps except, -gnome, -pulseaudio, -systemd as they make sense to set globaly). A good rule of thumb is the make.conf is for enabling/disabling globaly, package.use is for fine grained control on a per-package basis.

Also, if you don't know of it already app-portage/gentoolkit provides 'euse' (amoung other useful tools) this can provide useful information about what useflags are used by what, and what they enable on the package, for for instance:

Code:
# euse -i systemd-units
global use flags (searching: systemd-units)
************************************************************
no matching entries found

local use flags (searching: systemd-units)
************************************************************
[-  ] systemd-units
  sys-auth/consolekit: Install systemd unit files to replace the modern functionality of logind in sys-apps/systemd. Not recommended.
     [-  ] 0.4.6 [gentoo]
           0.9.2 [gentoo]



I have been reading the documentation on uses and the advice on this thread and am still a little fuzzy on some stuff.

I noticed that apulse, which I added via ufed, ended up in make.conf. So I suspect that ufed populates make.conf since that is the only tool I use for uses. I am not sure how to remedy this but I'll look farther into it.

If I take a use out of make.conf and add it to package.use do I have to add it for every package that calls on it? So for example if I look at this output...

Quote:
$ euse -i cryptsetup
WARNING: 'portageq envvar PORTDIR' is deprecated. Use 'portageq repositories_configuration' instead.
WARNING: 'portageq envvar PORTDIR' is deprecated. Use 'portageq repositories_configuration' instead.
WARNING: 'portageq envvar PORTDIR' is deprecated. Use 'portageq repositories_configuration' instead.
global use flags (searching: cryptsetup)
************************************************************
no matching entries found

local use flags (searching: cryptsetup)
************************************************************
[+ C ] cryptsetup
sys-apps/systemd: Enable cryptsetup tools (includes unit generator
for crypttab)
[+ ] (0/2) 215-r3 [gentoo]
[+ ] (0/2) 216-r2 [gentoo]
[+ ] (0/2) 216-r3 [gentoo]
[+ ] (0/2) 217-r4 [gentoo]
[+ ] (0/2) 218-r1 [gentoo]
[+ ] (0/2) 218-r2 [gentoo]
[+ ] (0/2) 9999 [gentoo]

[+ C ] cryptsetup
sys-fs/udisks: Enable sys-fs/cryptsetup support
1.0.5 [gentoo]
1.0.5-r1 [gentoo]
[+P ] (2) 2.1.3 [gentoo]
[+P ] (2) 2.1.4 [gentoo]

[+ C ] cryptsetup
sys-kernel/genkernel: Enable support for Luks disk encryption using
sys-fs/cryptsetup
[+P ] 3.4.45.1 [gentoo]
[+P ] 3.4.48 [gentoo]
[+P ] 3.4.49 [gentoo]
[+P ] 3.4.49.1 [gentoo]
[+P ] 3.4.49.2 [gentoo]
[+P ] 3.4.50 [gentoo]
[+P ] 3.4.51 [gentoo]
[+P ] 3.4.51.1 [gentoo]
[+P ] 3.4.51.2 [gentoo]
[+P ] 9999 [gentoo]
[+P ] 9999-r1 [gentoo]

[+ C ] cryptsetup
sys-kernel/genkernel-next: Enable support for Luks disk enrcyption
using sys-fs/cryptsetup
[+ ] 35 [gentoo]
[+ ] 54 [gentoo]
[+ ] 55 [gentoo]
[+ ] 58 [gentoo]
[+ ] 58-r1 [gentoo]
[+ ] 60 [gentoo]


If I use all of these packages would I have to add 4 individual lines to packag.use? eg:

Quote:
sys-apps/systemd cryptsetup
sys-fs/udisks cryptsetup
sys-kernel/genkernel cryptsetup
sys-kernel/genkernel-next cryptsetup


Or can I just add
Quote:
cryptsetup
?





Quote:
$ awk '/^flags/{print ; exit}' /proc/cpuinfo
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx lahf_lm ida arat epb pln pts dtherm tpr_shadow vnmi flexpriority ept vpid xsaveopt


So I did euse -i on those and concluded that only
Quote:
dts acpi mmx sse sse2 ssse3 sse4_1 avx
are used globally so added them to make.conf.
Your paste can be seen here:https://bpaste.net/show/5cf52a7218d8 The local uses that don't appear in global I would add to package.use per the package?

So now my uses look like this
Code:
USE="cryptsetup lm_sensors lua networkmanager sensord video -bindist -emboss -gdbm -gnome -minimal -pulseaudio -static-libs -systemd -systemd-units
dts acpi mmx sse sse2 ssse3 sse4_1 avx"


I didn't remove the other stuff yet because wanted to confirm the proper method to add to package.use first.

Thanks as always for everyones patience and assistance.
Back to top
View user's profile Send private message
Budoka
l33t
l33t


Joined: 03 Jun 2012
Posts: 777
Location: Tokyo, Japan

PostPosted: Mon Jan 26, 2015 4:57 pm    Post subject: Re: make.conf advice Reply with quote

khayyam wrote:

Budoka wrote:
# Added for grub2 handbook
GRUB_PLATFORMS="emu gentoo_platforms_efi-32 gentoo_platforms_efi-64 pc"

Your building grub2.efi for both 32bit and 64bit? Given your processor you probably only need 'gentoo_platforms_efi-64' (if you're using efi).


Thanks for the tip. I looked at the matrix for grub at https://wiki.gentoo.org/wiki/GRUB2#Configuration and if I understand correctly my laptop doesn't use any of that stuff except maybe "pc" so I changed it to
Code:
GRUB_PLATFORMS="pc"
The only one I wasn't 100 percent sure about was coreboot but am assuming since my laptop has a BIOS I don't need that either?
Back to top
View user's profile Send private message
cwr
Veteran
Veteran


Joined: 17 Dec 2005
Posts: 1969

PostPosted: Mon Jan 26, 2015 5:57 pm    Post subject: Reply with quote

Long ago I started with a minimal set of USE flags in make.conf, and I've slowly added to them
as the need became apparent. (Most flags are set in package.use). The result is:
Code:

USE="acl acpi alsa cairo cdr dbus doc firefox java5 jpeg gnome gstreamer gtk
nautilus ogg opengl pcmcia perl png python qt3support samba svg tiff udev
unicode v4l2 X -apm -bindist -gtk3 -kde -networkmanager -selinux"

I _think_ all those flags are still extant, but the list has been extended and modified for some
years, and some flags may no longer exist. Several of them (svg, tiff and so on) control the
building of apps to handle particular file formats, which is best done globally.

Will
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6227
Location: Room 101

PostPosted: Mon Jan 26, 2015 6:32 pm    Post subject: Reply with quote

Budoka wrote:
I have a question about my CFLAGS. After reading https://wiki.gentoo.org/wiki/Safe_CFLAGS (which I must confess was a little confusing language wise) and https://software.intel.com/en-us/blogs/2012/09/26/gcc-x86-performance-hints I set my CFLAGS to

Code:
CFLAGS="-march=corei7-avx -mcx16 -msahf -m64 -Ofast -flto -funroll-loops -O2 -pipe"

Budoka ... I wouldn't advise that, you will no doubt run into issues with lto and unroll-loops ... also you have -O{x} twice, and -m64 is probably not what you want for multilib (assuming this is a multilib setup). The best thing is to use -march=native and allow the compiler to set whatever values it detects your CPU to support. See what -march=native enables ...

Code:
# LANG=C echo $(gcc -v -march=native -x c /dev/null |& grep /dev/null | egrep -o -- '-+(m|param )\S+')


Also, as you've set -m64 you should check what ABI_X86 is set to (via 'emerge --info').

Budoka wrote:
If I take a use out of make.conf and add it to package.use do I have to add it for every package that calls on it?

You are over-complicating the matter, lets say you have 10 packages that use the 'unicode' useflag and you want support for unicode, then this would be worth adding to make.conf. If, say, for some reason you didn't want that set on some package then you could add 'category/package -unicode' in package.use. As for those packages you don't have installed, and whatever useflags happen to be +/- useflag then there is no need to do anything. So, you've set -systemd, I assume that means you don't want support for systemd, so 'sys-apps/systemd cryptsetup' is pointless. As I said previously the rule of thumb is that most useflags you will most likely need are defined in your profile, for those useflags you definitely want enabled on all packages then use make.conf, otherwise package.use (so, from the most generic to the most specific). New users often sweat over this at first, thinking that they need to define, or negate, every useflags otherwise things will explode ... the reverse it true, mostly useflags are a matter of fine tuning. I don't have any more than ten useflags in make.conf, but I have 79 entries in package.use (that said, I do use the default/linux/x86/13.0 profile ... rather than */desktop).

Budoka wrote:
I looked at the matrix for grub a[...] and if I understand correctly my laptop doesn't use any of that stuff except maybe "pc" so I changed it to

Code:
GRUB_PLATFORMS="pc"

I wasn't 100 percent sure about was coreboot but am assuming since my laptop has a BIOS I don't need that either?

If you have BIOS then pc would be correct ... coreboot you definitely don't have (otherwise you'd know).

best ... khay
Back to top
View user's profile Send private message
Budoka
l33t
l33t


Joined: 03 Jun 2012
Posts: 777
Location: Tokyo, Japan

PostPosted: Mon Jan 26, 2015 7:23 pm    Post subject: Reply with quote

khayyam wrote:
Budoka wrote:
I have a question about my CFLAGS. After reading https://wiki.gentoo.org/wiki/Safe_CFLAGS (which I must confess was a little confusing language wise) and https://software.intel.com/en-us/blogs/2012/09/26/gcc-x86-performance-hints I set my CFLAGS to

Code:
CFLAGS="-march=corei7-avx -mcx16 -msahf -m64 -Ofast -flto -funroll-loops -O2 -pipe"

Budoka ... I wouldn't advise that, you will no doubt run into issues with lto and unroll-loops ... also you have -O{x} twice, and -m64 is probably not what you want for multilib (assuming this is a multilib setup). The best thing is to use -march=native and allow the compiler to set whatever values it detects your CPU to support. See what -march=native enables ...

Code:
# LANG=C echo $(gcc -v -march=native -x c /dev/null |& grep /dev/null | egrep -o -- '-+(m|param )\S+')


Also, as you've set -m64 you should check what ABI_X86 is set to (via 'emerge --info').

Budoka wrote:
If I take a use out of make.conf and add it to package.use do I have to add it for every package that calls on it?

You are over-complicating the matter, lets say you have 10 packages that use the 'unicode' useflag and you want support for unicode, then this would be worth adding to make.conf. If, say, for some reason you didn't want that set on some package then you could add 'category/package -unicode' in package.use. As for those packages you don't have installed, and whatever useflags happen to be +/- useflag then there is no need to do anything. So, you've set -systemd, I assume that means you don't want support for systemd, so 'sys-apps/systemd cryptsetup' is pointless. As I said previously the rule of thumb is that most useflags you will most likely need are defined in your profile, for those useflags you definitely want enabled on all packages then use make.conf, otherwise package.use (so, from the most generic to the most specific). New users often sweat over this at first, thinking that they need to define, or negate, every useflags otherwise things will explode ... the reverse it true, mostly useflags are a matter of fine tuning. I don't have any more than ten useflags in make.conf, but I have 79 entries in package.use (that said, I do use the default/linux/x86/13.0 profile ... rather than */desktop).

Budoka wrote:
I looked at the matrix for grub a[...] and if I understand correctly my laptop doesn't use any of that stuff except maybe "pc" so I changed it to

Code:
GRUB_PLATFORMS="pc"

I wasn't 100 percent sure about was coreboot but am assuming since my laptop has a BIOS I don't need that either?

If you have BIOS then pc would be correct ... coreboot you definitely don't have (otherwise you'd know).

best ... khay


Thank you khay. I am am beginning to have a clearer understanding of how this works. And yes, it is my curse to over-think/complicate things. Haha. I just like to understand what it is I am doing when I do it. Anyway,

I see what you are saying about my CFLAGS. I am indeed running multilib so will lose -m64. ABI_X86 is set to "64" ($ emerge --info https://bpaste.net/show/6e6412d481ea). I will also kill -flto -funroll-loops as you idicate they will be problematic. I opted for -Ofast over -O2 because Intel suggested it on the link I posted earlier. Do you think this is a bad idea?

My only other bit of confusion is about -march. I was originally running -march-native which does this...
Code:
$ LANG=C echo $(gcc -v -march=native -x c /dev/null |& grep /dev/null | egrep -o -- '-+(m|param )\S+')
-march=corei7-avx -mcx16 -msahf -mno-movbe -maes -mpclmul -mpopcnt -mno-abm -mno-lwp -mno-fma -mno-fma4 -mno-xop -mno-bmi -mno-bmi2 -mno-tbm -mavx -mno-avx2 -msse4.2 -msse4.1 -mno-lzcnt -mno-rtm -mno-hle -mno-rdrnd -mno-f16c -mno-fsgsbase -mno-rdseed -mno-prfchw -mno-adx -mfxsr -mxsave -mxsaveopt --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=6144 -mtune=corei7-avx


but there is a note on the wiki indicating that
Quote:
core-avx2 march support was introduced with GCC 4.7. If you have an earlier version of GCC, use -march=native or find cpu-specific options manually.
My gcc is 4.8.3 so should I use -march=corei7-avx? I see native pulls it in anyway. I guess what I am asking is do I need all the other "stuff" that -march-native is pulling in?

Your explanation of uses cleared up any confusion I had. I'll look at them again and try to tweak them based on your advice. Thanks. I guess I should look at my profile and see what are defaults that way I know if I have any redundant entries in make.conf? Just have to find where that is!!! I'll do some more homework.

I have a some other questions but will deal with one problem at a time. More to come and thanks again.
Back to top
View user's profile Send private message
Ant P.
Watchman
Watchman


Joined: 18 Apr 2009
Posts: 6920

PostPosted: Mon Jan 26, 2015 7:30 pm    Post subject: Reply with quote

If you're not using distcc, it's better to leave it as -march=native -O2 -pipe and omit all the other flags. -flto might be safe but anything else is almost always a bad idea.
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6227
Location: Room 101

PostPosted: Mon Jan 26, 2015 8:07 pm    Post subject: Reply with quote

Budoka wrote:
I see what you are saying about my CFLAGS. I am indeed running multilib so will lose -m64. ABI_X86 is set to "64" ($ emerge --info https://bpaste.net/show/6e6412d481ea). I will also kill -flto -funroll-loops as you idicate they will be problematic. I opted for -Ofast over -O2 because Intel suggested it on the link I posted earlier. Do you think this is a bad idea?

Budoka ... if you're running multilib then afaik ABI_X86 would be "32 64 -x32" ... anyhow, I imagine that some CFLAGS are filtered for -m64. As for -Ofast ... well, intel are not supporting gcc, they have their own compiler, so that may not be good advice (to be honest I've *never* seen -Ofast advised anywhere). As you don't know how advantagious it is, and as its generally not promoted as being of some benefit, then I'd opt to stay with the more tried and trusted -O2.

Budoka wrote:
[...] but there is a note on the wiki indicating that [....]

Quote:
core-avx2 march support was introduced with GCC 4.7. If you have an earlier version of GCC, use -march=native or find cpu-specific options manually.

My gcc is 4.8.3 so should I use -march=corei7-avx? I see native pulls it in anyway. I guess what I am asking is do I need all the other "stuff" that -march-native is pulling in?

-march=native enables all the features above including -march=corei7-avx, so why use -march=corei7-avx?

Budoka wrote:
Your explanation of uses cleared up any confusion I had. I'll look at them again and try to tweak them based on your advice. Thanks. I guess I should look at my profile and see what are defaults that way I know if I have any redundant entries in make.conf? Just have to find where that is!!! I'll do some more homework.

OK, good. No, no need to go through all the useflags enabled by the profile, you do have some redundent entries in make.conf (ie, -static-libs and -minmal) but you can just remove these. Again, less is more ... only better.

best ... khay
Back to top
View user's profile Send private message
Budoka
l33t
l33t


Joined: 03 Jun 2012
Posts: 777
Location: Tokyo, Japan

PostPosted: Mon Jan 26, 2015 10:29 pm    Post subject: Reply with quote

Ant P. wrote:
If you're not using distcc, it's better to leave it as -march=native -O2 -pipe and omit all the other flags. -flto might be safe but anything else is almost always a bad idea.


Understood. Thanks!
Back to top
View user's profile Send private message
Budoka
l33t
l33t


Joined: 03 Jun 2012
Posts: 777
Location: Tokyo, Japan

PostPosted: Mon Jan 26, 2015 10:40 pm    Post subject: Reply with quote

khayyam wrote:
Budoka wrote:
I see what you are saying about my CFLAGS. I am indeed running multilib so will lose -m64. ABI_X86 is set to "64" ($ emerge --info https://bpaste.net/show/6e6412d481ea). I will also kill -flto -funroll-loops as you idicate they will be problematic. I opted for -Ofast over -O2 because Intel suggested it on the link I posted earlier. Do you think this is a bad idea?

Budoka ... if you're running multilib then afaik ABI_X86 would be "32 64 -x32" ... anyhow, I imagine that some CFLAGS are filtered for -m64. As for -Ofast ... well, intel are not supporting gcc, they have their own compiler, so that may not be good advice (to be honest I've *never* seen -Ofast advised anywhere). As you don't know how advantagious it is, and as its generally not promoted as being of some benefit, then I'd opt to stay with the more tried and trusted -O2.

Budoka wrote:
[...] but there is a note on the wiki indicating that [....]

Quote:
core-avx2 march support was introduced with GCC 4.7. If you have an earlier version of GCC, use -march=native or find cpu-specific options manually.

My gcc is 4.8.3 so should I use -march=corei7-avx? I see native pulls it in anyway. I guess what I am asking is do I need all the other "stuff" that -march-native is pulling in?

-march=native enables all the features above including -march=corei7-avx, so why use -march=corei7-avx?

Budoka wrote:
Your explanation of uses cleared up any confusion I had. I'll look at them again and try to tweak them based on your advice. Thanks. I guess I should look at my profile and see what are defaults that way I know if I have any redundant entries in make.conf? Just have to find where that is!!! I'll do some more homework.

OK, good. No, no need to go through all the useflags enabled by the profile, you do have some redundent entries in make.conf (ie, -static-libs and -minmal) but you can just remove these. Again, less is more ... only better.

best ... khay


Thanks khay. I'll double check that I am running multilib and sort out what ABI_X86. I'm going out on a limb here but I kind of remember reading somewhere that "64" was the default value but will double check.

I can't remember why -minimal was in there but was instructed to add static-libs very early on in my Gentoo install to facilitate Luks/LVM. Just want to make sure I don't bork my system by removing it. But if I understand correctly I will remove -minimal and static-libs as they are redundant. I did mask systemd to keep it off of my box so is it safe to assume I can take -systemd and -systemd-units out as well?

I REALLY appreciate the help I have been getting on this thread. It is FANTASTIC.
Back to top
View user's profile Send private message
Budoka
l33t
l33t


Joined: 03 Jun 2012
Posts: 777
Location: Tokyo, Japan

PostPosted: Mon Jan 26, 2015 10:43 pm    Post subject: Reply with quote

As a side note...long sighhhhhhhhhhh...is there anything that I have been doing in my make.conf file that could have borked my wifi? I rebooted and now can't get online. I appear connected but am not.

Anyway, I thought I would ask here first before starting another thread as the only tinkering I have been doing is in make.conf. I wouldn't think that it would bork wifi but quite honestly I still don't have a full understanding of how all the moving parts in Gentoo connect.
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6227
Location: Room 101

PostPosted: Mon Jan 26, 2015 11:00 pm    Post subject: Reply with quote

Budoka wrote:
I can't remember why -minimal was in there but was instructed to add static-libs very early on in my Gentoo install to facilitate Luks/LVM. Just want to make sure I don't bork my system by removing it. But if I understand correctly I will remove -minimal and static-libs as they are redundant. I did mask systemd to keep it off of my box so is it safe to assume I can take -systemd and -systemd-units out as well?

Budoka ... '-minimal' will obviously have no effect, its generally only used to provide lightweight versions and/or dependencies for a package. '-static-libs' is not the same as 'static-libs', for building an initramfs with genkernel then sys-fs/lvm, sys-fs/cryptsetup, sys-apps/busybox (and whatever else is targeted for the initramfs) is built with 'static'. I'm not sure why you might have needed to have set 'static-libs' for lvm2 but ... its not :) As for -systemd, I'd rather not trust to the developers that -systemd is set in all cases. I could probably remove it with no effect ... but I definitely don't want it, so I set -systemd just as a safeguard.

Budoka wrote:
I REALLY appreciate the help I have been getting on this thread. It is FANTASTIC.

You're welcome.

Budoka wrote:
As a side note...long sighhhhhhhhhhh...is there anything that I have been doing in my make.conf file that could have borked my wifi? I rebooted and now can't get online. I appear connected but am not. Anyway, I thought I would ask here first before starting another thread as the only tinkering I have been doing is in make.conf. I wouldn't think that it would bork wifi but quite honestly I still don't have a full understanding of how all the moving parts in Gentoo connect.

Well, perhaps you built something with the above CFLAGS, that *may* have caused the above, more likely however is that you've updated something ... you should check with 'qlop -l'. Another thread is probably a better idea ...

best ... khay
Back to top
View user's profile Send private message
Budoka
l33t
l33t


Joined: 03 Jun 2012
Posts: 777
Location: Tokyo, Japan

PostPosted: Tue Jan 27, 2015 5:16 pm    Post subject: Reply with quote

OK. So something borked my system, again. Not just wifi. I reverted back to my original make.conf in the event I caused it and rebuilt but it didn't fix it so clearly something came down that borked it...again. Will be back to this thread when I can sort out new problem. It has rendered my laptop basically unusable. Thanks and I'll be back. Soon I hope.
Back to top
View user's profile Send private message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 3664

PostPosted: Wed Jan 28, 2015 6:49 am    Post subject: Reply with quote

Budoka wrote:
I rebooted and now can't get online. I appear connected but am not.
Sounds like the problem I sometimes have with windows7 (dual boot) when wifi connects with the AP but has a completely wrong IP address. Then once connecting via ethernet and bach to wifi solves the problem.
Back to top
View user's profile Send private message
Budoka
l33t
l33t


Joined: 03 Jun 2012
Posts: 777
Location: Tokyo, Japan

PostPosted: Wed Feb 04, 2015 3:11 am    Post subject: Reply with quote

Slowly but surely making progress and now have a much better understand of uses in gentoo and make.conf in general.

So a news item came down
Quote:
2015-01-28 CPU_FLAGS_X86 introduction
and references an accompanying script to get proper processor stuff.

So now I have changed my uses to the following. What do you think?

Code:
USE="cryptsetup networkmanager -systemd -gdbm -gnome -pulseaudio"
CPU_FLAGS_X86="aes avx mmx mmxext popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3"



Prior to that I had tried these but per everyones suggestion I reduced it to the minimum number I probably need...I hope.
Quote:
#USE="X apulse cryptsetup lm_sensors lua networkmanager sensord video -bindist \
# -emboss -gdbm -gnome -minimal -pulseaudio -static-libs -systemd \
# -systemd-units"

#USE="cryptsetup lm_sensors lua networkmanager -systemd -gdbm -gnome -pulseaudio"


Working on
Quote:
LANG=C
LC_CTYPE="${LANG}"
LC_COLLATE="${LANG}"
LC_MESSAGES="${LANG}"
suggestion but kicked out some errors so trying to sort that out. Will be back after doing my "homework" first.
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6227
Location: Room 101

PostPosted: Wed Feb 04, 2015 3:36 am    Post subject: Reply with quote

Budoka ... that looks fine, I imagine stuff like 'acpi', 'alsa', 'truetype', and 'unicode' might also be worth considering, though its possible these are enabled by your profile.

As for LANG=C, etc, causing errors ... I can't think why, it's a standard locale, what does 'locale -a' show? It should show C, POSIX, and probably whatever you've set as your particular locale (see: /etc/locale.gen).

best ... khay
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