After struggling for a while, I managed to install garfield (With important help of dinofelis) and decided to share my experince on compiling garfield on Ubuntu 10.04.
For information of garfield: http://garfield.web.cern.ch/garfield/
If you don't have it yet, install gfortran
Code:
sudo apt-get install gfortran
install cernlib,libgsl from repositories
Code:
sudo apt-get install cernlib libgsl0-dev nypatchy
Create a directory (lets say /home/username/garfield/) and copy all necessary files from website to this directory:
Code:
garfield-7.car
garfadd-9.cra
garfield-9.cra
garfield.hlp
heed101garf.car
magboltz-7.car
patchy_step (It is defined as "Script to run Patchy" in the website)
(If you want another version of garfield you should download the corresponding .cra files.
Get NeBem from either its website, or the afs folders:
Code:
/afs/cern.ch/user/r/rjd/Garfield/Files/neBEM/V1.7e
For ease, copy this folder directly to your working folder as
Now the essential thing: Normaly program is written to be compiled in g77, when you use gfortran, you get an error like:
Code:
undefined reference to `iargc_'
In gfortran, instead of iargc_() there is _gfortran_iargc() function. So you need to make your compiler
recognize iargc_() as _gfortran_iargc(). To do this paste this little code into a file named
and save it somewhere in your working directory, for example: ./extras/iarg.d/gfortran_iargc.c
Code:
extern int _gfortran_iargc(void);
int iargc_()
{
return _gfortran_iargc();
}
go to this directory and compile the code as:
Code:
gfortran -c _gfortran_iargc.c
It will create the file "_gfortran_iargc.o". Note that in the makefile you'll need to set variable $DUMMYIARGCOBJ
to the location of this file.(see: makefile)
Now you are ready to compile garfield, you can use a sample makefile and modify your folder names. To compile simply write
The sample makefile is attached. YOu should change the name to makefile after downloading
Bookmarks