You are not logged in.
Pages: 1
I just installed Arch Linux a few days ago and now I'm trying to set up AUR. I read in the AUR article in the wiki that should probably optimise the the makepkg.conf with CFLAGS and CXXFLAGS for faster compiling and more optimised code. I know some of the values for the flags but I just don't know which flags I should use. Also I don't know if I need remove any flags and if I need to uncomment "MAKEFLAGS". Can anyone help me?
Offline
Learn to walk before trying to run.
Unless you're very familair with CFLAGS & CXXFLAGS , changing them may break things in all kinds of unexpected ways .
If your system has more then 1 processor core, uncommenting the MAKEFLAGS line and setting a suitable number for -j does help a lot.
While there are differing opinions about how that number should be calculated for best results, the most common formuale for it is :
number of cores + 1
My system has 8 cores , so i use -j9 .
Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.
clean chroot building not flexible enough ?
Try clean chroot manager by graysky
Offline
Learn to walk before trying to run.
Unless you're very familair with CFLAGS & CXXFLAGS , changing them may break things in all kinds of unexpected ways .
If your system has more then 1 processor core, uncommenting the MAKEFLAGS line and setting a suitable number for -j does help a lot.
While there are differing opinions about how that number should be calculated for best results, the most common formuale for it is :
number of cores + 1
My system has 8 cores , so i use -j9 .
Would it be safe if I set MAKEHOST=-j5 (Im on a quad core) and set -march=native and removed -mtune or would require some other flag changes in order to not break anything and I should just leave everything other than MAKEHOST?
Offline
That wiki page may need an update (or an undoing of an editor who is more eager than informed).
There is absolutely no need to change anything in makepkg.conf for normal use. The default settings are very good.
They are there so if you really want to, you can tweak a lot of things - but again, this is not needed/expected/whatever.
If you don't know what flags you want to add/remove/change, then don't change any. If and when you learn about these flags and decide you want one, *then* add it.
But yes, your edits seem good and that's what I do (-march=native and remove -mtune). But keep in mind, if you do that, the packages you build on your system may not work on other systems - so you can't build once and move it to a new computer. But as this is rare, march=native is good for most users.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
MAKEFLAGS="-j5"should work fine for your system.
removing -mtune and using -march=native is safe, but there are some caveats :
- packages built with -march=native won't run on other processor families .
example :
you need to build a package that is intentend to run on a netbook with an Intel atom proc.
The netbook is slow, so you decide to build the pacakge on your fast system with an i7 processor and SSDs.
If the i7 system uses -march=native , the package you build won't run on the netbook.
- only packages you build yourself will benefit from -march=native .
everything in official repos is build with -march=x86_64 -mtune=generic , so official kernel , X , firefox, KDE , gnome etc will not benfit from it.
- it's unclear how big the benefit of using native over x86_64 in reality is.
For specific programs that use capabilities not provided by -march=x86_64 it may be worth it.
However, those will probably be low in number.
For those few cases, you can use the options array (see man PKGBUILD) in the PKGBUILD to override the flags set in makepkg.conf for just those programs.
Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.
clean chroot building not flexible enough ?
Try clean chroot manager by graysky
Offline
HimTortons:
There is no magic switches you can add to C[XX]FLAGS that will make your software better. If there would be, they would already be set by the default.
Optimization tweaks are a subtle topic that strongly depends on a particular piece of software. What works for one thing, doesn't work or even make things much worse for other. Most often a comprehensive profiler output is needed and you wont obtain one during a makepkg run.
It's also not easy to say what "better" mean. You can easily squeeze some speed out of code by disabling stack protector and fortified source. But will this make the compiled program really better? Definetly no. You can always use aggressive optimization flags and pretty soon you'll find out programs start to behave strangely — the authors rarely write portable, standard–compliant code, or even simply valid and logically coherent, which is the prerequisite for using these options.
It's really not that simple game. Leave it to the developers of a specific package. They know their software the best. And if you believe you know better, join the project and fix the issue a the source.
Offline
Pages: 1