Originally Posted by Quasimojo
I recall setting the number of compile threads when I was playing with Gentoo, but how do I go about that, say, in Fedora 17? Probably similar to about any other distro, but I'm still learning the Linux ropes.
The "j" or jobs flag for make is what you are looking for. Since you are in Fedora 17, you will be using `make -j5` for your i5, (4+1) I don't remember how to do it with cmake.
In gentoo you configured portage's makeflags to "j(x)" and in Arch you would set your makepkg.conf to have makeflags as well. You can set global default makeflags, but this practice is generally not reccomended as some makeflags (even the jobs flag) can produce broken executables under certain circumstances.
That said, I will go on a limb and say you will never run into the "j" flag breaking anything; you can use ~/.bashrc someone correct me if I'm wrong please.
and add MAKEFLAGS="-j5" which should globally change the make flags
You can enable processor specific optimizations for GCC with:
You make want to echo the CFLAGS and CXXFLAGS variables before setting them to the above as flags like O2 and pipe may be enabled already, in which case you may want to copy them over; you can undo the override by commenting out or removing the lines and rebooting, as they are probably set elsewhere as well, and ~/.bashrc will just override them when you login to this user.The corei7-avx is for you because you have a post Sandy Bridge processor with AVX extensions.
I wrongfully suggested this; GCC4.2 added dynamic processor detection via -march=native, which enables -march and -mtune as -m(is) flag detection at build time, when appropriate.Edited by Xaero252 - 11/12/12 at 8:26pm