	NOTES ON ORGANISATION OF MRC IMAGE PROCESSING PROGRAMS 
	------------------------------------------------------
								09.03.2011

The following notes are intended to be a guide to the organisation of 
the set up for image processing programs. The directory structure adopted
is as follows:


                                   public
                                     |
				   image
                                     |
   _______________________________________________________________________
  |            |          |          |          |           |             |
source        bin        com        lib        doc        local        Ximdisp
  |            |          |          |          |           |            
 .for        .exe       scripts      |         .doc       links        
 .bld                                |
                                     |
                                     |
              ___________________________________________________
             |           |           |             |             |
         imlib2010    ifftlib    plot2klib      misclib       genlib
                     
                     



 /source  -  Fortran programs and bld files 	.for .bld.*
 /bin     -  Executables       			.exe
 /com     -  Command files     			.com
 /lib     -  Libraries         			.a  and sources
 /doc     -  Documentation     			.doc
 /local   -  Links
 /Ximdisp -  Ximdisp files and libraries
 /sleuth  -  sleuth (automatic particle detection) files

Some programs can be run by a simple command (eg label) and take all input
from the keyboard.
Some programs can be run by a command plus filename(s) (eg header filename,
fftrans filein fileout).
Some programs run by editing and then executing a command file, if
numerical parameters must be set.  There are examples of such command
files in /com  (eg trnout.com), which should be copied to a private area
for editing.

In order to set up public commands to run public programs it is necessary 
to set a link in /public/image2010/local, which points either to the executable 
file (if no parameters to be set) or to a command file (if parameters have to 
be set).  For label which requires no parameters this would be done by:

ln -s /public/image2010/bin/label.exe label

For header which requires a filename as parameter this would be done by:

ln -s /public/image2010/com/header.com header

where header.com contains:

#!/bin/csh -f                     | This invokes c-shell
#                                 | # introduces comment line (except first #!)
setenv IN $1                      | Input file set as first parameter
/public/image2010/bin/header.exe  | Execute program

It is possible to see what links have been set by:

ls -l /public/image2010/local



Compiling and linking programs.
------------------------------
The image and plotting subroutine libraries have been set up as environment
variables and so can be invoked on the fortran command line by, for example :
${IMAGELIB}/imlib2010.a or ${IMAGELIB}/plot2klib.a
Both of these also require routines in the CCP4 package which have now been
frozen into genlib (linked with ${IMAGELIB}/genlib.a)

Thus typical compile and link commands would be:

gfortran -o prog.exe prog.for ${IMAGELIB}/imlib2010.a ${IMAGELIB}/genlib.a
gfortran -o prog.exe prog.for ${IMAGELIB}/imlib2010.a ${IMAGELIB}/plot2klib.a \
                              ${IMAGELIB}/genlib.a


