Compiling Scribus for the First Time
This guide is meant to be a user friendly, first timer's step by step guide to compiling Scribus. If you have never compiled a program before this is the guide for you. I once had the problems too. Linux documentation while it is usually good, sometimes assumes a certain level understanding of Linux, which not all new users have. (Everyone is a newbie at one time.) I have received some emails from users with packaging problems or compiling issues with Scribus. Moreover, with new "user-oriented" distributions like Lycoris, Lindows and Mandrake often do not include in their default installs all of the tools and libraries needed to compile programs properly.
"User friendly" is not meant as a knock on these newer distributions, as they get Linux in the hands of adventurous or curious Windows and Mac users, who want a stable, reliable OS without the hassles of spending hours setting up more traditional distros like Slackware or Debian. Moreover, in my short time with them, they do make a Linux desktop accessible and productive right away. Fortunately, Scribus has been through approximately 40 revisions since it was ported to Qt from Python when it was launched. Unlike compiling a compiler (very tricky) or some of the core libraries in Linux, once your workstation is setup properly, it compiles very reliably. Moreover, most of the newer distros Mandrake 8.2 and 9.0, RH 7.2 & 7.3, Suse 7.3& 8.x etc have pretty stable versions of 2.9x gcc compilers. The 2.95+ versions have been around for quite a while and most distros have solved many of the bugs. Red Hat on 7.3 for example is on build 118, which has been extremely reliable.
GCC Version 3.2 was released last year and the current generation of distros is based on this series. GCC 3.2.x and the latest GCC 3.3 is much better at optimizing code for newer AMD and Intel PIII and PIV processors.
Caveats: 1) I have limited experience with these distros. I do not run them full time. I run RH 7.3 and RH 8.0 and RH 9, so most of this based on RH. 2) 90% of this done from the console or an Xterm. 3) You have the distro installation disks handy. 4) You can accomplish this just as well other desktops or window managers. If you run, Gnome, substitute gedit for kedit - same results.
Step One Compiler and the GNU Tools
You need a compiler - obviously. Open a console or terminal window and simply type: gcc -v
You should get an output like:
[[peter@nec400 Scribus]$ gcc -v Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/3.2/specs Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --host=i386-redhat-linux --with-system-zlib --enable-__cxa_atexit Thread model: posix gcc version 3.2 20020903 (Red Hat Linux 8.0 3.2-7)This indicates the compiler is installed and working.
If not, locate the gcc and gcc devel packages from your distro CD Rom. They should match the version which was included with your distro. Example: Mandrake 8.2 gcc-2.96-0.76mdk.rpm is the compiler and libstdc++2.10-devel-2.96-0.76mdk has the c++ development files. You also need the binutils package which includes the tools which the compiler uses such as the linker (ld) and assembler (as). Type: ld -v at the command line to check you have them installed as well. Lastly, you need these packages as well:
- autoconf
- automake
- libtool
- pkgconfig
Once you have ensured you have all the tools. Proceed. If not install as needed, then it would be a good idea to run any kind of updater like YAST or Up2date to make sure you have the latest versions from your distro. As an example, RH has released several updates to the compiler and basic system libraries. Having these updates might help you to avoid troubles or problems later on.
Step Two
Knowing which packages and libraries are needed. You need the so called "development" packages of the following libraries:
- Qt - on redhat is qt-devel (The exact version depends on which version of KDE is installed.) Qt 2.3.1 or 2.3.2 is used for KDE 2.2.x. Qt 3.0.x or 3.1.x is used with KDE3. You can have both a version 2 and 3 of Qt.
- Xfree-86-devel
- libstdc++-devel
- libtiff-devel
- libpng-devel
- zlib-devel
- libfreetype2-devel should be installed for any Scribus version after 0.9.9. Freetype should be at least 2.1.3
- lib-cups-devel might be needed if you have cups printing and this depends on how your distro supports printing.
- Optionally: liblcms-devel - This is the littlecms package which enables color management with Scribus. Version 1.10 or later is preferred.
- Optionally: gimp-print-devel - This is the special gimp-print package which works with cups for high fidelity printing on popular inkjet printers.
- Optionally: python-devel 2.1 for adding the scripting plug-in (1.52 works, but is quite old)
The exact versions depend on the one provided with your original distro. DO NOT try to upgrade version of the png packages with ones different from your distro. It can really mess up KDE and QT. You have been warned. Development packages are mostly files called header files which the compiler uses to build and link to the libraries already installed on your machine. Another way to check is to look in the /usr/include/ directory. You will see a whole bunch files with .h as the file extension. Not all headers are installed here. Qt is put in a separate /include directory by the packager.
Step Three - The Build Environment
Checking you build environment.
From the console type:
envHit Enter. You should have an output like this:[peter@vmware scribus-1.0]$ env PWD=/rpms/scribus-1.0 DBROOT=/home/peter/adabas XAUTHORITY=/home/peter/.Xauthority KONSOLE_DCOP=DCOPRef(konsole-2026,konsole) GS_LIB=/home/peter/.kde/share/fonts DBWORK=/home/peter/adabas/sql HOSTNAME=nec400 LD_LIBRARY_PATH=/home/peter/adabas/lib:/home/peter/adabas/lib: SESSION_MANAGER=local/vmware:/tmp/.ICE-unix/1335 QTDIR=/usr/lib/qt3.1.2 KONSOLE_DCOP_SESSION=DCOPRef(konsole-2026,session-1) LESSOPEN=|/usr/bin/lesspipe.sh %s CXXFLAGS=-O2 -march=i686 USER=peter LS_COLORS=no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:bd=40;33;01:cd=40;33;0 1:or=01;05;37;41:mi=01;05;37;41:ex=01;32:*.cmd=01;32:*.exe=01;32:*.com=01;32:*.b tm=01;32:*.bat=01;32:*.sh=01;32:*.csh=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31: *.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:* .bz=01;31:*.tz=01;31:*.rpm=01;31:*.cpio=01;31:*.jpg=01;35:*.gif=01;35:*.bmp=01;3 5:*.xbm=01;35:*.xpm=01;35:*.png=01;35:*.tif=01;35: KDE_MULTIHEAD=false MAIL=/var/spool/mail/peter INPUTRC=/etc/inputrc GTK_RC_FILES=/etc/gtk/gtkrc:/home/peter/.gtkrc:/home/peter/.gtkrc-kde XMODIFIERS=@im=none LANG=en_US COLORTERM= DISPLAY=:0.0 LOGNAME=peter SHLVL=5 LDFLAGS=-lm SHELL=/bin/bash HISTSIZE=1000 HOME=/home/peter TERM=xterm SSH_ASKPASS=/usr/libexec/openssh/gnome-ssh-askpass DBCONFIG=/home/peter/adabas/sql PATH=/home/peter/adabas/bin:/home/peter/adabas/pgm:/home/peter/adabas/bin:/home/peter/adabas/pgm: /usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/home/peter/bin:/ usr/local/kde/lib/kde3:/usr/local/Acrobat5/bin CFLAGS=-O2 -march=i686 _=/usr/bin/envThe important thing to note is the QTDIR variable which points at the directory where Qt and its libraries are located. Scribus will not run or compile without this. You could have more than one Qt directory one for Qt2 and one for Qt3.
The other important thing is to make sure the /etc/ld.conf file contains a line with the same directory where Qt is. This file tells the linker where the library files are when compiling Scribus. This info is hardwired into Scribus when compiled, so do not move these files around. Here is mine:
/usr/lib /usr/kerberos/lib /usr/X11R6/lib /usr/lib/kde3 /usr/lib/qt-2.3.1/lib /usr/lib/qt-1.45/lib /usr/local/lib /usr/include /usr/include/kde /usr/i386-glibc21-linux/lib /usr/lib/qt3/lib /usr/lib/qt2/lib /usr/lib/sane /usr/lib/qt-3.1.2/libYou can only edit this as root, so if you need to make adjustments type: ksudo konqueror - Enter and put in the root password. Navigate to /etc and then open /etc/ld.conf with Kedit. Save this and there will be a backup made automatically with the name ld.conf~. Exit and return to the console. Type su - hit Enter. You are now running as root. Next type: /sbin/ldconfig Hit Enter. This will cause the disk to thrash for a second or two while it reads the new libraries. If you get a file not found error type: slocate ldconfig - Hit enter. This will find the location of the program. This reloads the ld cache so the linker can find the newly added directories. This is also a good idea to do if you add packages which have libraries which are needed for compiling. Lastly, check your path to see if /usr/local/bin is in the path. This is where Scribus puts the executible file. If it is missing from the path, go to the root of your home directory, open .bashrc in Kedit and add this directory to your PATH statement. This is usually setup as a default on most Linux workstations.
Step Four - Getting and extracting the source files.
Get the tarball from http://web2.altmuehlnet.de/fschmid/. Save this in a temporary directory. Then navigate to this directory:cd ~/nameoftempdirectory under your home directory.Then from the command line:
tar xfz scribus-0.x.x.tar.gzwhere x.x is the version number of Scribus This will untar and extract scribus into a separate set of directories. Then:cd ./scribus-0.x.xHit Enter
Step Five - Compiling
One other important item on Redhat and Mandrake: To make sure tiffs and littlecms are compiled in properly, add this:
export LDFLAGS="-lm"exactly as above with the quotes included. This is to help Scribus find these files at compiling time.
./configureHit Enter. This runs the autoconfigure scripts tailoring the makefiles to your environment. If you get errors they will look something like this.:
checking for Qt... configure: error: Qt (>= Qt 3.0.5) (library qt-mt) not found. Please check your installation! For more details about this problem, look at the end of config.log. Make sure that you have compiled Qt with thread support!Any errors here will need correcting, by installing the correct development libraries or fixing enviroment variables. A sucessful configure will result the creation of the makefiles, needed to compile Scribus.
Then type:
makeHit Enter. Grab a coffee. This is the compiling phase. This might take anywhere from 5-40 minutes on your workstation. This depends on how many other programs are running and the overall speed of your workstation. Compiling is processor intensive and sometimes disk intensive. After compiling is completed, type:
suHit Enter and then type in the root password. Hit Enter again. Type:
make installHit Enter. This will install the program's support files (docs, libraries etc.) in /usr/local/share/scribus or /usr/local/lib/scribus in the latest versions of Scribus.
When the installation is finished, type
exit
. Then typescribus
from the command line and it will launch.Your done!
Glossary
- gcc - The GNU Compiler Collection. The complete collection can compile C, C++, java, FORTAN, ADA and other languages. It is really the heart of open source software. Without a high quality compiler, much open source software would not exist. Most commercial compilers are expensive - at least several hundred dollars per package.
- Qt - a multi-platform development enviroment from Trolltech, written in C++. KDE is almost 100% based completely on the open source version of Qt. There are also commercial versions of Qt available.
- C++ - a modern high level language which encompasses the entire set of C. A great many GUI programs, excepting most of gnome or GTK applications are written in C++
First Version 28 :08:2002
Updated 12:07:2003