Message: Solution Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Feedback Solution 

Forum: Installation and Configuration
Re: Question GEANT4 and ROOT linking (Maria Gatu Johnson)
Re: Feedback Re: GEANT4 and ROOT linking (Gunter Folger)
Re: None Re: GEANT4 and ROOT linking (Maria Gatu Johnson)
Re: Feedback Re: GEANT4 and ROOT linking (Gunter Folger)
Re: Question Re: GEANT4 and ROOT linking (Maria Gatu Johnson)
Date: 17 Dec, 2008
From: Maria Gatu Johnson <Maria Gatu Johnson>

After sending GNUmakefiles back and forth a few times I now have a solution to the problem with the include files not being found during the linking stage.

In fact, the ROOT files are found at the compilation stage if the lines

CPPFLAGS += $(shell $(ROOTSYS)/bin/root-config --cflags) EXTRALIBS += $(shell $(ROOTSYS)/bin/root-config --glibs) -lMinuit -lHtml

are present in the GNUmakefile, and my own extra ROOT libraries are found during the linking if I add the lines

CPPFLAGS += -I/home/andersh/geant4/extrarootfiles/dev EXTRALIBS += -L/home/andersh/geant4/extrarootfiles/dev -lProtonEnergy

In order for the defined EXTRALIBS to be used, I have to set

G4EXLIB := true

So, finally, a working makefile for a GEANT4-ROOT application with custom written ROOT libraries can look like this:

___________________________________________________

name := TOFOR9 G4TARGET := $(name) G4EXLIB := true

ifndef G4INSTALL
  G4INSTALL = /usr/local/src/geant4
endif 

.PHONY: all all: lib bin

CPPFLAGS += -I/home/andersh/geant4/extrarootfiles/dev EXTRALIBS += -L/home/andersh/geant4/extrarootfiles/dev -lProtonEnergy

CPPFLAGS += $(shell $(ROOTSYS)/bin/root-config --cflags) EXTRALIBS += $(shell $(ROOTSYS)/bin/root-config --glibs) -lMinuit -lHtml

include $(G4INSTALL)/config/binmake.gmk

_____________________________________________________

Thanks Ivana for all your help!

 Add Message Add Message
to: "Solution"

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews


[ Geant 4 Home | Geant 4 HyperNews | Search | Request New Forum | Feedback ]