ROOT Garfield++ static compile

I am trying to run my executable at Batch Farm. The problem is in shared libraries which is not possible to use in Computing Farm(there must be static executable).
I found a reply for the same problem at : root.cern.ch/root/roottalk/roottalk11/1244.html
So, I installed ROOT locally and did make static. Now I have libRoot.a ~150MB. In my makefile i do the next:


OBJDIR = $(GARFIELD_HOME)/Object
SRCDIR = $(GARFIELD_HOME)/Source
INCDIR = $(GARFIELD_HOME)/Include
HEEDDIR = $(GARFIELD_HOME)/Heed
LIBDIR = $(GARFIELD_HOME)/Library

CXX           = g++
CXXFLAGS      = -g -Wall -fPIC 
LD            = g++
SOFLAGS       = shared

# Compiler flags
CFLAGS = -Wall -Wextra -Wno-long-long \
`root-config --cflags` \
-O3 -fno-common -c \
-I$(INCDIR) -I$(HEEDDIR)

# Debug flags
CFLAGS += -g

LDFLAGS = -lRoot  -lm  `root-config --glibs` -lGeom  -static  -lgfortran
LDFLAGS += -L$(LIBDIR) -lGarfield -L$(ROOTSYS)/lib
#LDFLAGS += -g

gem3: gem3.C  
$(CXX) $(CFLAGS) gem3.C
$(CXX) -o gem3 gem3.o $(LDFLAGS)
rm gem3.o

But still have error:
/usr/bin/ld: cannot find -lGui

Any suggestions?

“root-config --glibs” outputs LDFLAGS for dynamic linking (with shared libraries). I am not sure if you put it in there for some purpose or if it’s just a left-over, but you should take it out. -lRoot should contain all symbols you need.

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