Optimization of Slackware Packages
Hi Forum
This is my setup : I have these two Slackware boxes call it David and Goliath... David is a tiny machine I use to experiment with OSes I do not know... Crappy ATI Graphics card, slow cpu, 1GB ram... Goliath is powerful machine, Latest Nvidia gForce, Intel Quadcore CPU, 16 GB ram... So I have compiled from source lots of packages which I have installed w/ src2pkg or sbopkg in "David"... "David" is running ok, fast snappier than with previous OSes... In case I find out I can build all my work apps from source in "David" I plan to switch to "Goliath"... My Question is... : Are my binary Slackware packages built from source in "David" still optimized to run in "Goliath"... assuming the hosting OS will be the same, of course... despite all the difference in hardware specs...? Or Should I best rebuild them on "Goliath"...? BRGDS Alex |
If you are using src2pkg or the default SlackBuilds, then the most the packages will be built for is i686. The packages are not actually being optimized for either machine, they are being built for generic x86 processors. Rebuilding them on the faster machine wouldn't do anything, the only difference would be that they will take less time to build.
If you want to optimize a build for a specific processor, you need to do that manually by supplying the appropriate GCC options in the SlackBuild. |
Quote:
Code:
if [ "$ARCH" = "i486" ]; then Quote:
|
Quote:
Also, that code does not use uname, rather it is specified with the $ARCH variable set at the top of the Slackbuild. That is an intentional design so you CAN build non-optimized code, which is what you have to do if you intend on distributing the binaries. |
Yeah, by default src2pkg sticks with the same flags as used for original slackware packages where you have: -march=i486 -mtune=i686
That makes your packages as generic as they can be. If you want to change that, you can set the values in your src2pkg.conf file like this: MARCH_FLAG=value CPU_FLAG=value |
Quote:
Yours in confusion, |
Quote:
Code:
# ARCH="x86_64" ./package.SlackBuild The only time I've seen uname used is when the current running kernel is being used in the slackbuild. Although, there could be other uses for uname. Code:
KERNELVERSION=${KERNELVERSION:-$(uname -r)} |
Take notice that those compiler optimizations won't make your machine suddenly fly, I mean that the difference won't be very big.
|
Quote:
Warm regards, |
If you do want to optimize your packages, there's a program called Acovea that's supposed to give you the best CFLAGS to compile a source file with.
I've never used it myself, but it looks interesting. http://www.coyotegulch.com/products/acovea/ |
All times are GMT -5. The time now is 05:04 AM. |