Problem 1290 - Filter /usr/include from include paths before creating geant4-config
Summary: Filter /usr/include from include paths before creating geant4-config
Status: CLOSED FIXED
Alias: None
Product: Geant4
Classification: Unclassified
Component: cmake (show other problems)
Version: 9.5
Hardware: All All
: P1 trivial
Assignee: Ben Morgan
URL:
Depends on:
Blocks:
 
Reported: 2012-02-21 18:03 CET by suhl
Modified: 2012-11-14 13:06 CET (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this problem.
Description suhl 2012-02-21 18:03:58 CET
Hi,

I used cmake to configure geant4.9.5 on a linux system using the following options:

cmake ../geant4.9.5 -DGEANT_USE_G3TOG4=ON -DGEANT4_USE_OPENGL_X11=ON -DCMAKE_INSTALL_PREFIX=../geant4.9.5-install -DGEANT4_INSTALL_DATA=ON -DGEANT4_USE_GDML=ON

The geant4-config script then prints the following cflags:
$ geant4-config
-DG4INTY_USE_XT -I/usr/include -DG4VIS_USE_OPENGL -DG4UI_USE_TCSH -DG4VIS_USE_OPENGLX -I[…]/geant4.9.5-install/bin/../include/Geant4 -I/usr/include

This cflags contain the /usr/include directory twice, once because I am using the X11 OpenGL visualizer, and the second time due to using GDML (or xerces).

Having /usr/include in the include path is inconvenient for a number of reasons:
1.) as a default directory it is not required to be in the list of directories given to the compiler
2.) (depending on the order of options passed to the compiler) one cannot specify to use a library that is installed outside the system directories (outside /usr), if the same library is also installed in /usr, because the wrong header files might be used
3.) having /usr/include in the include path messes up the generation of dictionaries with ROOT's rootcint. Apparently here 1.) comes into play, as this program uses some modified versions of some STL headers, which are not used if the originals in /usr/include are found via the include path.

Therefore I would ask to modify the generation of the geant4-config script in a way that the /usr/include directory does not end up in the printed cflags.

Best regards,
        Sebastian
Comment 1 Ben Morgan 2012-09-14 09:13:21 CEST
Marking as high priority for 9.6 release
Comment 2 Ben Morgan 2012-11-14 13:06:28 CET
Fixed as of tag cmake-V09-05-69, will be in 9.6