Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Cflags help
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
cowboy0629
Tux's lil' helper
Tux's lil' helper


Joined: 11 May 2016
Posts: 105
Location: Kawartha Lakes, Ontario

PostPosted: Sun Mar 01, 2020 3:13 am    Post subject: Cflags help Reply with quote

Hi all I am working on getting distcc working on a few of my systems

I have ran into something I have never worried about before for instance my CFLAGS in my make.conf

my question is how do I figure out what my cpu is ie (sandybridge, ivybridge) and what do I set the CFLAGS too when I can't use the native flag with distcc

The First Computer is a Dell CORE i5 vPRO

Code:
$ lscpu
Architecture:        x86_64
CPU op-mode(s):      32-bit, 64-bit
Byte Order:          Little Endian
Address sizes:       36 bits physical, 48 bits virtual
CPU(s):              4
On-line CPU(s) list: 0-3
Thread(s) per core:  2
Core(s) per socket:  2
Socket(s):           1
NUMA node(s):        1
Vendor ID:           GenuineIntel
CPU family:          6
Model:               58
Model name:          Intel(R) Core(TM) i5-3320M CPU @ 2.60GHz
Stepping:            9
CPU MHz:             1239.818
CPU max MHz:         3300.0000
CPU min MHz:         1200.0000
BogoMIPS:            5182.69
Virtualization:      VT-x
L1d cache:           32K
L1i cache:           32K
L2 cache:            256K
L3 cache:            3072K
NUMA node0 CPU(s):   0-3
Flags:               fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht
tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm cpuid_fault epb pti ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid fsgsbase smep erms xsaveopt dtherm ida arat pln
pts flush_l1d


thanks in advance
Mike
Back to top
View user's profile Send private message
Goverp
Advocate
Advocate


Joined: 07 Mar 2007
Posts: 2014

PostPosted: Sun Mar 01, 2020 10:06 am    Post subject: Reply with quote

Run
Code:
gcc =march=native -Q --help=target

on your target machine.
_________________
Greybeard
Back to top
View user's profile Send private message
cowboy0629
Tux's lil' helper
Tux's lil' helper


Joined: 11 May 2016
Posts: 105
Location: Kawartha Lakes, Ontario

PostPosted: Sun Mar 01, 2020 5:58 pm    Post subject: Reply with quote

Goverp

Hi Im on a complete stand still at the moment does not seem that they are talking to each other when I try to emerge something..

the server is a 2x XEON 8 Core machine

but when I run distccmon-gui or distccmon-text n10 nothing appears in either program



next what file do I put this in

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



thanks
Mike
Back to top
View user's profile Send private message
ali3nx
l33t
l33t


Joined: 21 Sep 2003
Posts: 722
Location: Winnipeg, Canada

PostPosted: Sun Mar 01, 2020 6:31 pm    Post subject: Reply with quote

cowboy0629 wrote:

next what file do I put this in

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



thanks
Mike


If you type that command in bash shell it will print the results revealing the recommended cpu clfags for you to review. Personally i prefer this one but either command will accomplish the desired results.

https://wiki.gentoo.org/wiki/GCC_optimization#-march

Code:
gcc -### -march=native /usr/include/stdlib.h


cowboy0629 wrote:
but when I run distccmon-gui or distccmon-text n10 nothing appears in either program


if your using systemd the services configuration file for distccd is located in an enitrely different file than when distccd is used with openrc.

Code:
/etc/systemd/system/distccd.service.d/00gentoo.conf


distccd will also spam system logs so if using distccd with systemd or openrc you can tail the system logfiles or journal using systemd journalctl to view the distcc log entries.
_________________
Compiling Gentoo since version 1.4
Thousands of Gentoo Installs Completed
Emerged on every continent but Antarctica
Compile long and Prosper!
Back to top
View user's profile Send private message
Goverp
Advocate
Advocate


Joined: 07 Mar 2007
Posts: 2014

PostPosted: Mon Mar 02, 2020 8:09 am    Post subject: Reply with quote

More to the point, it prints out the value of "-march" that gcc thinks is right for the CPU running the command.
_________________
Greybeard
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54317
Location: 56N 3W

PostPosted: Mon Mar 02, 2020 8:19 am    Post subject: Reply with quote

cowboy0629,

I'm a bit late to this party but I like this Stack Overflow topic.

Here, I get
Code:
$ gcc -### -E - -march=native 2>&1 | sed -r '/cc1/!d;s/(")|(^.* - )|( -mno-[^\ ]+)//g'
-march=amdfam10 -mmmx -m3dnow -msse -msse2 -msse3 -msse4a -mcx16 -msahf -mpopcnt -mabm -mlzcnt -mprfchw -mfxsr --param l1-cache-size=64 --param l1-cache-line-size=64 --param l2-cache-size=512 -mtune=amdfam10

So dumping the output of that command into CFLAGS is right for me.

Take care when posting your emerge --info to explain where it came from.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo 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