Message: expat external linking in 9.5.2 and 9.6.3 Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Question expat external linking in 9.5.2 and 9.6.3 

Forum: Installation and Configuration
Date: 23 Jun, 2014
From: Anthony Villano <Anthony Villano>

Hello,

First I'll mention the reason that I discovered some of the things I talk about below of my Geant4.9.5.p02/Geant4.9.6.p03 installations. For these versions, as far as I understand there is no option to compile an internal version of the expat library. CMake, therefore either needs to find my system installation of expat or I need to specify my own install. I did the latter because when building an application (using GNUmake) I needed to link to expat, and I was looking for a clean way to get the proper "-L" statement to go with "-lexpat." I was hoping to find a "geant4-config" that would give me this line but I didn't find it. I then became confused about how expat is linked in my code, see below.

In configuring the installs I talk about here I used the following CMake line:

$cmake -DGEANT4_BUILD_EXAMPLES=ON -DEXPAT_LIBRARY=/local/cdms/expat-2.1.0-install/lib/libexpat.so -DEXPAT_INCLUDE_DIR=/local/cdms/expat-2.1.0-install/include -DCMAKE_INSTALL_PREFIX=/local/cdms/geant4.9.6.p03-install /local/cdms/geant4.9.6.p03

As one can see I am requesting to install at the location /local/cdms/geant4.9.6.p03-install/ and requesting to use an external version of expat located in /local/cdms/expat-2.1.0-install/lib/

Looking at one of the installs I had (this fact is the same for both) I found the following:

$ldd /local/cdms/geant4.9.5.p02-build/outputs/library/Linux-g++/*.so |grep expat
	libexpat.so.1 => /local/cdms/expat-2.1.0-install/lib/libexpat.so.1 (0x00002b431b057000)
	libexpat.so.1 => /local/cdms/expat-2.1.0-install/lib/libexpat.so.1 (0x00002b06aa238000)
	libexpat.so.1 => /local/cdms/expat-2.1.0-install/lib/libexpat.so.1 (0x00002b512e069000)
	libexpat.so.1 => /local/cdms/expat-2.1.0-install/lib/libexpat.so.1 (0x00002b922ae9e000)

Which indicates, as expected, the proper expat library linking. However when I go to the install directory, I get the following:

$ldd /local/cdms/geant4.9.6.p03-install/lib64/*.so |grep expat
	libexpat.so.1 => /lib64/libexpat.so.1 (0x00002aaabe468000)
	libexpat.so.1 => /lib64/libexpat.so.1 (0x00002b2efbbba000)
	libexpat.so.1 => /lib64/libexpat.so.1 (0x00002b82b323a000)
	libexpat.so.1 => /lib64/libexpat.so.1 (0x00002abba8785000)

Which seems to indicate, that the actual installed geant ".so" files are linked to a system version of expat which was NOT indicated in my CMake command. As a matter of fact, I didn't even know I had this one and I do not have a libexpat.so simlink corresponding to the version of the expat library that is linked, this will make it hard to specify in g++ when linking an application.

My questions are:

1) Is this normal to have different linkages of an external specified library in the build and install directories? To me it seems quite odd.

2) Is there a clean way I can get the appropriate "-L" statement to go with the "-lexpat" in my applications? Of course, I want to robustly link to the version of expat that my install uses (I was thinking of trying to use ldd for that, but I shouldn't have to do that IMO) without having to do something contrived like put a simlink in my working directory and using "-L." in the GNUMakefile (what I've done to now to confirm the installation works).

3) I'm not even sure I need expat or where I need it, is there a way to confirm if I use it or not and if I can circumvent it? Obviously there is some dependency because making my application results in an error unless I include -lexpat.

Thanks! Anthony

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

1 Note: Re: expat external linking in 9.5.2 and 9.6.3   (Ben Morgan - 24 Jun, 2014)
 Add Message Add Message
to: "expat external linking in 9.5.2 and 9.6.3"

 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 ]