Loading web-font TeX/Math/Italic

Monday, 14 December 2015

Keeping old data alive, building CERNLIB


Updated 28/4/1016 with additional link and clarification

Analysis of the data from the ZEUS experiment was performed using Fortran programs. These used the CERNLIB software libraries and data was stored in structures known as Ntuples.
I used Column-wise Ntuples, which are saved in a binary format. So when at the end of my Ph.D. analysis, I saved the old Ntuples to 11 CDs these became largely useless immediately I left Physics.
The Digital dark age therefore came to me sooner than I anticipated.
Fortunately with the source being made freely available and the necessary compilers being included in gcc I thought I'd have a try at building these on my Linux laptop.
At the time of this exercise I was running version 11.10 of Ubuntu.
Here are the steps I took, based on instructions from this page. One major issue I had with Lubuntu was that many of the dependency packages were not installed and I had to discover and apt-get them all. For this reason it's better not to try this on a cut down Linux.


  • Install gfortran (this is part of gcc, I have version 4.6.3)
  • Copy and unpack the CERNLIB binaries
  • Because I had a cut down Linux, I needed to build LessTif
  • Get xutils-dev package for imake
  • Set up the  build environment
     cd to the cern folder
     ~$ export CERN_ROOT=CERN_PATH/VERSION
     ~ export CVSCOSRC=CERN_ROOT/src
     ~ mkdir CERN_ROOT/build
     ~ cd CERN_ROOT/build
     ~ export PATH=CERN_ROOT/bin;$PATH
  • Update $CVSCOSRC/config/linuc.cf This file has some operating system specific information, I changed the following
    • #define hasgfortran
    • Change CcCmd to gcc
    • Check #define X11Includes
      This needs to point to the location of the X Window headers, these can be installed using
      sudo apt-get install xserver-xorg-dev
  • Run $CVSCOSRC/config/imake_boot to create the Makefile from the imake files
  • Run gmake bin/kuipc to build kuipc – this is built to /cern/new/bin
  • Add kuipc to path because this is required for the next build
  • Run gmake 
When I finally succeeded I was able to write a simple Fortran program that was able to load my old ntuple files.

A couple of other tips

link gmake to make using sudo ln -s /usr/bin/make /usr/bin/gmake

 

Problems and errors

There were a couple of errors in the main build that needed fixing:

#1
Conflicting types for _XmDrawShadow /usr/local/include/xm/DrawP/h Previous declaration is obsolete


Fix: Remove _XmDrawShadow(); from iconwidget.c
 
#2
Pawlib/paw/cpaw/bugrep.c L_cuserid undeclared.
Fix: It should be in <stdio.h> but add #define L_cuserid 9 in the file

Finally, Liblapack3.a is required for PawX11
Fix: Download and build BLAS & LAPAC

Of course now in 2015, CERNLIB is available from the Ubuntu software manager.

No comments:

Post a Comment