Message: Problem building geant4.9.5.b01 with Qt using CMake Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Question Problem building geant4.9.5.b01 with Qt using CMake 

Forum: Installation and Configuration
Date: 15 Jul, 2011
From: Zach Hartwig <Zach Hartwig>

Hi everyone,

As a novice to CMake, I'm trying to build geant4.9.5.b01 with the CMake build system (in preparation for the impending migration away from the ever-so-useful "Configure" script...). However, I am encountering a difficulty when trying to build Geant4 with a non-standard-location installation of Qt, despite following the direction found in $G4TARBALL/cmake/INSTALL.g4cmake. (I should point out that my current build of geant4.9.4.p02 via the Configure script works perfectly with my Qt installation, version 4.7.2).

After creating a build directory, I run the following cmake command from within the build directory:

  cmake -DCMAKE_INSTALL_PREFIX=/home/hartwig/scratch/geant4/geant4.9.5.b01 \
        -DGEANT4_USE_QT=ON \
        -DQT_QMAKE_EXECUTABLE=/home/hartwig/scratch/qt/bin/qmake \
        -DGEANT4_USE_OPENGL_X11=ON \
        -DGEANT4_USE_RAYTRACER_X11=ON \
         /home/hartwig/scratch/geant4/geant4.9.5.b01

where I specify the location of my "qmake" executable as described in the CMake install guide. I then run:

    make -j4
    make install
    source /home/hartwig/scratch/geant4/geant4.9.5.b01/share/Geant4.9.5.0/geant4-environment-setup.sh

The cmake configure, build, and install seem perfectly successful. However, building applications that include Qt headers fail to compile, and the linker is unable to find libQtCore. Example output from trying to compile novice example N02 via the GNUmakefile distributed with that example shows:

   In file included from /home/hartwig/scratch/geant4/geant4.9.5.b01/include Geant4/G4UIExecutive.icc:38,
   from /home/hartwig/scratch/geant4/geant4.9.5.b01/include Geant4 /G4UIExecutive.hh:80,
   from exampleN02.cc:50:
   /home/hartwig/scratch/geant4/geant4.9.5.b01/include/Geant4/G4UIQt.hh:40:21: error: qobject.h: No such file or directory
   /home/hartwig/scratch/geant4/geant4.9.5.b01/include/Geant4/G4UIQt.hh:41:18: error: qmap.h: No such file or directory
   /home/hartwig/scratch/geant4/geant4.9.5.b01/include/Geant4/G4UIQt.hh:42:25: error: qstringlist.h: No such file or directory
   /home/hartwig/scratch/geant4/geant4.9.5.b01/include/Geant4/G4UIQt.hh:43:24: error: qtabwidget.h: No such file or directory
   Creating shared library /home/hartwig/geant4/tmp/Linux-g++/exampleN02 /libexampleN02.so ...
   /usr/bin/ld: cannot find -lQtCore
   collect2: ld returned 1 exit status

The "geant4-config" script seems to indicate that the correct include directory flags were passed during the build although it doesn't appear that the QtCore library was built:

  ./geant4-config --cflags
  -DG4INTY_USE_XT -I/usr/include -DG4VIS_USE_OPENGL -DG4UI_USE_TCSH 
  -DG4INTY_USE_QT -DG4UI_USE_QT -DG4VIS_USE_OPENGLQT -I/home/hartwig/scratch/qt/include/QtCore
  -I/home/hartwig/scratch/qt/include/QtGui -I/home/hartwig/scratch/qt/include/QtOpenGL 
  -DG4VIS_USE_RAYTRACERX -DG4VIS_USE_OPENGLX
  ...

  ./geant4-config --libs
  -L/mnt/scratch/hartwig/geant4/geant4.9.5.b01-build/outputs/library/Linux-g++ 
  -lG4OpenGL -lG4gl2ps -lG4Tree -lG4FR -lG4GMocren -lG4visHepRep -lG4RayTracer 
  -lG4VRML -lG4vis_management -lG4modeling -lG4interfaces -lG4persistency
  -lG4error_propagation -lG4readout -lG4physicslists -lG4run -lG4event
  -lG4tracking -lG4parmodels -lG4processes -lG4digits_hits -lG4track 
  -lG4particles -lG4geometry -lG4materials -lG4graphics_reps -lG4intercoms
  -lG4global -lG4clhep

Does anyone have any advice on why the header files and libQtCore cannot be found or library ot built? Perhaps I have missed something obvious either in the Geant4 build or in using the GNUmakefiles with the CMake build?

Thanks in advance.

~ZSH

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

1 Feedback: Re: Problem building geant4.9.5.b01 with Qt using CMake   (Ben Morgan - 17 Jul, 2011)
1 Agree: Re: Problem building geant4.9.5.b01 with Qt using CMake   (Zach Hartwig - 18 Jul, 2011)
(_ Note: Re: Problem building geant4.9.5.b01 with Qt using CMake   (Ben Morgan - 18 Jul, 2011)
(_ Ok: Re: Problem building geant4.9.5.b01 with Qt using CMake   (Zach Hartwig - 18 Jul, 2011)
2 Question: Re: Problem building geant4.9.5.b01 with Qt using CMake   (Batom - 04 Nov, 2012)
 Add Message Add Message
to: "Problem building geant4.9.5.b01 with Qt using CMake"

 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 ]