Installing CCP4 on Fedora Core 3

Introduction

Installing a working version of CCP4 of Fedora Core 3 can be a challenge because of a bug in the GNU C/C++/FORTRAN compiler shipped with the operating system. This bug causes refmac5 and certain subroutines in LAPACK to hang, and it is likely to affect other programs. It exists in all versions of GCC in the 3.4 series, and the only way around it is to install a older compiler, preferably the latest GCC-3.3.x compiler which is GCC-3.3.5 at the time of this writing, and use it to compile CCP4. There is also a change in the way memory is allocated at the kernel level which can result in refmac5 getting killed by the kernel on low memory systems.

Removing Fedora Core 3's LAPACK Package

The LAPACK libraries shipped with Fedora Core 3 are broken because they were compiled with GCC-3.4.2. It's best to remove them so there is no chance they will be linked with any new programs you may be building. You can do this the hard way (rpm, the Redhat Package Manager), or the easy way (rm as root). Here's the easy way:

# su -
password: 
# rm /usr/lib/liblapack.so.* /usr/lib/liblapack.a

Installing GCC-3.3.x

There are Fedora Core 3 RPM packages for GCC-3.3.5, but the FORTRAN compiler from the RPM packages links to the FORTRAN support library of the GCC 3.4.2 compiler, and does not work right. Get the source for GCC-3.3.5 from ftp://ftp.gnu.org/pub/gnu/gcc/gcc-3.3.5/gcc-3.3.5.tar.gz and follow the commands below to build it. You will have to change the --prefix=/home/jpaint/local to the directory you would like the compiler installed to.

# tar xzf gcc-3.3.5.tar.gz
# cd gcc-3.3.5
# mkdir objdir
# cd objdir
# ../configure --prefix=/home/jpaint/local --disable-shared 
--enable-languages=c,c++,f77 --enable-version-specific-runtime-libs
# make bootstrap
# make install
This almost works, but there is something wrong with the GCC build scripts which put the FORTRAN support libraries in the wrong place. It's easy to fix by copying them to the right directory. For my GCC installation prefix:
# cd /home/jpaint/local/lib/gcc-lib/i686-pc-linux-gnu
# cp libfrtbegin.a 3.3.5/.
# cp libg2c.a 3.3.5/.
# cp libg2c.la 3.3.5/.

Now add the bin directory of the compiler to your path before building ccp4(bash shell):

# export PATH=/home/jpaint/local/bin:$PATH
# gcc -v
Reading specs from /home/jpaint/local/lib/gcc-lib/i686-pc-linux-gnu/3.3.5/specs
Configured with: ../configure --prefix=/home/jpaint/local --disable-shared --enable-languages=c,c++,f77 --enable-version-specific-runtime-libs
Thread model: posix
gcc version 3.3.5

Building CCP4

At this point, you can follow the standard CCP4 build instructions. However, you may have some problems with TCL/TK and CCP4i. I don't use the CCP4i interface, so hopefully somebody who does can add a section about it.

refmac5 / Killed / SIGKILL

A few weeks ago I refmac5 quit working on my Fedora Core 3/Linux x86 system. When I tried to run it, the process would die from a SIGKILL. It looks like this:

# refmac5
Killed
#
This seems to be caused by a change in the Linux kernel's memory allocation which did not enter the mainline www.kernel.org kernel until 2.6.10, although I'm not 100% sure about that. The problem also exists in several vendor kernels with earlier version numbers. I've seen it occur using the Fedora Core 3 kernel (not the one on the install disks, but a updated kernel package), Debian Sarge, and Mandrake 10.1. If you experience this problem, you can work around it two different ways: increase physical memory, and/or virtual memory by adding more swap, or tell the kernel it can over commit its memory through the /proc filesystem like this:
# echo -n 1 > /proc/sys/vm/overcommit_memory
Option #2 may result in some of your other processes getting killed by the OOM killer to free up memory, but I haven't had any problems.

Authors


Last Modified Thu Feb 17, 2005 by Jay Painter