Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
change march for core2 -> sandybridge?
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
houtworm
Guru
Guru


Joined: 08 Mar 2003
Posts: 329
Location: Den Haag, Netherlands

PostPosted: Wed Jan 11, 2017 8:17 pm    Post subject: change march for core2 -> sandybridge? Reply with quote

Will I get some benefit from changing the march=core2 to march=sandybridge?
In one pc I have a core2 quad and in the other an i7 3930k
The 2nd machine compiles a lot faster, so if I can use march=core2 also, I can build packages for the core2quad machine.

If I gain a lot in speed with march=sandybridge, I will use that of course.

So what is wise?
_________________
niemand is onbekwamer, dan een timmerman zonder hamer

Kees
Back to top
View user's profile Send private message
Roman_Gruber
Advocate
Advocate


Joined: 03 Oct 2006
Posts: 3355
Location: Austro Bavaria

PostPosted: Wed Jan 11, 2017 9:45 pm    Post subject: Reply with quote

MY opinion:

I had a core2duo T9500 notebook. cpu. With kernel 4.9.x and ~amd64 I used march native

I doubt anyone these days use anything belowe 4.9.x on a desctop box. So you should use march native, no insane flags

Regarding gentoo-sources, you should enable experimental flag. Than you can choose the architecure. I have an ivybridge cpu, so i have chosen ivybridge for my kernel, which reduced a few minutes for libreoffice compiles.


You should not use these core2duo or whatever "outdated", "oldfashioned" flags are around. I am quite certain march native works most of the time out fo the box and is less source for errors.

--

Wahts wise: use march-native. you can crosscompile if you want to.

--

Quote:
march=core2 to march=sandybridge?
Is onyl for guys who have the same cpu as in the gentoo wiki examples. or really know what tehy do. if you don't just use march-native and no ricer flags

--

I had two penryn notebooks for a very long time together. Both gentoo installed. i did not crosscompile. It's a headache to find a proper setup and such. And its not like I had same packages on both. Even on those low performance cpus, it was not that worse to compile everything on that box in the background. It is not like i don'T do something when i compile it in the background.

Headache => t4500 + intel gpu + different chipset / t9500 + nvidia-gpu (mesa different, x-server, other stuff different)

I updated one box. Checked a week if it works. than i updated my second box. Saved me several times some headache because gnome was broken, kde was broken. X-server was broken. And i am not a guy who just has several DE installed. Nope. Just one DE and when that's broken it was a bonus that the second box was not synced and updated.

In recent months only kde had issues. Portage has improved. But in teh old days...
Back to top
View user's profile Send private message
houtworm
Guru
Guru


Joined: 08 Mar 2003
Posts: 329
Location: Den Haag, Netherlands

PostPosted: Wed Jan 11, 2017 10:18 pm    Post subject: Reply with quote

Roman thanks for your reply.

I have also a laptop with a dualcore Intel cpu. If possible it uses the packages that are created at my quadcore. It saves a lot of compile time.
Portage is quite smart and finds out if packages are compiled with the same flags and if not, they will be compiled at the system itself. That is ok, but the most packages install just fine as binary packages.
The reason why I can't use march=native yet, is that I don't want programs to install for a lesser cpu if they contain code that is not ok for that cpu.
march=native selects the cpu that gcc thinks the system has. So if there is i7 code produced that will not run on my quad core, I have a problem. That is why I will use march=core2 on all machines perhaps.

But my question was: will the proper march produce faster code?
If the benefit is minimal, I will use march=core2 so the packages can be installed at both other computers.
If march=native will produce much faster code, I will use that because that will be the computer I use the most. Then the quad core has to do its own updating and build packages that I can use for my laptop.

Yeah crosscompiling.. I will look at it if i7 code is a lot faster then core2 code.
_________________
niemand is onbekwamer, dan een timmerman zonder hamer

Kees
Back to top
View user's profile Send private message
Ant P.
Advocate
Advocate


Joined: 18 Apr 2009
Posts: 3840
Location: UK

PostPosted: Thu Jan 12, 2017 12:47 am    Post subject: Reply with quote

Use the exact flags for each CPU, which you can get by doing this:
Code:
echo $(
    gcc -v -march=native -x c /dev/null 2>&1 \
        | fgrep -- '-march' \
        | egrep -o ' (-m|--param )\S+' \
        | fgrep -v -- '-mno-'
)

This is exactly the same thing as -march=native, but saves gcc having to recalculate it on every invocation and lets you run distcc without issues.
_________________
Quantity is not quality.
overlay | runit-scripts
Back to top
View user's profile Send private message
houtworm
Guru
Guru


Joined: 08 Mar 2003
Posts: 329
Location: Den Haag, Netherlands

PostPosted: Thu Jan 12, 2017 8:25 am    Post subject: Reply with quote

Thanks Ant P.
For this computer it is march=core2 and fot the other march=sandybridge, so that was ok :-)
I will change/edit the other parameters this evening when I am home from work.
_________________
niemand is onbekwamer, dan een timmerman zonder hamer

Kees
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