Compiling from Source

From Wikislax

(Difference between revisions)
Jump to: navigation, search
m (Protected "Compiling from Source" ([edit=sysop] (indefinite) [move=sysop] (indefinite)))
Line 53: Line 53:
{{pFoot|[[Compiling the Kernel]]|[[Main Page]]|[[OpenSSL]]}}
{{pFoot|[[Compiling the Kernel]]|[[Main Page]]|[[Compiling Xen]]}}

Revision as of 21:47, 5 July 2012

Linux distributions come with binary versions of almost everything, however there are good reasons why we want to deinstall the binary versions of the critical server software and reinstall from source :

Compiling software from source is often simple, however when the software is complex or has many options, can require some additional knowledge to choose the right options. The usual steps are :

What you usually need to type on your keyboard is something like that :

# tar -tvf software-x.y.z.tgz
# tar -C /usr/local -xvf software-x.y.z.tgz
# cd /usr/local
# chown -R root:root software-x.y.z
# chmod -R o-w software-x.y.z
# cd software-x.y.z
# ./configure -help | less
# ./configure -option1 -option2 …
# make
# make install
# cd /etc/software
# vi xxx
# cd /etc/rc.d
# vi
# ./ restart


Using 64 bits Linux Slackware, unless you install multilib (which seems to break the ability to compile the Kernel BTW), it is not very important where you store the libraries and /usr/local/lib - which is still the default for most software - could be OK. However to keep things in good order *** we *** prefer to always store 64-bits libraries in /usr/local/lib64 using the -libdir option of .configure where available, otherwise copying the libraries manually as part of the installation.

Access rights

Software not working after installation is often a permission issue. Keep the initial setting of 022 for umask in /etc/profile to make sure files are created with read access for other when installing. For software to be ran under a user other that root (cyrus imap under cyrus, spamAssassin-clamav-mimedefang under milter), su under this user after installation to make sure the software works and launch the software from the console to detect permission issues messages. The /var/log directory is another place to check for errors.


Another major cause of failures is missing libraries because they are searched in the wrong place - for example /usr/lib64 instead of /usr/local/lib - or because they have the wrong name - for example library imap2007/c-client.a actually needs to be linked as imap2007/libc-client.a.

Compiling the Kernel Main Page Compiling Xen
Personal tools