Source files 

Garfield files

Overview

Executables are publicly available on the CERN central computers. You therefore usually do not have to compile Garfield yourself. The same holds when you use a computer outside which has access to AFS and which runs the same operating system version as at CERN (currently SLC5 and SLC6). Elsewhere, you can either try to use one of the executables provided on this page, or compile the program yourself.

Executables

Executables of version 9, compressed with gzip and encoded with uuencode,:

To decode these files, you first have to apply uudecode and then gunzip. After applying uudecode, depending on the operating system you are using, you may already obtain a file called garfield-9. If this is the case, then you have to rename this file to garfield-9.gz before applying gunzip.

The neBEM field calculation program, interfaced with Garfield, calls GSL and CBLAS. These libraries must be installed before you can run Garfield. Since April 2011, Garfield is distributed for 64-bit processors only and there is therefore no need anymore for a special compilation of GSL.

Since 26/11/2008, Garfield is linked without reference to libshift.so but some systems still require the presence of such a file. The procedure to follow in case the executable does not run because the shared library libshift.so can't be found, is as follows:

  1. Check whether a file called libshift.so is stored in /usr/lib/. Skip the next few steps if this is the case.
  2. Obtain the file libshift.so from http://cern.ch/Anaphe/download/libshift.so or obtain a specific release from ftp://root.cern.ch/root/shift/, or use libshift.so.2.1. Create, if needed, a symbolic link called libshift.so to the file that has been copied.
  3. At CERN, libshift.so is stored in /usr/lib/, but you may store it elsewhere; ensure that the directory where the file is kept appears in your load library path environment variable, LD_LIBRARY_PATH.
  4. Next, try and start Garfield. Perhaps, the executable refuses to start with a message like the following:
    garfield-9: error while loading shared libraries: libshift.so.2.1: cannot open shared object file: No such file or directory
    This indicates that you've a different version of the libshift.so file than the one used to link Garfield at CERN. To solve this, create (in the same directory) a symbolic link called libshift.so.2.1 to the libshift.so file that you have copied.

Compiling

The source files are listed below. These are needed on all systems, but may need modifications for systems other than the only Unix system supported by CERN, SLC. For advice,see other systems.

Other systems than SLC

Hints for compiling on systems other than SLC supplied by users of Garfield:

Main program

Garfield interfaced with Heed and Magboltz is compiled using Patchy or CMZ from a set of cards files, with the help of one or more cradle files and a make file.

Cards files

The main program files of Garfield, Heed and Magboltz are the same for all machines. One needs all 3 programs to build a complete executable. When updating, it is advisable to take fresh copies of the 3 programs.

You currently have the choice between building version 7, version 8 and version 9. The Heed and Garfield files are the same for all 3, but the Magboltz file is different.

To ensure that the files are complete, please check that the last line of each .car file contains either the word +QUIT. or a clear statement that it is indeed the end of the file.

Please bear in mind that these are links to my private copies of the files - they can be changed at any time and there is no guarantee that the files are even compileable. It is wise therefore to contact me before copying any of these files. I try not to leave known errors in the files overnight. The best time to copy them is therefore between 8 AM and 12 AM Geneva time.

The Heed and Magboltz files to which the above links point, are modified versions with an interface for use with Garfield. They are not the original files from the authors. To obtain these, and to obtain the Monte Carlo version of Magboltz, please contact Igor Smirnov (Heed) and Steve Biagi (Magboltz).

Cradle files

These differ from computer to computer and they may need modifications if the cards files are not located in the current working directory.

Cradle files contain statements which instruct Patchy to generate a compiler input file for a specific environment. Some of the statements define file locations, others are control flags. Both should be inspected before compiling. (Garfield requires only the functionality of Patchy version 4, not the features of Patchy version 5.)

Cradle files for Garfield version 7:

Cradle files for Garfield version 8:

Cradle files for Garfield version 9:

Make files

Like the cradles, the make files differ from computer to computer. These files should be called makefile on Unix and CGARF.COM on Alpha OpenVMS. The Unix make files assume your system runs AFS and will try to store the executable in a subdirectory called .@sys. You should delete the .@sys part of the directory name if you don't have AFS.

The make files contain rules for making several things:

Libraries and pre-processors

Garfield relies on the CERN program library for pre-processors (either ypatchy or nypatchy, and fcasplit) and for subroutines. These can be downloaded from http://cern.ch/cernlib.

On-line help file

Access from within Garfield

The on-line help file is written in the Vax/VMS .HLP format and needs a conversion before it can be used by Garfield. On Alpha OpenVMS, this is accomplished with the command: LIBR/CREATE/HELP GARFIELD GARFIELD. On other computers, one first needs to compile Garfield. Then one can either use make help or start Garfield and read in the conversion file. One needs:

In order to make the formatted help file visible to Garfield on Unix systems, you have to place a link to it, called garfield.packhelp or .garfield.packhelp, in your home directory or in your current working directory. If no such link is found, then an attempt is made to access the CERN copy of the file via AFS. On Alpha OpenVMS you have to call the logical GARFIELD.HLB.

Access via WWW

The help file can also be browsed via WWW. For this purpose, numerous formatting instructions have been inserted in the raw help file, most of which start with !W. They are considered comment lines when the file is formatted for on-line use. The HTML version of the help file is made using:

The initialisation file

When Garfield is started, the program tries to read an initialisation file called garfinit, .garfinit, GARFINIT.DAT or similar. Such a file can contain option settings, changes in the representations of the various graphics elements but you could also use it to open a metafile. The existence of such a file is not mandatory, but some commands such as PLOT SURFACE assume that colours have been set as in these sample files:

On Unix systems, it is recommended to place the file in your home directory under the name .garfinit. You may also wish to place a modified garfinit file in some directories for use with the input files from those directories. Garfield first looks for an initialisation file in the current directory, and then only in the home directory.

User interface

Front-end programs currently exist for Alpha OpenVMS and for Unix.

Alpha OpenVMS front-end program

Garfield on Alpha/OpenVMS can be called directly, or via a front-end program that takes care of version selection, that defines the logical variable name for the help file etc. The front-end program for use with OpenVMS is composed of the following pieces:

Each should be compiled, then linked as follows:

CERNLIB KERNLIB LINK /NOTRACE GARFRUN,GARFRUNMSG,GARFIELDCLD,'LIB$'

The help library GARFRUN.HLB should be placed in the system help library extensions.

Unix

A graphical user interface has been prepared to simplify job submission with LSF at CERN. Although far from perfect, you're welcome to try:


Last updated on 20/1/2018.

Valid HTML 4.01 Strict Valid CSS!