View previous topic :: View next topic |
Author |
Message |
luz n00b
Joined: 17 Jul 2018 Posts: 5
|
Posted: Tue Jul 17, 2018 5:04 am Post subject: CFLAGS/CXXFLAGS vs. CPU_FLAGS_X86 |
|
|
Hi everyone, I'm new to Gentoo. I installed without setting CPU_FLAGS_X86. Does that mean I got basic x86_64 binaries even though my CFLAGS and CXXFLAGS were set to -march=skylake-avx512 ? I'm dreading reinstalling as it takes an entire day even on a fast machine but it will be necessary if that's the case; the whole reason I'm using Gentoo is to get the optimizations, otherwise I'd have stayed with Arch. Without CPU_FLAGS_X86 being set, do CFLAGS/CXXFLAGS even matter? Or vice versa, if I'm using -march=skylake-avx512 do I get the optimizations regardless of what CPU_FLAGS_X86 is set to? The apparent redundancy of these settings and the apparent need for both (why?) are doing my head in, any help would be appreciated a lot. |
|
Back to top |
|
|
khayyam Watchman
Joined: 07 Jun 2012 Posts: 6227 Location: Room 101
|
Posted: Tue Jul 17, 2018 5:50 am Post subject: |
|
|
luz wrote: | Does that mean I got basic x86_64 binaries even though my CFLAGS and CXXFLAGS were set to -march=skylake-avx512 |
luz ... no, CFLAGS will be passed to practically all packages, but CPU_FLAGS_X86 will only effect a few packages ... so, those with sse*, mmx, etc, optimizations available:
Code: | % for i in $(egrep '^CPU_FLAGS_X86' /etc/portage/make.conf | cut -d '"' -f2) ; do eix --only-names --exact --installed-with-use cpu_flags_x86_$i ; done | sort -u
app-i18n/uchardet
dev-libs/openssl
media-libs/flac
media-libs/imlib2
media-libs/libpng
media-libs/libvpx
media-libs/libwebp
media-libs/x264
media-video/ffmpeg
x11-libs/pixman |
If you felt inclined you could remerge the effected packages with the following (requires app-portage/eix):
Code: | # emerge --oneshot --ask $(for i in $(egrep '^CPU_FLAGS_X86' /etc/portage/make.conf | cut -d '"' -f2) ; do eix --only-names --exact --installed-without-use cpu_flags_x86_$i ; done | sort -u) |
Edit: s/with/without
welcome to gentoo & best ... khay
Last edited by khayyam on Tue Jul 17, 2018 6:05 am; edited 1 time in total |
|
Back to top |
|
|
fedeliallalinea Administrator
Joined: 08 Mar 2003 Posts: 31347 Location: here
|
Posted: Tue Jul 17, 2018 5:54 am Post subject: |
|
|
CPU_FLAGS_X86 should have no influence on the CFLAGS/CXXFLAG optimization added with march because is a use_exapnd and is for enable some optimization on packages.
Then you can set CPU_FLAGS_X86 and run
Code: | # emerge -UD --with-bdeps y @world |
for rebuild packages that have these use flags
EDIT: luz welcome to Gentoo forum! _________________ Questions are guaranteed in life; Answers aren't.
Last edited by fedeliallalinea on Tue Jul 17, 2018 7:05 am; edited 2 times in total |
|
Back to top |
|
|
khayyam Watchman
Joined: 07 Jun 2012 Posts: 6227 Location: Room 101
|
Posted: Tue Jul 17, 2018 6:15 am Post subject: |
|
|
fedeliallalinea wrote: | Code: | # emerge -UD --with-bdeps y @world |
|
fedeliallalinea, luz ... '-U,--changed-use' is probably a better option to what I'd suggested ... doh!!
best ... khay |
|
Back to top |
|
|
luz n00b
Joined: 17 Jul 2018 Posts: 5
|
Posted: Tue Jul 17, 2018 11:20 am Post subject: |
|
|
Thanks, everyone! Much appreciated. |
|
Back to top |
|
|
|