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 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:
libshift.so
is stored in /usr/lib/
.
Skip the next few steps if this is the case.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.
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
.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.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.
Hints for compiling on systems other than SLC supplied by users of Garfield:
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.
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.
garfield-7.car
;heed101garf.car
;magboltz-2.car
;magboltz-3.car
;magboltz-7.car
;
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).
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:
garfield-e.cra
,
and part 2,
to be called garfadd-e.cra
,
for AIX 4.2 using the ESSL libraries;garfield-g.cra
,
and part 2,
to be called garfadd-g.cra
,
for a debugging version on AIX 4.2;garfield-7.cra
;garfield-7.cra
;garfield-7.cra
;garfield-7.cra
,
and part 2,
to be called garfadd-7.cra
,
for Linux.Cradle files for Garfield version 8:
Cradle files for Garfield version 9:
garfield-9.cra
,
and part 2,
to be called garfadd-9.cra
,
for Linux;
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.
patchy_step
and to be given execute rights: chmod +x patchy_step
.The make files contain rules for making several things:
make garfield-9
,
on all systems;make garfboinc-9
;make help
, see below;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.
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:
garfield.rawhelp
on Unix systems and
GARFIELD.HLP
on Alpha OpenVMS;help_input
.
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
.
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:
garfield.rawhelp
;hlp_html.f
(this is an extensively modified version of a
program
written by A. Daviel, Triumf);headers
;top
(some browsers will try to format this file);tail
;style.css
.
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.
Front-end programs currently exist for Alpha OpenVMS and for Unix.
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:
GARFRUN.FOR
,
to be edited to ensure the file names of the executables are correct,
and to be compiled;GARFRUNMSG.MSG
and to be processed with MESSAGE/OBJ
;GARFIELDCLD.CLD
and to be processed with SET COMMAND /OBJ
;GARFRUN.HLP
,
and to be converted into a help library with the command
LIBR/CREATE/HELP GARFRUN GARFRUN
.Each should be compiled, then linked as follows:
The help library GARFRUN.HLB
should be placed in the system
help library extensions.
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.