TITLE: KDE Installation LFS VERSION: any AUTHOR: Bruce Dubbs SYNOPSIS: This hint provides details about how to install KDE and its support libraries. HINT: Version 1.3-July 29, 2001 Changes include discussion of autoconf, FHS, and optimization issues. Version 1.2-June 8, 2001 Changes include making the system at -O3 optimization and omitting libungif which is not needed. There are also several typographical errors fixed. This hint is an expansion to the orginal KDE hint by Simon Perreault . Thanks also go to Tio Hiap Ho , Benjamin Ellis , Filippo Negroni , Greg Turpin and Ulf Gruene for suggestions on how to make this hint better. This hint was originally written on June 2, 2001. KDE is a relatively straight forward aplication to install, but there are a lot of libraries and support functions to install before the actual KDE programs are installed. I am assuming you are building KDE on a LinuxFromScratch system. Prototyping this hint used the book LFS 3.0-pre3 as a base system, but any LFS system should work. I am assuming that all install procedures are done as root. Before KDE is installed, you must install xfree86. The which program is also useful. If you haven't already sone so, install those now. There are separate hints X11.txt and Which.txt that can guide you in that task. Now is the time to install the libraries. For all of the libraries, I suggest setting a CFLAGS environment variable to the optimization you would like. I used the moderate setting: export CFLAGS='-march=i686 -O3' Change yours to reflect your hardware. Optimization issues. There have been some reports that compilation of KDE is not successful with some optimizations. If you have trouble, try compiling with no optimizations at all to isolate the problem and then put back optimizations as desired. This hint was compiled with gcc-2.95.2.1 and glibc-2.2.1. Errors have been reported using optimization with other versions of these tools, expecially gcc-3.0. autoconf issues. Normally autoconf is only needed if new makefiles are created. Some errors have been reported using autoconf-2.50. If you run into this problem, try installing autoconf-2.13. autoconf-2.52 has also been reported to work correctly. I am, in general, going to install most libraries in /usr/lib. The default /usr/local/lib is for experimental libraries and these are pretty solid. I am also presenting my make times for you to judge the time it takes to make each part of the system. I have a Pentium III 667MHz with 128M ram. The libraries necessary are: libz, libjpeg, libpng, liblcms, libmng, libtiff, libqt, and libqutil. 1. libz The version as of this writing is zlib-1.1.3 and it can be found at www.info-zip.org/pub/zlib zlib is a public domain compression/decompression library. Install by: ./configure --shared --prefix=/usr && make && make install ./configure && make && make install This will make both the shared and static libraries and place them in /usr/lib Make time 5.3 sec. 2. libjpeg This library allows compression of image files based on the Joint Photographic Experts Group standard. It is a "lossy" compression algorithm. Find information at www.ijg.org and the code at ftp.uu.net/graphics/jpeg. The current version is jpegsrc.v6b.tar.gz Install with: ./configure --enable-shared --enable-static --prefix=/usr && \ make && \ make install This makes both the dynamic and static libraries and installs them in /usr/lib. Make time 45.4 sec. 3. libpng This library implements the Portable Network Graphics system that is a replacement for gif. This library depends on zlib, so make sure you installed that in step 1 above. Find the code at http://www.libpng.org/pub/png. The current version is libpng-1.0.9.tar.gz Install with: cp scripts/makefile.linux Makefile You may need to edit the makefile to change the ZLIBLIB and ZLIBINC variables so they point to the zlib libraries and include files directly. In my system I changed them to: # Where the zlib library and include files are located #ZLIBLIB=/usr/local/lib #ZLIBINC=/usr/local/include ZLIBLIB=../zlib-1.1.3 ZLIBINC=../zlib-1.1.3 Also change prefix=/usr/local to prefix=/usr and add any optimization you need to change: CFLAGS=-I$(ZLIBINC) -Wall -O3 -funroll-loops \ $(ALIGN) # $(WARNMORE) -g -DPNG_DEBUG=5 to something like: CFLAGS=-I$(ZLIBINC) -Wall -O3 -funroll-loops \ $(ALIGN) -march=i686 If you installed zlib according to the instructions above, the defailts should point to the right files, so you may not need to edit the makefile, but I had a slightly different installation Now run: make && make install Both the static and dynamic libraries are created and installed in /usr/lib. Make time 31.1 sec. 4. liblcms This library provides the Color Management System. Find the source at www.littlecms.com/downloads.htm The current version is lcms-1.07.tar.gz I updated the compile line in install.gcc to: gcc -O3 -march=i686 -c *.c The build is quite simple: ./install.gcc The static library is installed in /usr/lib and no dynamic library is created. My compile time was 6.1 sec. When I ran the full script, I got an error in the line: gcc -g -O2 testcms.c /usr/lib/liblcms.a -o testcms I fixed that problem by adding -lm to the line to include math libraries. The error, however, does not affect the library installation. It is only a check of the library compilation. If you want a dynamic lcms library after you make the static library, use: cd src gcc -o liblcms.so.1.07 -shared cmscnvrt.o cmserr.o cmsgamma.o cmsgmt.o \ cmsintrp.o cmsio1.o cmslut.o cmsmatsh.o cmsmtrx.o cmspack.o cmspcs.o \ cmswtpnt.o cmsxform.o cp liblcms.so.1.07 /usr/lib cd /usr/lib ln -s liblcms.so.1.07 liblcms.so.1 ln -s liblcms.so.1 libcms.so 5. libmng This library provides Multiple image Network Graphics. These animations replace animated gifs. The library is dependent on libz, libjpeg, and liblcms which we have already installed. The source is found at www.libmng.com/downloadpublic/html The curent file is libmng-1.0.1.tar.gz Install with: ./configure --with-zlib --with-jpeg --with-lcms --prefix=/usr && make && make install This builds both dynamic and static libraries and installs them in /usr/lib. My make time was 47.1 sec. 6. libtiff This library supports the Tag Image File Format. Information on this format is at www.libtiff.org The source is found at ftp.remotesensing.org/pub/libtiff The current file is tiff-v3.5.5.tar.gz Edit the file config.site and change the install library directory to /usr/lib. I also deleted the 'local' part from the include and man directives. Don't forget to uncomment the lines. There are a few bugs in the Linux portions of the install scripts. In 'configure', look around line 1158 for: *-linux*) if [ -r /lib/libc.so.6 || -r /lib/libc.so.5 ]; then DSOSUF=so.${DIST_MAJOR} DSOSUF_VERSION=${DSOSUF}.${DIST_MINOR}${DIST_TYPE} LIBCOPTS='-fPIC' DSOOPTS='-shared' DSO=LINUX fi ;; Change the || characters to -o and comment out the line starting with DSOSUF_VERSION and add a new line to change it as shown below: *-linux*) if [ -r /lib/libc.so.6 -o -r /lib/libc.so.5 ]; then DSOSUF=so.${DIST_MAJOR} #DSOSUF_VERSION=${DSOSUF}.${DIST_MINOR}.${DIST_ALPHA} DSOSUF_VERSION=${DSOSUF}.${DIST_MINOR}${DIST_TYPE} LIBCOPTS='-fPIC' DSOOPTS='-shared' DSO=LINUX fi ;; The installation code for Linux is not correct either. In 'libtiff/Makefile.in' look about line 327 for the following code: installDSO: @DSO@dso if [ @DSOSUF_VERSION@ != @DSOSUF@ ]; then \ ${INSTALL} -idb tiff.sw.tools -m 555 -F @DIR_LIB@ \ -O libtiff.@DSOSUF_VERSION@; \ ${INSTALL} -idb tiff.sw.tools -F @DIR_LIB@ \ -ln libtiff.@DSOSUF_VERSION@ -O libtiff.@DSOSUF@; \ else \ ${INSTALL} -idb tiff.sw.tools -m 555 -F @DIR_LIB@ \ -O libtiff.@DSOSUF@; \ fi We need to change the '-ln' in the sixth line above to '-lns' in order for the system to make a symbolic link. We also need to add two new lines as shown below to install a libtiff.so symboloc link. installDSO: @DSO@dso if [ @DSOSUF_VERSION@ != @DSOSUF@ ]; then \ ${INSTALL} -idb tiff.sw.tools -m 555 -F @DIR_LIB@ \ -O libtiff.@DSOSUF_VERSION@; \ ${INSTALL} -idb tiff.sw.tools -F @DIR_LIB@ \ -lns libtiff.@DSOSUF_VERSION@ -O libtiff.@DSOSUF@; \ ${INSTALL} -idb tiff.sw.tools -F @DIR_LIB@ \ -lns libtiff.@DSOSUF@ -O libtiff.so; \ else \ ${INSTALL} -idb tiff.sw.tools -m 555 -F @DIR_LIB@ \ -O libtiff.@DSOSUF@; \ fi Finally we can preceed with: ./configure --noninteractive The make script does not use the CFLAGS environment variable, so we add any optimization to the make line. We make COPTS null to avoid inserting debug code. make COPTS='' OPTIMIZER="$CFLAGS" && make install This builds both dynamic and static libraries and installs them in /usr/lib. My build time was 27.5 sec. 7. libqt and libqutil These are the famous (or infamous) qt graphics libraries. Iformation is found at www.trolltech.com The source is found at ftp.trolltech.com/qt/source The current edition is qt-x11-2.3.0.tar.gz One suggestion at this point was change/add some optimization flags as export CFLAGS='-march=i686 -O3 -fomit-frame-pointer' Install instructions are found at http://doc.trolltech.com/install-x11.html and reproduced here (with some modification) The following instructions use the default qt procedures and are not in accordance with the Filesystem Hierrarchy Standard (FHS). To be compatible with that standard, the file would have to be in /usr/src/qt or /opt/qt. Unfortunately there is no 'make install' procedure for qt and the procedure below is the easiest way to get the executable, library, and header files into a location that KDE can easily find them. Unpack the archive into /usr/local: cd /usr/local tar zxf qt-x11-version.tar.gz This creates the directory /usr/local/qt-version containing the files from the main archive. Rename qt-version to qt (or make a symlink): mv qt-x11-version qt Set some environment variables in the file .bash_profile in your home directory. QTDIR=/usr/local/qt # To locate the moc program and other Qt tools PATH=$PATH:$QTDIR/bin # Set up for KDE now PATH=$PATH:/usr/local/kde/bin # For the shared Qt library LD_LIBRARY_PATH=$QTDIR/lib export QTDIR PATH LD_LIBRARY_PATH Note: Afterwards you might want to add the library directory to /etc/ld.so.conf and delete the LD_LIBRARY_PATH variable. Edit /etc/man.conf and add: MANPATH /usr/local/qt/doc/man Now activate the settings with: source ~/.bash_profile Finally compile the qt libraries. The -accel-mach64 is only used if you have a supported video card. USe ./configure --help to get all the options. ./configure -system-zlib -system-libpng -system-mng -system-jpeg \ -xft -gif It has been reported that additional options will decrease the size of the qt libraries. You can try -no-g++-exceptions with ./configure. To make the libraries with the appropriate optimization, I used: make SYSCONF_CFLAGS='-pipe -O3 -march=i686' \ SYSCONF_CXXFLAGS='-pipe -O3 -march=i686' Qt is now installed as dynamic libraries in /usr/local/qt/lib. Make time 32m 12.4s. ------------------------------------------------------------------------------ 8. If you want SSL support (for instance for secure web sites in konqueror), make sure you install openssl, version 0.9.5a, 0.9.6 or later. See the openssh.txt hint for installation. ------------------------------------------------------------------------------ 9. For Netscape-plugins support in konqueror, make sure to install lesstif. Information on lesstif can be found at www.lesstif.org The sources is at ftp://ftp.hungry.com/pub/hungry/lesstif/srcdist/ The latest version is lesstif-0.92.32.tar.bz2 >From the FAQ: What is LessTif? LessTif is a clone of the Motif® toolkit. Currently LessTif is partially implemented with most of the API in place. Saying this a lot of the internal functionality is still missing. Compatibility can have several degrees, the ultimate one being binary compatibility. This is the one we're aiming for. This can be tested even today on most platforms on which shared libraries are supported : if you also have Motif® shared libraries, you can choose which library to use by setting an environment variable such as LD_LIBRARY_PATH prior to executing an application. The primary objectives have been to develop the widget code of the LessTif Toolkit. Intermittently, the window manager (mwm) and the combination of UIL compiler and libMrm are being worked on. Install by: ./configure && make && make install This creates a dynamic library in /usr/local/lib. ------------------------------------------------------------------------------ It is now time to install KDE proper (finally). Note: See the discussion of autoconf in the introduction. The curent version is KDE 2.1.1 and is separated into several files: kdeadmin-2.1.1.tar.bz2 kdemultimedia-2.1.1.tar.bz2 kdeutils-2.1.1.tar.bz2 kdebase-2.1.1.tar.bz2 kdenetwork-2.1.1.tar.bz2 kdevelop-1.4.1.tar.bz2 kdebindings-2.1.1.tar.bz2 kdepim-2.1.1.tar.bz2 kdoc-2.1.1.tar.bz2 kdegames-2.1.1.tar.bz2 kdesdk-2.1.1.tar.bz2 koffice-2.0.1.tar.bz2 kdegraphics-2.1.1.tar.bz2 kdesupport-2.1.tar.bz2 kdelibs-2.1.2.tar.bz2 kdetoys-2.1.1.tar.bz2 Note that kdelibs is version 2.1.2. Version 2.2 of KDE is currently in beta, however I have not addressed the beta version in this hint. Find the files at: http://download.sourceforge.net/mirrors/kde/stable/2.1.2/distribution/src/ and http://download.sourceforge.net/mirrors/kde/stable/2.1.1/distribution/tar/\ generic/src/ OR check the mirror sites described at: http://www.kde.org/mirrors.html#http ------------------------------------------------------------------------------ Installation of the source .tar.gz files Since KDE is written mostly in C++, you can change the optimization with the environment variable CXXFLAGS as explained in the intro. If you want smething different from teh default, be sure to export it. The source .tgz package installs into /usr/local/kde by default. You can override this setting by using the --prefix option of the configure script. LFS would normally call for this package to be in either /usr/src or the /opt hierrarchy (e.g. /opt/kde) Unpack the packages with tar xvzf packagename.tar.gz Change directory to the package directory: cd packagename Configure the package: ./configure --disable-debug && make && make install Note: some packages (notably kdebase) have special configuration options that might be applicable to your installation. Type ./configure --help to see the available options. You can also try the --enable-final ./configure option to reduce file size, but that option is listed as "experimental -- needs lots of memory" For kdebase, I used: ./configure --disable-debug --with-shadow --with-ssl --with-motif And for kdelibs, I used: ./configure --disable-debug --with-ssl For a better regular-expressions support in Javascript, install libpcre. There are additional modules that are compiled if the required library is present, but they aren't critical to run KDE. For instance, libldap for the LDAP kioslave, and cdparanoia for the audiocd kioslave. You don't need them unless you plan to play with those. These KDE install instructions are a summary of the detailed KDE install instriuctions found at http://www.kde.org/documentation/faq/install.html ------------------------------------------------------------------------------ My compile times (using -O3, not including configure/install times) are listed in parentheses. kdeadmin-2.1.1.tar.bz2 (15m2s) kdemultimedia-2.1.1.tar.bz2 (27m29s) kdeutils-2.1.1.tar.bz2 (15m5s) kdebase-2.1.1.tar.bz2 (53m59s) kdenetwork-2.1.1.tar.bz2 (24m59s) kdevelop-1.4.1.tar.bz2 (not built) kdebindings-2.1.1.tar.bz2 (not built - requires python) kdepim-2.1.1.tar.bz2 (8m58s) kdoc-2.1.1.tar.bz2 (18m2s) kdegames-2.1.1.tar.bz2 (17m46s) kdesdk-2.1.1.tar.bz2 (not built) koffice-2.0.1.tar.bz2 (38m40s) kdegraphics-2.1.1.tar.bz2 (12m2s) kdesupport-2.1.tar.bz (45s) kdelibs-2.1.2.tar.bz2 (42m3s) kdetoys-2.1.1.tar.bz2 (2m22s) ------------------------------------------------------------------------------ After compiling and installing the KDE sources there are two steps left. Create the ~.xinitrc file: echo "exec startkde" > ~/.xinitrc Later you might want to make a more sophisticated .xinitrc file. Check a standard distro for examples. Now start KDE with: startx Enjoy!