02feb11

= 02-Feb-2011 LUG meeting notes =

We held the 7th Linux Users Group meeting yesterday after work in the AFG/STG room starting at 17:30 on 02-Feb-2011. We used the previously prepared presentation as a talking point, and we also connected a laptop with Linux to the 'big screen' so we could illustrate some of the discussed aspects.

The topic was 'compiling in Linux' which is a massive topic and we only touched briefly on some aspects of it. Still, it was educational for me, and I've been a full time home PC Linux user since 1998.

Compiling in GNU/Linux
The attached presentation has most of the points covered, but some additional interesting details further than the presentation are as follows:

We noted home users will typically use applications build as .rpm or .deb (distribution dependant) but there can be cases, especially for less common applications or for less common Linux distributions or for alpha/beta-operating system versions, where an application has not yet been packaged for regular users (even though source code is available). In cases like that, it may be desirable for a regular user to do a custom compilation. :)

Alessandro and Eugenio noted that instead of only following the traditional ./configure, make, su, make install, one could instead add an appropriate 'prefix' to the ./configure such that one does not need 'root permissions' to install an application but instead one can install the application locally in one's home directory. i.e. something like:

./configure --prefix=/home/username/somedirectory make make install

And there is no need in the above for root permissions.

This was noted to be 'safer' and it provides all sorts of useful possibilities for testing (and running multiple versions of the same application at the same time), and also makes it easy to clean up if one is not happy with the installation (as the installation is confined to one's home directory). And if one is happy with the install and wants all users to have access, one can then repeat/proceed with the nominal install method using root permissions.

We tested/demonstrated the above on our presentation PC as an example (custom compiling from tar.gz file the latest version of the very simple editor program 'leafpad').

Example of compile with rpmbuild command
We also as an example rebuilt a very old version of the program 'leafpad' from an rpm source file (leafpad-1.0.16.src.rpm) which creates an rpm of this older leafpad version. I use the 'rpmbuild --rebuild' command a lot on openSUSE milestone releases (alpha/beta software) that I test, where the packaged rpms are not yet available for the milestone, and so I take the "application.src.rpm" file of an earlier openSUSE version and I rebuild it for the specific alpha/beta (milestone) OS version I am testing. ie

rpmbuild --rebuild application.src.rpm

This does not work all the time, but if the packager of the .src.rpm has a good specification file, it has a reasonable chance of working. My experience is some openSUSE packagers are better than others in creating a good specification file.

ldd and objdump command examples
Alessandro illustrated the commands 'ldd' (print shared library dependencies) and 'objdump' (display information from object files) as useful debugging commands that can be used to support an execution effort where despite a successful compile there may still be problems with a program. The respective 'man ldd' and 'man objdump' provide lots of interesting detail on compiled applications.