Makefile Garfield

I want to compile a code with Garfield++(simulation application).
When i make it with this makefile:
gemseq1: gemseq1.C
g++ -c -O3 root-config --cflags -I$(GARFIELD_HOME)/Include gemseq1.C
g++ root-config --glibs -lgfortran -lm -lz -o gemseq1 gemseq1.o $(GARFIELD_HOME)/Library/libGarfield.a
rm gemseq1.o
my system responds like this:

magboltz-9.01.f:(.text+0xe93e8): undefined reference to _gfortran_transfer_real' magboltz-9.01.f:(.text+0xe93f9): undefined reference to_gfortran_transfer_real’
magboltz-9.01.f:(.text+0xe940a): undefined reference to _gfortran_transfer_real' /home/ali/garfield/Library/libGarfield.a(magboltz.o):magboltz-9.01.f:(.text+0xe941b): more undefined references to_gfortran_transfer_real’ follow
/home/ali/garfield/Library/libGarfield.a(magboltz.o): In function readin_': magboltz-9.01.f:(.text+0xe9445): undefined reference to_gfortran_st_read_done’
magboltz-9.01.f:(.text+0xe9484): undefined reference to _gfortran_st_read' magboltz-9.01.f:(.text+0xe9496): undefined reference to_gfortran_transfer_real’
magboltz-9.01.f:(.text+0xe94ae): undefined reference to _gfortran_transfer_real' magboltz-9.01.f:(.text+0xe94bf): undefined reference togfortran_transfer_real’
magboltz-9.01.f:(.text+0xe94c7): undefined reference to _gfortran_st_read_done' /home/ali/garfield/Library/libGarfield.a(magboltz.o): In functionmagboltz2
magboltz-9.01.f:(.text+0xe97ce): undefined reference to `_gfortran_stop_string’
collect2: error: ld returned 1 exit status
make: *** [gemseq1] Error 1

Any help will be appreciated,


this does not seem to be a ROOT related issue, rather a compilation one.
Out of curiosity, did you try link using gfortran?



g++ `root-config --cflags` -o gemseq1 gemseq1.o $(GARFIELD_HOME)/Library/libGarfield.a `root-config --glibs` -lgfortran -lm -lz


g++ `root-config --ldflags` -o gemseq1 gemseq1.o $(GARFIELD_HOME)/Library/libGarfield.a `root-config --glibs` -lgfortran -lm -lz

Thanks it worked

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.