CERNLIB (x86-64) Page of Harald Vogt

CERNLIB 2005 and 2006 (64 bit)
compatible with the gcc4/gfortran compiler suite

Jul 23, 2014:   new CERNLIB 2005 patches

Some people insist on using this CERNLIB 2005 distribution so a new set of "patches" has been created which helps on newest systems and compilers (it includes a fix for the "freetype" problem reported below). New installation scripts will also compile and run all available test suites now.
The new patchset cernlib.2005.corr.2014.04.17.tgz and the new patched installation scripts cernlib.2005.install.2014.04.17.tgz, both created by Jacek M. Holeczek, are ready for download.
This new set of "patches" has been tested on several systems: SL(C)5, SL(C)6, CentOS 6, Ubuntu 12.04 and 14.04, Fedora 14 and 20 and several compilers: gcc 4.4.x, 4.6.x, 4.8.x.

Jul 04, 2013 (Ubuntu warning added Oct 31, 2013):   CERNLIB 2006 on newer Linux systems

Many new Linux distributions offer CERNLIB 2006 binary packages. The source code is actually maintained by the Debian Project now. However, due to licensing problems, not all original CERNLIB 2006 routines and libraries are available (and hence they are also missing in binary packages which originate in this source code). Note that Debian splits CERNLIB 2006 into four source code packages called "cernlib", "paw", "geant321" and "mclibs" (Monte Carlo libraries). They also provide a separate "cfortran" package, if you need it.

See, for example:

If you prefer a monolithic SRPM package, you may try to have a look at older Fedora Project distributions ("equivalent" to Debian's "2006.dfsg.2-14" patchset, according to the included "CHANGELOG" file). Note that they also provide a separate "cernlib-g77" package ("equivalent" to Debian's "2006.dfsg.2-13" patchset, according to the included "CHANGELOG" file).
See, for example:

A small additional note concerning Ubuntu ... it seems that in Ubuntu releases 11.10, 12.04 (LTS), 12.10 and 13.04 some of their CERNLIB 2006 related binary and development packages are "broken" (they are actually "empty" inside). For example, one of these "broken" packages is the "llibpdflib804-2-dev" in the version "20061220+dfsg3-1build1":

Looking at all available Ubuntu "libpdflib804-2-dev" versions it can be seen that the old Ubuntu 10.04 (LTS) uses "2006.dfsg.2-5ubuntu3" and then the newest Ubuntu 13.10 uses "20061220+dfsg3-3". In both these cases, when one clicks the "List of files in package", one can see all required libraries and include files inside (so these packages are not "empty").

See also the site that announces
CERNLIB builds for the Large Hadron Collider

Jun 26, 2013:   CERNLIB 2005 for gfortran on newer Linux systems

Jacek M. Holeczek gave additional hints to let the CERNLIB build succeed:
On some newer systems (e.g. SL 6.X / SLC 6.X / CentOS 6.X / RHEL 6.X) the compilation of the "2005/src/pawlib/paw/xbae/cell.c" file may die with an error "freetype/config/ftheader.h: No such file or directory" (inspect the "2005/build/log/make.MMDD" file and search for the string "Error").

The problem is that, on these systems, "Xm" coming from OpenMotif will try to use "Xft" which in turn will try to use "freetype", which is actually the "freetype2" there (this problem does not appear when "Xm" comes from LessTif).

The CERNLIB "builder" is not prepared for it. The simplest brutal fix is to create an appropriate "backwards compatibility" symbolic link, either in the CERNLIB source tree:

    mkdir -p 2005/src/include
    ln -s /usr/include/freetype2/freetype 2005/src/include/
or in the standard system location:
    cd /usr/include
    sudo ln -s freetype2/freetype ./
and then rebuild CERNLIB from scratch.

Aug 04, 2010:   New version of CERNLIB for gcc-4.4 and gfortran

Jacek M. Holeczek was notified that gcc 4.4 introduces new problems. A new cernlib.2005.corr.2010.08.01.tgz has therefore be provided by him.

Then, in order to make the patched CERNLIB 2005 installation as "smooth" as possible on many new systems, he created a set of "patched" installation scripts cernlib.2005.install.2010.08.01.tgz (see also the "README_cernlib" file included in that tarball.

Both these tarballs have been tested with several gcc versions (and gfortran):
gcc 4.2.1 on openSUSE 10.3/i586
gcc 4.3.2 on openSUSE 11.1/x86_64
gcc 4.4.1 on openSUSE 11.2/x86_64
gcc 4.4.3 on Ubuntu 10.04/i686

Aug 05, 2009:   New version of CERNLIB for gcc-4.3.2 and gfortran

The latest cernlib.2005.corr.2009.06.13.tgz tarball has been provided by Jacek M. Holeczek. Some additional debian patches were applied in order to get cernlib working on systems with newer compilers (openSUSE 11.1/i586).

Feb 23, 2007:   Examples of the C / Fortran interface updated

An updated cernlib.2005.corr.tgz is provided which includes now also the modified code for cernlib's C / Fortran interface located in ./2005/src/cfortran/Examples .
Remark: In this directory I have added a script run_example which can be used to compile, link and run the examples. This requires that you have installed the ./2005/include directory after downloading the new cernlib.2005.corr.tgz and copying it into your installation.
Using your installation environment you should run:
    cd $CERN
    gtar -zxvf cernlib.2005.corr.tgz
    cd $CERN_ROOT
    mkdir include
    export CERN_INCLUDEDIR=$CERN_ROOT/include
    cd $CERN_ROOT/build
    gmake install.include
The compiled cernlib versions for SL4 and SL5 provided for download are updated already to include the modifications for ./2005/src/cfortran/Examples .

Feb 9, 2007:   LAPACK installation script modified

The script Install_lapack was modified to include the -fPIC compile option.
I assume that this is required for GENSER (Generator Services Subproject) and for the ATLAS offline/external generator code used in the ATHENA framework of ATLAS. The cernlib code itself (except the patchy stuff) has been compiled using this compile option.
Provided for download:  a compiled version for SL4 on x86_64   containing the lib, bin, and include subdirs (remark: libpacklib/libkernlib does not contain shift).
Remark: The cernlib distribution is runnning and has beeen tested now also on RHEL5 beta2 -> SL5   (which uses the gcc4 compiler suite including gfortran as default).
Provided for download:  a compiled version for SL5 on x86_64   containing the lib, bin, and include subdirs (remark: libpacklib/libkernlib does not contain shift).

Dec 12, 2006:   Reorganization of the CERNLIB distribution

Here is now the cernlib-2005-all-new.tgz and the info have been updated.
A patch which may be applied to the CERNLIB 2005 original distribution can be found here.
The installation scripts coming with cernlib-2005-all.tgz are now more structured and a script cernlib_env was added. This may be used in the directory which contains cernlibs "tar.gz" files if one has to reinstall some parts of cernlib, see cernlib install: "Installing Individual packages".
Again follow this procedure:
    download cernlib-2005-all.tgz to your installation directory
    run "gtar -zxf cernlib-2005-all-new.tgz"
    run "./Install_cernlib"
One can see all the cernlib code modified following this link.
For 64 bit architectures the following paw example (running in the pawdemo subdirectory) .
is now also executed correctly. Futhermore the example given in the HBOOK Reference Manual (section 9.3.1 - Using PAW and Unix shared memory) is working as expected.
Back to note from
For older notes on CERNLIB 2005 please see the historical entries  
 created:         Thu Jul 20, 2006 by Harald Vogt
 last updated:  Wed Jul  23, 2014 by