Recent Changes - Search:

BookCrystal

Install

mostly NOT UPDATED to bookCRY

Installation/tuning of PAW

It is warmly suggested that you create a .pawlogon.kumac in your home directory. The most needed thing is the macro/default, that should contain the path to the kumacs distributed with book95. Here follows my personal ~/.pawlogon.kumac. Please consider that it may not fit your needs/preferences.

macro/default '.,~/kumac,/cern/kumacs' A
graphics/option zfl
graphics/option file
graphics/option hsta
graphics/option stat
n/cut $1 dc2x>-14&&dc3x>-14&&dc4x>-14
n/cut $2 dc1x>-14&&dc1y-14&&dc2x>-14&&dc2y>-14&&dc3x>-14&&dc3y>-14
n/cut $3 pe>0&&pe<300
n/cut $4 abs(thxin)<.0002&&abs(thyin)<.0002

Getting the program:

The source code is available directly from the CERN WWW server. It consists of one tar-gzip'ed file, dumread.tgz, that contains surce code for both Linux and HP/UX.

Contents of dumread.tgz

Source code:

  • dml.h definition of the .dml files structure.
  • dumread.c is the base code that reads the .dml files and calls the user routines.
  • dumread.h
  • book95.F is the Fortran77 part of the translator. It contains the interface to HBOOK code and the calculations.
  • book95.inc
  • d2n.c is the C part of the user code that transforms .dml files into .ntp files. It provides a selection mechanism that lets you choose the variables to be stored using a .ini file, and prepares the data for the fortran code.
  • d2n.h
  • ini.c is a sub-part of d2n.c, that interprets the .ini files
  • lbook.c is a sub-part of d2n.c, that interprets the .ini files
  • profile.c is some standard code from the WINE (WINdows Emulator for Linux) project that actually reads the .ini files. These have the format of "standard" Windows .ini files
  • profile.h
  • uti.c as the name says it contains some accessory subroutines.

Other files

  • Makefile the rules for make
  • a.ini, n.ini examples of initialization files
  • doc/*.html Documentation in HTML format
  • check a (bash) shell script that verifies the consistency of variables for the N-tuples. Not yet working on ksh shell.
  • inc2h a (bash) shell script that transforms a .inc file (that hold the COMMON definitions for Fortran) into a .h file of struct definitions for C. This absolutely needs f2c. It works also on ksh shell.
  • A few utility routines that come standard with GNU gcc on Linux but are missing from the HP cc and gcc libraries are included.
  • Maybe some more are needed on even different brands of Unix. If this is your case, mail me.

Installation: UPDATED

Unpack the file in a directory of your choice using :
tar zxvf bookCRY.tgz
(maybe gtar) or
gunzip -c bookCRY.tgz | tar xvf -

Needed to compile this program:

f2c (Fortran to C translator; any version, i think) cc (C compiler, any ANSI version, i think; i use GNU gcc) GNU make (any version, i think) f2c is needed to create the include file that interfaces Fortran code to C (see inc2h); actually, the real compilation of the Fortran code could be made with a real Fortran 77; i'll test this as soon as i'll have g77, the GNU F77 compiler. Book95 has been tested on Linux (with gcc v2.6.3 and v2.7.0) and on HP-UX (with HP cc).

Compiling:

The first time

cd to the directory where you have installed the source code and run make (gmake on HP-UX). This should work painlessy on Linux, if the required items are installed. If you work on a different kind of Unix, or you have a non-standard ( i mean non-Slackware ) installation, you will probably have to modify the Makefile. If you have any problem, you can always mail me.

The Makefile

The relevant part of the Makefile is the following:

ifeq ($(OSTYPE),Linux)
  CC = gcc
  GNU = true
else
# this probably represents a "worst possible case": hhpfi2.fi.infn.it
  CC=cc
# no gcc, damn!
  CFLAGS+= -Aa
# i need ANSI C
  CERNROOT=/users/cernlib/new
# not really the proper place !
  LD=f77
# odd, but it works...
  F2CPATH=$(HOME)/bin
# my system manager didn't install F2C, i did it myself.
  STDLIBS+= -lcl
# adds the F77 libraries when then F2C libs don't include them
  FCPPFLAGS= -P
# some (old?) versions of f2c do not like the "line" information
# written by cpp
#  LDFLAGS= -v
endif

As you can see, it uses the environment variable OSTYPE to recognize a Linux system, that needs less special settings. The non-Linux part is made for an HP-UX with no gcc compiler and a user-installed f2c, and a non-standard path for the CERNLIBS If you have non-standard paths for include files, these should be added to CFLAGS with -I in front. The addictional paths for the libraries should go in LDFLAGS and addictional libraries should be added to STDLIBS

The definitions made are then used to set up the real things:

ifneq ('$(F2CPATH)','')

  1. when f2c library and includes are in a strange place
  CFLAGS+= -I$(F2CPATH)
  STDPATH+= -L$(F2CPATH)

endif

ifneq ($(CC),gcc)

  1. so you need some extra code and includes CFLAGS+= -Ignu/ extraobj= gnu/fnmatch.o gnu/getopt.o gnu/getopt1.o gnu/alloca.o

endif

ifeq '$(CERNLIB)' ''

  1. usually, when CERN software is installed, CERNLIB is already defined
  2. in the environment (type "set" to see environment variables) CERNLIB=$(CERNROOT)/lib

endif

hbooklib = -L$(CERNLIB) -lpacklib LOADLIBES=$(hbooklib) $STDPATH $(STDLIBS) -lm

ifeq '$(test)' 'true'

  1. this tells to cpp to cut away form book95.f the parts that
  2. call the CERNLIBS LOADLIBES=$(STDLIBS) -lm FCPPFLAGS+= -D test CFLAGS+= -D test

endif

The "test" flag (than you can set as an exported environment variable or with make -Dtest=true is only usefuls for debugging of the base code (the .c files) when one doesn't need to create an N-tuple. Hopefully, you will not need this.

Edit - History - Print - Recent Changes - Search
Page last modified on October 27, 2007, at 12:35 pm