Jump to content

Photo

Question about USE Flags

make.conf use config ebuild portage flags cpu arch build compile

3 replies to this topic

#1
therickaman

therickaman

    Newbie

  • Members
  • Pip
  • 3 posts

Hello All,

 

I have a question regarding the use flags with the intel64-haswell subarch.  Since I don't plan to compile code on any other machine but the computer I'm installing on, why would the use flag -march=core-avx2 be superior to -march=native?

 

Perhaps I'm incorrect, but wouldn't -march=native be best for me?  If not, why?  I'm really confused by core-avx2.  I could be wrong, but I think using -march=native is equivalent to -march=haswell in this case.  If so, is -march=haswell different from -march=core-avx2?

 

I did notice that the CPU_FLAGS mentioned on the subarch page missed avx2, so I added that into the CPU_FLAGS within make.conf.

 

Any help would be greatly appreciated.

 

Thanks,

 

Rick



#2
cardinal

cardinal

    Advanced Member

  • Members
  • PipPipPip
  • 252 posts

https://gcc.gnu.org/....9/changes.html
New Targets and Target Specific Improvements
IA-32/x86-64
Optimizing for other Intel microarchitectures have been renamed to -march=nehalem, westmere, sandybridge, ivybridge, haswell, bonnell.
Funtoo uses gcc-4.9.3,  -march=haswell is set with


epro subarch intel64-haswell-pure64 

or

epro subarch intel64-haswell-64

gcc < 4.9 would use -march=core-avx2

My preference is to use native on my pure64 install.
 

epro subarch native_pure64 

Setting -march=haswell or using native with haswell cpu should enable avx2

man gcc:

haswell
Intel Haswell CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2,
SSE3, SSSE3, SSE4.1, SSE4.2, POPCNT, AVX, AVX2, AES, PCLMUL,
FSGSBASE, RDRND, FMA, BMI, BMI2 and F16C instruction set support.

 

Verify what is auto-enabled with native:

gcc -march=native -Q --help=target


#3
therickaman

therickaman

    Newbie

  • Members
  • Pip
  • 3 posts

Then, what exactly should be in the /etc/portage/make.conf file for CPU_FLAGS_X86, if using -march=native?  

 

Is this flag passed to programs to be built?  If so, I understand why.  If not, then...what is CPU_FLAGS_X86 for?



#4
cardinal

cardinal

    Advanced Member

  • Members
  • PipPipPip
  • 252 posts
Some programs like ffmpeg are optimized by passing cpu flags as compile options.
If using cpu specific subarch the correct CPU_FLAGS_X86 are specified in the profile.
generic_64 and native_64 subarch provide only CPU_FLAGS_X86="mmx mmxext sse sse2"
For more optimization with generic or native subarch use the tool app-portage/cpuinfo2cpuflags to detect cpu flags of running cpu.
Add detected flags manually to CPU_FLAGS_X86 in make.conf



Reply to this topic



  



Also tagged with one or more of these keywords: make.conf, use, config, ebuild, portage, flags, cpu, arch, build, compile

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users