CERNLIB (x86-64) Old notes

Old notes for CERNLIB 2005 (64 bit)
compatible with the gcc4/gfortran compiler suite

Harald Vogt

Deutsches Elektronensynchrotron


Historical notes on CERNLIB 2005


Sep 22, 2006: Additional corrections from Kevin B. McCarty added

The cernlib.2005.corr.tgz and the info have been updated.

Sep 20, 2006: Some small corrections for CERNLIB version 2005 added

To apply this corrections the installation procedure as described below has to be modified as follows:
download cernlib-2005-all.tgz to your installation directory
run "gtar -zxf cernlib-2005-all.tgz
now download here cernlib.2005.corr.tgz which replaces the original one
and after that run "./Install_cernlib"

Jul 18, 2006: CERNLIB version 2005 updated to include AMD64/Intel® EM64 (x86-64) and Itanium (ia64) architectures.
                              It is now also compatible with gcc4 (gfortran).

What is essential for porting CERNLIB to 64 bit architectures is the pointer (memory addresses) handling in the ZEBRA, HBOOK, and PAW packages. One has to take care that this still fits into 32 bit. If the application is not to large (huge COMMON areas which may exceed the 32 bit address space) than it is possible to run applications using those CERNLIB packages on 64 bit architectures.  

I have installed a version of CERNLIB under Scientific Linux 3.0.7 (32 bit) and 4.3 (64 bit) with gcc version 3.2.3 and 3.4.5 respectively .

To check the gcc4 compatibility I have used an experimental release of gcc4:   gcc version 4.2.0 20060603 (experimental).
The installed version passes all CERNLIB tests including the paw/paw++ demo tests.
The original CERNLIB code is available by this link
which already supports LP64 architectures but has still problems when using paw/paw++.
Thanks to the work of Kevin B. McCarty from debian concerning the cfortran package which is used in the CERNLIB code the g77 compiler option -fno-f2c is not needed anymore. The critical parts of CERNLIB code for going to 64 bit architectures are in "packlib/kernlib/kerngen/ccgen" and in "pawlib/comis/deccc". In my CERNLIB distribution I have included the LAPACK package to get a consistent blas and lapack library if gcc4/gfortran is used. It is not possible to link the pawX11 and paw++ binaries with blas and lapack libraries compiled with gcc3/g77 (libgfortran is not backward compatible to libg2c). If one uses gcc3/g77 to install CERNLIB one may also use blas and lapack which come with the Linux distributions.
I provide here a special zipped tar file containing all CERNLIB 2005 code and the LAPACK and patchy4 sources and install scripts which makes the life easy. It creates all libraries and executables. The following is needed:
download cernlib-2005-all.tgz to your installation directory
run "gtar -zxf cernlib-2005-all.tgz
run "./Install_cernlib"
This script checks for the compiler suite used and installs:
- the blas and lapack libraries in the LAPACK subdirectory,
- the patchy4 executables in the patchy subdirectory,
- and in the ./2005 directory tree all CERNLIB sources, libraries, and executables.

The modifications compared to original code are listed here.
A complete 2005/src tree of the CERNLIB 2005 modified can be found here.
A patch which may be used for the CERNLIB 2005 original distribution can be found here.
A compiled version of CERNLIB 2005 with gcc3/g77 for 32 and 64 bit architectures can be found here.
A compiled version of CERNLIB 2005 with gcc4/gfortran for 32 and 64 bit architectures can be found here.

 created:         Thu Jul 20, 2006
 last updated:  Jul  04, 2013 by