View previous topic :: View next topic |
Author |
Message |
lea0014 n00b
Joined: 09 Mar 2010 Posts: 24
|
Posted: Wed Aug 14, 2013 6:08 pm Post subject: What CFLAGS should i use? |
|
|
Hi there, i'm installing a new box with an AMD FX-6300 processor. Of course, im following the handbook to install the system, but when i have to set the CFLAGS variable, the handbook is not handy at all. So, as far i could see, -march=native is what should i take.
Here comes the deal; i want to run a distcc service at the FX system, and the wiki says:
Quote: | Starting with GCC 4.3.0, the compiler supports the -march=native switch which turns on CPU autodetection and optimizations that are worth being enabled on the processor the GCC is running at. This is a problem with distcc as it allows mixing of code optimized for different processors (like AMD Athlon and Intel Pentium). Don't use -march=native or -mtune=native in your CFLAGS or CXXFLAGS when compiling with distcc . |
Help! (probably i need some explanations about distcc?)
Thanks. |
|
Back to top |
|
|
BradN Advocate
Joined: 19 Apr 2002 Posts: 2391 Location: Wisconsin (USA)
|
Posted: Wed Aug 14, 2013 7:21 pm Post subject: |
|
|
I believe distcc uses the target system's -march setting when doing remote compile. So, it is okay to use -march=native on the big machine, but you cannot use it on the smaller target machines (assuming lesser instruction set) as that would tell distcc to build binaries with instructions they cannot use (since it is gcc itself deciding what 'native' means, not portage).
If you do "man gcc" you will find the possible choices for -march= on x86 somewhere around line 9000 or so. |
|
Back to top |
|
|
Hu Moderator
Joined: 06 Mar 2007 Posts: 21624
|
Posted: Wed Aug 14, 2013 8:22 pm Post subject: |
|
|
Last time I checked, distcc uses the source system's -march setting when using -march=native by way of refusing to distribute the work to remote nodes if the arguments include -march=native. |
|
Back to top |
|
|
Ant P. Watchman
Joined: 18 Apr 2009 Posts: 6920
|
Posted: Fri Aug 16, 2013 2:43 am Post subject: |
|
|
Here's a script I have that outputs the actual flags -march=native expands to; I use this for distcc on my own machines:
Code: | #!/bin/bash
echo $(
gcc -v -march=native -x c /dev/null 2>&1 | \
grep -- '-march' | \
egrep -o -- '-+(m|param )[-_=.a-zA-Z0-9]+' | \
sort -u
) |
|
|
Back to top |
|
|
CrUpf n00b
Joined: 13 Dec 2008 Posts: 12 Location: /home/crupf
|
|
Back to top |
|
|
Schnulli Guru
Joined: 25 Jun 2010 Posts: 320 Location: Bremen DE
|
Posted: Sat Aug 31, 2013 9:57 pm Post subject: |
|
|
you shouldnt use march=native with gcc 4.3 because its only supported above gcc >4.6 its dangerous then ..... |
|
Back to top |
|
|
|