|Message: expat external linking in 9.5.2 and 9.6.3||Not Logged In (login)|
Click on the Forum title, e.g. on the "Forums by Category" page, to read a sequence of postings to the Forum and its threads all in one page. If you are only interested in one thread or the thread following a specific posting, click the thread or the posting, which takes you to a smaller page, which contains only the part you are interested in and may be easier to navigate.
Messages are "chained" if there are only replies at the first level, i.e. 1/1.html, 1/1/1.html etc. In case of "chained" messages the message number is replaced by the icon and there is no indentation.
Inline: Display the subject line only or also the text of the posting(s); for the choice "All" the "Outline" choices are switched off.
|1||0||1||no text / full text of posting|
|2||1||All||text for level 1 only / text for All postings|
Outline: Choose the depth of the posting thread, successive toggle controls provide increasing detail.
|1||2||1||2 levels / 1 level (original posting)|
|2||3||2||3 levels / 2 levels|
|3||3||All||3 levels / all levels (all postings)|
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.
|Inline Depth:||Outline Depth:||Add message:|