|Message: Problem building geant4.9.5.b01 with Qt using CMake||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)|
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/Geant220.127.116.11/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.
|Inline Depth:||Outline Depth:||Add message:|