[Halla12_software] GEMC installation instruction and quick start guide
Lorenzo Zana
zana at jlab.org
Thu Aug 1 05:30:56 EDT 2013
For who (as me) has problems in the installation of gemc in your machine
(expecially if you have kde),
the workaround that I used is compiling using cmake and not scons . In
attachment is the CMakeList.txt file that you should use.
You will need to rename a couple of files in the hitclas , because they
are wrong and do not compile (they are a couple of examples , both
called ***examples.cc, if I remember). Just change the .cc ending with
whatever else (because that is the search pattern for the source in my
cmake file).
If you are using KDE, you will also need to recompile qt with dbus
activated, because there is some issue with the own qt of KDE when you
are running it
Just go to
....../qt/4.8.4/qt-everywhere-opensource-src-4.8.4/
and change the configuration with:
/configure -opengl -no-cups -no-phonon -prefix $QTDIR -qt-sql-mysql
-no-exceptions -opensource -release -I $MYSQINC -L $MYSQLIB -no-dwarf2
-dbus -no-svg -no-accessibility -nomake demos -nomake examples
-no-qt3support
This will enable dbus , then
make
make install
Then the compilation of gemc will not interfere with your current window
manager.
--
* Dr. Lorenzo Zana*
Research Associate
T +44 0131 650 5256 <tel:+4401316505256>
F +44 0131 650 5902 <tel:+4401316505902>
E-mail zana at jlab.org
<mailto:zana at jlab.org> Web https://userweb.jlab.org/~zana/
<https://userweb.jlab.org/%7Ezana/> The University of Edinburgh logo
<http://www.ph.ed.ac.uk/>
8211a JCMB, The King's Buildings . Mayfield road . Edinburgh EH9 3JZ
. Scotland
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://mailman.jlab.org/pipermail/halla12_software/attachments/20130801/d7c9d773/attachment-0001.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: university-of-edinburgh-logo.png
Type: image/png
Size: 198515 bytes
Desc: not available
Url : https://mailman.jlab.org/pipermail/halla12_software/attachments/20130801/d7c9d773/attachment-0001.png
-------------- next part --------------
#----------------------------------------------------------------------------
# Setup the project
#
cmake_minimum_required(VERSION 2.6 FATAL_ERROR)
project(gemc)
#----------------------------------------------------------------------------
# Find Geant4 package, activating all available UI and Vis drivers by default
# You can set WITH_GEANT4_UIVIS to OFF via the command line or ccmake/cmake-gui
# to build a batch mode only executable
#
option(WITH_GEANT4_UIVIS "Build example with Geant4 UI and Vis drivers" ON)
if(WITH_GEANT4_UIVIS)
find_package(Geant4 REQUIRED ui_all vis_all qt gdml)
else()
find_package(Geant4 REQUIRED gdml)
endif()
find_package(Qt4 4.8.4 REQUIRED QtCore QtGui QtOpenGL QtSql QtXml QtWebKit)
find_package(OpenGL)
# Loading CLHEP libraries
# CLHEP_INCLUDE_DIR PATH to the include directory
# CLHEP_LIBRARIES libraries needed
# CLHEP_LIBRARY_DIR PATH to the library directory
set(CLHEP_INCLUDE_DIR $ENV{CLHEP_BASE_DIR}/include)
set(CLHEP_LIBRARIES CLHEP)
set(CLHEP_LIBRARY_DIR $ENV{CLHEP_BASE_DIR}/lib)
# Loading EVIO libraries
# EVIO_INCLUDE_DIR PATH to the include directory
# EVIO_LIBRARIES libraries needed
# EVIO_LIBRARY_DIR PATH to the library directory
set(EVIO_INCLUDE_DIR $ENV{EVIO}/src/libsrc $ENV{EVIO}/src/libsrc++)
set(EVIO_LIBRARIES evioxx evio)
set(EVIO_LIBRARY_DIR $ENV{EVIO}/lib)
# Loading XERCESC libraries
# XERCESC_INCLUDE_DIR PATH to the include directory
# XERCESC_LIBRARIES libraries needed
# XERCESC_LIBRARY_DIR PATH to the library directory
set(XERCESC_INCLUDE_DIR $ENV{XERCESCROOT}/include)
set(XERCESC_LIBRARIES xerces-c)
set(XERCESC_LIBRARY_DIR $ENV{XERCESCROOT}/lib)
# Loading QT libraries directly, if the other one does not work
# QT_INCLUDE_DIR PATH to the include directory
# QT_LIBRARIES libraries needed
# QT_LIBRARY_DIR PATH to the library directory
#set(QT_INCLUDE_DIR $ENV{QTDIR}/include/QtCore $ENV{QTDIR}/include/QtGui $ENV{QTDIR}/include/QtOpenGL $ENV{QTDIR}/include/QtSql $ENV{QTDIR}/include/QtXml $ENV{QTDIR}/include/QtWebKit)
#set(QT_LIBRARIES QtCore QtGui QtOpenGL QtSql QtXml QtWebKit)
#set(QT_LIBRARY_DIR $ENV{QTDIR}/lib)
# Adding gl.h
# THE INCLUSION OF gl.h NEEDS TO BE DONE INCLUDING THE DIRECTORY, BECAUSE IN UBUNTU, THE INCLUSION SHOULD BE GL/gl.h
#----------------------------------------------------------------------------
# Setup Geant4 include directories and compile definitions
# Setup include directory for this project
#
include(${Geant4_USE_FILE})
include(${QT_USE_FILE})
include_directories(${PROJECT_SOURCE_DIR}/src/ ${PROJECT_SOURCE_DIR}/gui/src/ ${PROJECT_SOURCE_DIR}/physics/ ${PROJECT_SOURCE_DIR}/materials/ ${PROJECT_SOURCE_DIR}/parameters/ ${PROJECT_SOURCE_DIR}/hitprocess/ ${PROJECT_SOURCE_DIR}/hitprocess/clas12/svt/ ${PROJECT_SOURCE_DIR}/hitprocess/clas12/micromegas/ ${PROJECT_SOURCE_DIR}/hitprocess/clas12/ ${PROJECT_SOURCE_DIR}/hitprocess/Aprime/ ${PROJECT_SOURCE_DIR}/hitprocess/GlueX/ ${PROJECT_SOURCE_DIR}/hitprocess/solid/ ${PROJECT_SOURCE_DIR}/output/ ${CLHEP_INCLUDE_DIR} ${EVIO_INCLUDE_DIR} ${XERCESC_INCLUDE_DIR} ${OPENGL_INCLUDE_DIR} /usr/include/GL)
set(LINK_DIRECTORIES
${CLHEP_LIBRARY_DIR} ${EVIO_LIBRARY_DIR} ${XERCESC_LIBRARY_DIR}
)
link_directories( ${LINK_DIRECTORIES})
#----------------------------------------------------------------------------
# Locate sources and headers for this project
# NB: headers are included so they will show up in IDEs
#
file(GLOB sources ${PROJECT_SOURCE_DIR}/src/*.cc ${PROJECT_SOURCE_DIR}/gui/src/*.cc ${PROJECT_SOURCE_DIR}/physics/*.cc ${PROJECT_SOURCE_DIR}/materials/*.cc ${PROJECT_SOURCE_DIR}/parameters/*.cc ${PROJECT_SOURCE_DIR}/hitprocess/*.cc ${PROJECT_SOURCE_DIR}/hitprocess/clas12/svt/*.cc ${PROJECT_SOURCE_DIR}/hitprocess/clas12/micromegas/*.cc ${PROJECT_SOURCE_DIR}/hitprocess/clas12/*.cc ${PROJECT_SOURCE_DIR}/hitprocess/Aprime/*.cc ${PROJECT_SOURCE_DIR}/hitprocess/GlueX/*.cc ${PROJECT_SOURCE_DIR}/hitprocess/solid/*.cc ${PROJECT_SOURCE_DIR}/output/*.cc)
file(GLOB headers ${PROJECT_SOURCE_DIR}/src/*.h ${PROJECT_SOURCE_DIR}/gui/src/*.h ${PROJECT_SOURCE_DIR}/physics/*.h ${PROJECT_SOURCE_DIR}/materials/*.h ${PROJECT_SOURCE_DIR}/parameters/*.h ${PROJECT_SOURCE_DIR}/hitprocess/*.h ${PROJECT_SOURCE_DIR}/hitprocess/clas12/svt/*.h ${PROJECT_SOURCE_DIR}/hitprocess/clas12/micromegas/*.h ${PROJECT_SOURCE_DIR}/hitprocess/clas12/*.h ${PROJECT_SOURCE_DIR}/hitprocess/Aprime/*.h ${PROJECT_SOURCE_DIR}/hitprocess/GlueX/*.h ${PROJECT_SOURCE_DIR}/hitprocess/solid/*.h ${PROJECT_SOURCE_DIR}/output/*.h )
#----------------------------------------------------------------------------
# Add the executable, and link it to the Geant4 libraries
#
add_executable(gemc gemc.cc ${sources} ${headers})
set(LINK_LIBRARIES
${Geant4_LIBRARIES} ${CLHEP_LIBRARIES} ${EVIO_LIBRARIES} ${XERCESC_LIBRARIES} ${QT_LIBRARIES}
)
target_link_libraries(gemc ${LINK_LIBRARIES})
#----------------------------------------------------------------------------
# Copy all scripts to the build directory, i.e. the directory in which we
# build N02. This is so that we can run the executable directly because it
# relies on these scripts being in the current working directory.
#
#set(PREXSIM_SCRIPTS
# gui.mac
# prerun.mac
# prerunmacro.mac
# prex_prerun.mac
# run_prex.mac
# )
#foreach(_script ${PREXSIM_SCRIPTS})
# configure_file(
# ${PROJECT_SOURCE_DIR}/${_script}
# ${PROJECT_BINARY_DIR}/${_script}
# COPYONLY
# )
#endforeach()
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR})
#----------------------------------------------------------------------------
# Install the executable to 'bin' directory under CMAKE_INSTALL_PREFIX
#
install(TARGETS gemc DESTINATION bin)
More information about the Halla12_software
mailing list