You are not logged in.
Pages: 1
I remember reading something in the manual where it said to perform a specific command to recompile everything if you changed CFlags, can anyone help me out here?
Thanks.
Offline
what processor do you have and what CFlags are you using? I doubt you wanna go through the hassel of your proposal.
Offline
CHOST="i686-pc-linux-gnu"
CFLAGS="-march=opteron -O2 -pipe"
CXXFLAGS="${CFLAGS}"
Offline
Welcome to the forums.
Arch is already optimized, so changing your CFLAGS isn't necessary for most things. I have this is makepkg.conf:
CFLAGS="-march=native -mtune=native -O2 -pipe"
CXXFLAGS="-march=native -mtune=native -O2 -pipe"
The 'native' switch lets the compiler select your processor so you don't have to know the exact switch. It does the same thing that you posted above transparently.
Last edited by skottish (2008-08-02 00:55:08)
Offline
if you have smp processor
CFLAGS="-march=native -mtune=native -O2 -pipe"
CXXFLAGS="-march=native -mtune=native -O2 -pipe"
#-- Make Flags: change this for DistCC/SMP systems
MAKEFLAGS="-j3"
Offline
if you have smp processor
CFLAGS="-march=native -mtune=native -O2 -pipe" CXXFLAGS="-march=native -mtune=native -O2 -pipe" #-- Make Flags: change this for DistCC/SMP systems MAKEFLAGS="-j3"
After I do the makeflags, should I still do a world rebuild? And if so, how?
Offline
rooloo wrote:if you have smp processor
CFLAGS="-march=native -mtune=native -O2 -pipe" CXXFLAGS="-march=native -mtune=native -O2 -pipe" #-- Make Flags: change this for DistCC/SMP systems MAKEFLAGS="-j3"
After I do the makeflags, should I still do a world rebuild? And if so, how?
There's something floating around here called makeworld. It's an utter and complete waste of time in my opinion. It will take you far longer to recompile your system than than any possible microscopic speed improvement that you might see. If you're really bent on doing it, you may as well install Gentoo.
Last edited by skottish (2008-08-02 02:28:31)
Offline
Thanks skottish =]
(Understood about the speed improvement, but if it happens overnight while I'm sleeping it doesn't really bother me and I like when I'm putting a computer to some use, lol.)
Offline
Thanks skottish =]
(Understood about the speed improvement, but if it happens overnight while I'm sleeping it doesn't really bother me and I like when I'm putting a computer to some use, lol.)
That's cool. You should do what you want to do. If you search around though, I think you'll find that just about everyone that's tried agrees with my position.
--EDIT--
I forgot to mention, if you do do it, the process will probably break sometimes due to missing libraries. There are quite a few packages here that have dependencies that are only necessary for the compiling phase (makedepends). Resolving those should be fairly straight forward as they come up.
--EDIT 2--
Oh yeah, if you're really itching for something to do with your computer at night, you could always join Arch's folding at home team. Who knows, maybe you'll help 'fold' the sequence that cures a certain form of cancer.
Last edited by skottish (2008-08-02 03:02:50)
Offline
rooloo wrote:if you have smp processor
CFLAGS="-march=native -mtune=native -O2 -pipe" CXXFLAGS="-march=native -mtune=native -O2 -pipe" #-- Make Flags: change this for DistCC/SMP systems MAKEFLAGS="-j3"
After I do the makeflags, should I still do a world rebuild? And if so, how?
absolutely not, because you won't be changing anything. The makeflags is just for speed improvements while compiling. there is no code optimization going on. You'd have to change the CFLAGS -02 to a -03, then you would be optimizing the code as I understand it.
Offline
Why do you want to recompile all your system with different CFLAGS ? Arch linux is already optimized by default.
The possibility of give CFLAGS to the compiler is here to be used when you rebuild a package with makepkg, which is usefull is there's some depencendies brake by an update or if you really want to use specific optimization for a few packages.
Arch linux isn't really designed to compile your whole system like this, and as a user said, maybe Gentoo is more what you look for. You'll need a lot of build depencies that will probably not make it easy to recompile all the packages.
I have used Gentoo for years and I can tell you that you will really don't see any difference if you'll rebuild with -O3, and you could have problems if you want to use more specifics flags.
The default -O2 used by arch is just fine.
You'd have to change the CFLAGS -02 to a -03, then you would be optimizing the code as I understand it.You'd have to change the CFLAGS -02 to a -03, then you would be optimizing the code as I understand it.
-O2 already optimize the code. -O3 just add more flags for optimization but this lead to bigger packages at the end (and a highest memory usage I think). So, bigger packages = more sollicited hard drive.... see my point ?
The GCC manual page about CGLAGS for more info :
http://gcc.gnu.org/onlinedocs/gcc-4.3.0 … ze-Options
Offline
Ah, okay, then what about the makeflags part. Is that just to use more processors during compilation? Should I leave it at j3 (it will work for all future packages?)
Offline
Ah, okay, then what about the makeflags part. Is that just to use more processors during compilation? Should I leave it at j3 (it will work for all future packages?)
the MAKEOPTS is for the the number of parallel compilations to speed up compilation time. I don't know much about multi-cpu systems but a general rule is to use the number of processors you have + 1. So for a dual processors system MAKEOPTS=-j3.
And yes it will work for all future package you will compile by yourself.
there's a manpage for the makepkg.conf
man makepkg.conf
Offline
Is there a reason you guys are specifying both -march and -mtune, or is it just because you can and it won't make a difference?
I ask because I only have -march=native. According to gcc man page, -march implies -mtune so I chose not to put -mtune in. I'd hate to think i've buggered something up here!
flack 2.0.6: menu-driven BASH script to easily tag FLAC files (AUR)
knock-once 1.2: BASH script to easily create/send one-time sequences for knockd (forum/AUR)
Offline
What you need is:
http://bbs.archlinux.org/viewtopic.php?id=48957
Offline
Why do you guys use -mtune?? READ!
Offline
Why do you guys use -mtune?? READ!
This is the case if you are using the -march flags. If you use -mtune instead without any -march option, your binaries are backward compatible down to i386, but the scheduling is optimized for your chosen architecture. CPUs are also backward compatible so if you update your system with a new CPU you can still use your old packages. There is one exception though; if your old CPU supports a feature, like AMD's 3dnow, that your new CPU doesn't. So if you have an athlon (-march=athlon) and upgrade to a pentium4 your old packages might not work. You can mix -march and -mtune if you, for example, would like to create binaries that would run on any i686 but are optimized for a pentium4. This would be accomplished by using -march=i686 and -mtune=pentium4
why? backwards compatibility. So I can build a x86_64 package on my amd machine and still have it usable on a intel pentium machine.
Last edited by rooloo (2008-08-02 13:58:02)
Offline
Army wrote:Why do you guys use -mtune?? READ!
why? backwards compatibility. So I can build a x86_64 package on my amd machine and still have it usable on a intel pentium machine.
I think Army was referring to the fact that people were using identical -march and -mtune values, when -march=foo implies -mtune=foo (so you don't need to specify -mtune).
flack 2.0.6: menu-driven BASH script to easily tag FLAC files (AUR)
knock-once 1.2: BASH script to easily create/send one-time sequences for knockd (forum/AUR)
Offline
Is there a reason you guys are specifying both -march and -mtune, or is it just because you can and it won't make a difference?
I ask because I only have -march=native. According to gcc man page, -march implies -mtune so I chose not to put -mtune in. I'd hate to think i've buggered something up here!
I ran across a web page many moons ago that suggested it. I haven't even thought about it since.
Offline
The funniest CFLAGS are the default Arch's ones :
CFLAGS="-march=i686 -mtune=generic -O2 -pipe"
No one seems to have a clue about what it really does.
The only cases explained in the docs are march only, mtune only, or a combination of march and mtune, but with a mtune *more specific* than march. For example -march=i686 -mtune=pentium4
pacman roulette : pacman -S $(pacman -Slq | LANG=C sort -R | head -n $((RANDOM % 10)))
Offline
The funniest CFLAGS are the default Arch's ones :
CFLAGS="-march=i686 -mtune=generic -O2 -pipe"No one seems to have a clue about what it really does.
The only cases explained in the docs are march only, mtune only, or a combination of march and mtune, but with a mtune *more specific* than march. For example -march=i686 -mtune=pentium4
march i686 is pretty obvious. mtune will create binaries either targeted for a specific processor (pentium4) or will create a generic binary for maximum compatibility over multiple processors. The target for specific processors will create smaller binaries, but may have compatibility problems (pentium4 may have slightly different instruction sets than K7). The target for generic processors will produce larger binaries but will have greater compatibility over different sub-families of processors.
Offline
Pages: 1