Message: Re: setting G4LIB_USE_EXPAT Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Note Re: setting G4LIB_USE_EXPAT 

Forum: Installation and Configuration
Re: Question setting G4LIB_USE_EXPAT (Anthony Villano)
Date: 06 Feb, 2014
From: Ben Morgan <Ben Morgan>

Hi Anthony,

On Tue, 04 Feb 2014 22:36:52 GMT, Anthony Villano wrote:
> ...
> As you can see, I've selected for the EXPAT package to be compiled
> internally, because I don't want to use my system version.
> After compilation of one of my standard simulations, I get the
> following:
> /usr/bin/ld.real: cannot find -lexpat collect2: ld returned 1 exit
> status
> Obvious: The linker is trying to find the EXPAT shared object file and
> can't. Since I knew this was supposed to be compiled with Geant4 I poked
> around in the libraries that it created and found
> Presumably this is the library, with 'G4' appended to let me know it was
> compiled with Geant, and also maybe so that my system doesn't get
> confused. Question then became, why are the internal Geant make files
> (which I deduced were responsible for creating the link line) using
> -lG4expat instead of -lexpat?
> Looking into 'binmake.gmk' which is included into my user-defined
> top-level GNU make file (a simulation which I originally coded for
> v4.9.3), I found the following line:
>     LDLIBS2 += -lG4expat
> endif
> Which shows me that if I set the G4LIB_USE_EXPAT variable, then I'll
> probably use the correct link statement, indeed this worked.
> Question is, why was this variable not set by my automatic G4 setup
> script? Presumably it 'knew' that I choose for EXPAT to be compiled with
> Geant4. More concretely, why did I have to do:

This looks to be a bug in the configuration of the shell scripts. Duly noted, and should be fixed in upcoming patch(es).

> Incidentally, I'm not sure why I had to source both of the above scripts
> anyway. The first one only set the data paths, not G4INSTALL and
> similar. Actually I just checked and the second one sets the data paths
> as well, so I could just do:
> source
> /path/to/geant4.10.00-install/share/Geant4-10.0.0/geant4make/

If you are using the Geant4 makefile system to build your application then you can just source the the file. The division into two scripts is deliberate so that provides a minimal setup (executable/library/data paths), and provides the full "development" setup. As the latter makes fairly major changes to the environment, it's kept separate for the specific use case of "building Geant4 applications using the Geant4 makefiles".



Inline Depth:
 1 1
 All All
Outline Depth:
 1 1
 2 2
 All All
Add message: (add)

1 None: Re: setting G4LIB_USE_EXPAT   (Ben Morgan - 06 Feb, 2014)
 Add Message Add Message
to: "Re: setting G4LIB_USE_EXPAT"

 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 ]