
If you are owner of a Pentium, an AMD K6, Athlon or Athlon-XP CPU, you might want to use compiler optimizations to compile your version of Kwave that is running some percents faster. The gain in speed will be up to 30% on some systems, whereas the functions dealing with signal manipulation and all functions that do complex time-frequency operations (like FFT and Sonagram) will profit most from it.
You do not need to understand much about programming for using an optimized compiler to compile Kwave, but maybe you will need some time to get the compiler itself working and installed.
You can easily compile the RPM package optimized for Athlon,
Athlon-XP, Pentium and Pentium Pro
(and some other CPUs) by using some defines in your rpmrc file.
You can either modify your system's rpmrc
file in /usr/lib/rpm or the
.rpmrc file in your home directory.
There you can specify option lines like these:
(I found those nice tricks at http://www.keywarrior.net/duesti/rpmopt.en.html. Thanks to Matthias Düsterhöft!).optflags: i586 -O2 -march=pentium -DNDEBUG -fomit-frame-pointeroptflags: i686 -O2 -march=pentiumpro -DNDEBUG -fomit-frame-pointeroptflags: athlon -O2 -march=athlon -DNDEBUG -fomit-frame-pointeroptflags: k6 -O3 -march=k6 -DNDEBUG -fomit-frame-pointeroptflags: k7 -O3 -march=athlon-xp -DNDEBUG -fomit-frame-pointer
This means that on an k7 architecture the
rpm package will be compiled using
-O3 -march=athlon-xp -DNDEBUG
-fomit-frame-pointer
as compiler option and so
on, you might extend or adapt these to your own needs.
The settings apply to all of the sections before in all
places where rpmbuild -ta is used or where a binary
RPM is to be created out of a source rpm using
rpmbuild --rebuild.
If rpm refuses to install your package because it seems not to fit to your computer's architecture, you can normally just install an optimized package by specifying the additional parameter --ignorearch and don't care.
The invocation of the compiler is quite simple. It normally
is sufficient to set the environment variables
CFLAGS and CXXFLAGS
in the correct way and then compile as usual. For the best settings
please consult the documentation or homepage of the corresponding
compiler.
If you build Kwave from a source tree (unpacked tar.gz or from SVN) the flags need to be specidied before the call. For example:
%CFLAGS="-O4 -march=athlon-xp -mcpu=athlon-xp -pipe -fomit-frame-pointer" \ CXXFLAGS="-O4 -march=athlon-xp -mcpu=athlon-xp -pipe -fomit-frame-pointer" \ cmake[source directory]
If you re-build Kwave from a source rpm package, please follow the instruction in the previous section.
Would you like to make a comment or contribute an update to this page?
Send feedback to the KDE Docs Team