|Message: Geant4/expat.h and a new geant4-config option for include ?||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)|
I stumbled on a conflict with expat due to the fact that there is an expat.h under : <geant4_install_path>/include/Geant4 (I use the last Geant4-10.5).
Somewhere I finished, in the build of an app, to pick the Geant4/expat.h at compile time, but linked with another expat and... crashed due to incompatible versions of expat.
One problem is that, as a lot of people around, I include the Geant4 headers (for example globals.hh) with : #include "globals.hh" or : #include <globals.hh> and then use the : geant4-config --cflags to compile, which contains a "-I" toward <geant4_install_path>/include/Geant4. Which then induced to take the Geant4 expat.h for me.
After examining the build system of the app, I swapped some "-L" and had been able to run. But it is a potential fall-trap to have some quite common includes as expat.h, zlib.h, zconf.h being pointed to by the "geant4-config --cflags".
To avoid this potential problem I thought to change the code, with : #include <Geant4/globals.hh>
(which should be anyway the right way to go !). But then the "geant4-config --cflags" is no more helpful since the "-I" is not pointing to : <geant4_install_path>/include
Then, it would be great, or to prefix the expat.h, zlib.h, zconf.h with G4, which would be consistent with the G4 prefix of libG4expat and libG4zlib, or, much better and simpler, to arrange to have geant4-config be able to return a "-I" on : <geant4_install_path>/include
A lot of packages, in their "config" program separate the "-I" from the "flags" by having a "--incs" option. It is probably too late to change the today "--cflags" in geant4-config, but then I would suggest to add an option "--cflags_only" with the flags only, and a "--incs" with the "-I" pointing to : <geant4_install_path>/include for people wanting to use the : #include <Geant4/globals.hh> way of including.
(Or to have some "--cflags<something>" having the flags and the "-I" toward <geant4_install_path>/include).
(In the build system of my app, I can surely tweak the return of "--cflags" with some "sed" to change the path, but some new option would be much more clean).
To argue more for such option(s), I observe that there is a lot of files in include/Geant4 that are not prefixed with "G4" and that may clash with other packages. Being able to use the : #include <Geant4/globals.hh> way of including, by using geant4-config, would permit to handle them properly.
(And sorry for the noise, if such option in geant4-config is already in the pipe line...)