Manipulating CCSL

A collection of shell (csh) and perl scripts is included with the library. They provide tools needed to build and manipulate it.

Tools available

These tools may be installed as commands using the aliases file.
fpr [-d pname] filename
Prints the Fortran listing file filename on the printer pname. If the -d switch is not given the output goes to the default printer.
get [part] [module]
Extracts subroutine or program module from the part specified. If module is not given the program prompts for the name of the subroutine or program. It is possible to get several modules in a single run, and more efficient to specify them in alphabetical order. The extracted routines are given the extension ".got".

extract part fttopt system site
part is one of LIB, MAI, PJB, JBF, PIG, PR, PF, PMA
ftnopt either LAX or PICKY
system is either UNIX or VMS
site is either ILL or RAL
Makes the part specified from the master file. This process substitutes numbers for the variable dimensions in the master file using local preferences given in a file (parlist) and adopts the system and site options specified. The master file mistre.ss is read from the directory $CCSL_SSSRC or if that is not defined $CCSL_SRC or failing that the current directory. The fortran file created is called xxxmk4.f where xxx is the three letter part name. e.g. extract lib makes libmk4.f and extract mai makes maimk4.f If the environment variable $CCSL_FDEST is a directory the file is placed there.

makobj [switch] part name command
switch is either -c (split and compile) or -s split only. The default is -c.
part is one of LIB, MAI, PJB, JBF, PIG, PR, PF, PMA
if compiling
name the name of a file to which Fortran errors will be written
command The command needed to compile a module with Fortran 77 (eg f77 -c)
Makes a searchable archive library of object files out of the contents of xxxmk4.f. It will be called xxxmk4.a and will be moved to the library directory.
NB It makes no sense to run maklib with the parts containing main programs i.e. MAI and PMA.
If splitting
name the name of a directory in which the Fortran modules will be placed. If it doesn't exist it will be created.
Splits the contents of xxxmk4.f into individual Fortran modules (extension .f)

ccsl part [-switches] [filename]
part is one of LIB, MAI, PJB, JBF, PIG, PR, PF, PMA
switches one or more of a, c, e, l, s.
a Make a linkable archive out of a set of object files
c Split up xxxmk4.f into individual modules and compile each
e Extract part from the mistress file: parameters to be substituted are in filename
g Gets the graphics driver filename out of pigmk4.f
l Load a list of main programs: names in filename
s Split xxxmk4.f into individual fortran modules in the directory filename
filename Name of a file the use of which depends on switches as above.
Script use to build the whole or part of the system by successive calls to extract, maklib and makobj. The sources and destinations of the various files used or created are derived from part and the environment variables given in the table below.
Examples
"ccsl -ace lib parlis" will create libmk4.a from mistre.ss
"ccsl -e mai" will extract the main program file maimk4.f from mistre.ss

load [-g] prog [-switches]
Makes an executable prog out of a main program prog.f searching the CCSL library $CCSL_LIB/libmk4.a to resolve references to CCSL routines.
The switch -g will prevent optimisation and force creation of a symbol table for debugging purposes.
switches are needed for graphics programs
-g Link with the PGPLOT library
-pg Link with the CCSL plotting plotting routines specified in the file $CCSL_OPT/graphics_choices.
-ps Link with the simple CCSL postscript plotting routines.
split part directory
An alias for "makobj -s part directory"
Splits partmk4.f into separate Fortran files in directory
Environment variables used for files and directories (xxx stands for part)
File Name Directory
1st choicedefault 1st choice2nd choice default
Master filemistre.ssmistre.ss $CCSL_SSSRC $CCSL_SRCcurrent
Fortran sourcexxxmk4.fxxxmk4.f $CCSL_FSRC $CCSL_SRCcurrent
Fortran destinationxxxmk4.fxxxmk4.f $CCSL_FDEST $CCSL_SRCcurrent
Symbolic parameters $CCSL_PARLISTparlist $CCSL_OPT$CCSL/optionscurrent
Fortran commands f77_choices- $CCSL_OPT$CCSL/optionscurrent
Graphics libraries Graphics_choices - $CCSL_OPT$CCSL/optionscurrent
Programs to compilefilenamelist_of_progs current$CCSL_OPT$CCSL/options
Libraries $xxxmk4.axxxmk4.a $CCSL_LIB$CCSL/lib./lib

Setting Aliases

The scripts to execute all the commands given above are held in the directory given by the environment variable $CCSL_PERL. There is a file "aliases" in the CCSL root directory which defines the commands get,extract, makobj, load and split as aliases to these scripts. Inserting a command to source this file in your .cshrc file should set up these aliases.

Loading graphics programs

The command to load a CCSL graphics program typically has the form
 f77 gprog.f pigxxx.f $CCSLIB lgraf -o gprog
 
where gprog is the name of the program and xxx is the mnemonic for the graphics driver eg tek. the module "pigxxx.f" contains a subroutine piglet which includes all the driver dependent commands for ccsl graphics. "graf" is the name of the system library for that driver. Some PIGLETs such as the postscript driver PIGPOS do not need this additional library.

At ILL use of the PGPLOT library is recommended. A make file which makes the fourier plotting program fourpl_pg is

# Makefile for PGPLOT programs on Silicon Graphics 
#	Fortran compiler
FCOMPL= f77 -mips3
#	Location of PGPLOT library
PGPLOT=/usr/ill/lib/libpgplot520_n32.a -lX11 
#  CCSL graphics directory
GRAF=$(CCSL_GRAF)
fourpg : fourpl.f $(CCL)/graf/pigpg.o 
	$(FCOMPL) -o fourpl_pg fourpl.f $(GRAF)/pigpg.o $(CCSLIB) $(PGPLOT) 
fourpl.o : fourpl.f
	$(FCOMPL) -c fourpl.f 	
NB Before using PGPLOT programs set the environment variable PGPLOT_DIR to /usr/ill/lib

P.J. Brown - Institut Laue Langevin, Grenoble, FRANCE. e-mail brown@ill.fr