# i7-8700 Coffee Lake S system compilation logic

## bagas

Hello

Tell me what logic of compilation / assembly of the system is better to specify for the processor intel i7-8700.

I have not forgotten anything?

make.conf

```
CHOST="x86_64-pc-linux-gnu"

CFLAGS="-march=skylake -O2 -pipe"

CXXFLAGS="${CFLAGS}"

FFLAGS="${CFLAGS}"

CPU_FLAGS_X86="mtrr sse sse2 sse3 ss ssse3 pae mmx mmxext sse4.1 sse4.2 avx2 aes"

MAKEOPTS="-j12"

CC=gcc

CXX=g++

FEATURES="-parallel-fetch -collision-protect -xattr"

DISTDIR="/mnt/distfiles"

PORTAGE_TMPDIR="/mnt/tmp"

GENTOO_MIRRORS="http://mirror.yandex.ru/gentoo-distfiles"

VIDEO_CARDS="intel i965"

ALSA_CARDS="hda-intel"

INPUT_DEVICES="mouse keyboard"

LINGUAS="ru en"

GRUB_PLATFORMS="pc"

USE="freetype -gnome -samba -cups thunar consolekit policykit pam udev bash-completion unicode 7zip xorg esd xvmc dxr3 audiofile vidix aalib vcd -hal xvid lua bzip2 dbus a52 aac amr accessibility oss mng vorbis crypt python perl flac -arts ieee1394 -kdevelop xine tiff djvu glib mtrr dvd slang lzo -kde alsa cdr sse sse2 ss ssse3 sse4.1 sse4.2 avx2 aes pae mp3 X mmx ogg -ipv6 -kdeenablefinal -kdehiddenvisibility jpeg gif -sudo pnp png usb pdf -multilib pdo"

ACCEPT_LICENSE="AdobeFlash-11.x AdobeFlash-10.3 Nero-EULA-US AdobeFlash-10 skype-eula skype-4.0.0.7-copyright dlj-1.1 google-chrome OPERA-12"

EMERGE_DEFAULT_OPTS="--autounmask=n"

PHP_INI_VERSION=production

L10N="ru"
```

----------

## toralf

/me wonders if a generic

```
CFLAGS="-march=native -O2 -pipe"
```

would work too?

----------

## bagas

 *toralf wrote:*   

> /me wonders if a generic
> 
> ```
> CFLAGS="-march=native -O2 -pipe"
> ```
> ...

 

You want to say that this aggressive setting to compile CFLAGS="-march=skylake -O2 -pipe" ?

And it is better to use CFLAGS="-march=native -O2 -pipe"?

----------

## fedeliallalinea

 *bagas wrote:*   

> You want to say that this aggressive setting to compile CFLAGS="-march=skylake -O2 -pipe" ?
> 
> And it is better to use CFLAGS="-march=native -O2 -pipe"?

 

Teorically if your cpu is really skylake there is no difference. "-march=native causes the compiler to auto-detect the architecture of the build computer." (man gcc).

You can check difference with

```
$ gcc -march=native -Q --help=target | grep march

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

$ gcc -march=skylake -v -Q --help=target
```

----------

## bagas

 *fedeliallalinea wrote:*   

>  *bagas wrote:*   You want to say that this aggressive setting to compile CFLAGS="-march=skylake -O2 -pipe" ?
> 
> And it is better to use CFLAGS="-march=native -O2 -pipe"? 
> 
> Teorically if your cpu is really skylake there is no difference. "-march=native causes the compiler to auto-detect the architecture of the build computer." (man gcc).
> ...

 

You are right, I will specify native to be automatically detected.

I have a family of processors Coffee Lake S .

And CPU_FLAGS_X86 indicated the correct?

----------

## fedeliallalinea

 *bagas wrote:*   

> And CPU_FLAGS_X86 indicated the correct?

 

For these you can use app-portage/cpuid2cpuflags

----------

## Duncan Mac Leod

I have used CFLAGS="-march=core-avx2 -O2 -pipe" for my Skylake and Kaby Lake CPUs, even for my Skylakes running under VMware, without any problems.

I would also use this setting on a Coffee Lake CPU if I would own one  :Wink: 

Just my 2 cents...

----------

