Skip to content
Snippets Groups Projects
Commit e1e4a4d1 authored by Marco Clemencic's avatar Marco Clemencic
Browse files

v95r2p7

parent 2636a021
No related branches found
No related tags found
No related merge requests found
Showing
with 336 additions and 44 deletions
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.5)
set(Geant4_version 4.9.5.p02)
if(DEFINED ENV{G4_NATIVE_VERSION})
# Override the version of Geant4 from the variable
set(Geant4_version $ENV{G4_NATIVE_VERSION})
if(NOT Geant4_version MATCHES "^4\\.")
# G4_NATIVE_VERSION might not contain the initial '4.' that we need
# see https://its.cern.ch/jira/browse/LHCBGAUSS-43
set(Geant4_version 4.${Geant4_version})
endif()
endif()
find_package(GaudiProject)
gaudi_project(Geant4 v95r2p6)
file(MAKE_DIRECTORY ${CMAKE_INSTALL_PREFIX})
execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink ../include ${CMAKE_INSTALL_PREFIX}/include)
# FIXME: hack for compatibility with CMT build
file(WRITE ${CMAKE_BINARY_DIR}/dummy.cpp "")
link_directories(${CMAKE_INSTALL_PREFIX}/lib)
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-as-needed")
macro(back_comp_lib name)
add_library(${name} SHARED ${CMAKE_BINARY_DIR}/dummy.cpp)
add_dependencies(${name} Geant4)
target_link_libraries(${name} ${ARGN})
install(TARGETS ${name} DESTINATION lib)
endmacro()
back_comp_lib(G4processeshad G4processes)
back_comp_lib(G4externals G4zlib G4gl2ps)
include $(CMTROOT)/src/Makefile.header
include $(CMTROOT)/src/constituents.make
#============================================================================
# Created : 2014-03-06
# Maintainer : James Mccarthy
#============================================================================
package G4analysis
version v1r0
#============================================================================
# Structure, i.e. directories to process.
#============================================================================
branches cmt doc G4analysis
#============================================================================
# Used packages. Specify the version, * at the end specifies 'any revision'
# Put as many lines as needed, with all packages, without the '#'
#============================================================================
use G4run v* Geant4
#============================================================================
# Component library building rule
#============================================================================
library G4analysis ../src/*.cc
# =============================================================================
# ============ apply all mandatory patterns ===================================
# =============================================================================
apply_pattern G4AllCMTpatterns
private
apply_pattern G4_copy_source
end_private
\ No newline at end of file
v1r0
!-----------------------------------------------------------------------------
! Package : Geant4/G4analysis
! Responsible : James Mccarthy
! Purpose : Definition of analysis used in G4examples
!-----------------------------------------------------------------------------
!===================== Geant4/G4analysis v1r0 2014-07-25 =====================
! 2014-03-06 - James Mccarthy
- Added package to build library required for G4examples in Geant4 9.6
!=============================================================================
......@@ -13,7 +13,7 @@ include(ExternalProject)
ExternalProject_Add(Geant4
URL http://geant4.cern.ch/support/source/geant${Geant4_version}.tar.gz
PATCH_COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/Geant4/G4config/patches/patch_g4_sources.py ${CMAKE_SOURCE_DIR} ${Geant4_version}
PATCH_COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/patches/patch_g4_sources.py ${CMAKE_SOURCE_DIR} ${Geant4_version}
CMAKE_ARGS -DCMAKE_TOOLCHAIN_FILE=${CMAKE_SOURCE_DIR}/toolchain.cmake
-DGEANT4_INSTALL_DATA=OFF
-DGEANT4_USE_SYSTEM_CLHEP=ON
......@@ -39,3 +39,9 @@ ExternalProject_Add(Geant4
foreach(ext CLHEP EXPAT XercesC X11 OpenGL Motif)
find_package(${ext})
endforeach()
# Copy the Geant4 sources as it was done with CMT
set(G4SRC ${CMAKE_CURRENT_BINARY_DIR}/Geant4-prefix/src/Geant4/source)
set(G4DST ${CMAKE_SOURCE_DIR}/Geant4)
configure_file(copy_sources.cmake.in copy_sources.cmake @ONLY)
install(SCRIPT ${CMAKE_CURRENT_BINARY_DIR}/copy_sources.cmake)
#!/usr/bin/env csh
# JM 17/5/2013
# copy source code from Geant4 examples packages
# Currently only uses extended examples Hadr00, TestEM7, TestEM9. Can be extended to copy others
set G4EXAM = 'examples/extended'
set here = $PWD
set pack = `cmt -quiet show macro_value package | tr -d "G4"`
set parent=`cmt -quiet show macro_value package | tr -d "G4" | tr -d '[:digit:]'`
echo ${parent}
if( ${parent} == 'Hadr' ) then
set G4Dir="hadronic/"${pack}
else if( ${parent} == 'TestEm' ) then
set G4Dir="electromagnetic/"${pack}
else
echo 'Warning! Unkown package: '${pack}
set G4Dir=""
endif
set p = 'src'
set q = 'include'
cd $here/..
if !( -d ${p} ) then
mkdir -p ${p}
$G4_UNIX_COPY ${G4SHARE}/${G4EXAM}/${G4Dir}/${p}/*.* ${p}/.
$G4_UNIX_COPY ${G4SHARE}/${G4EXAM}/${G4Dir}/*.cc ./.
echo ' source files have been copied from '${G4SHARE}/${G4EXAM}/${G4Dir}
else
echo ''${p}' exists - skip copy'
endif
#copy local version of include files
if !( -d ${q}) then
mkdir -p ${q}
$G4_UNIX_COPY ${G4SHARE}/${G4EXAM}/${G4Dir}/include/*.* ${q}/.
echo ' include files have been copied from '${G4SHARE}/${G4EXAM}/${G4Dir}
else
echo ''${q}' exists - skip copy'
endif
cd $here
......@@ -9,10 +9,21 @@ cd ../../..
set incl_dir = $G4SHARE/include/
if !( -d InstallArea/include ) then
if !( -d InstallArea ) mkdir -p InstallArea
mkdir -p InstallArea
cd InstallArea
$G4_UNIX_COPY ${incl_dir} .
# MCl: there may be a symlink called 'Geant4' and pointing to '.'
# we need to avoid that it is dereferenced, but we need to preserve the structure
if ( -e include/Geant4 ) then
rm -rf include/Geant4
mkdir -p include/Geant4
$G4_UNIX_COPY ${incl_dir}. include/Geant4/.
rm -rf include/Geant4/Geant4
endif
echo ' include files have been copied from '${incl_dir}
else
echo ' include files exist - NO copy from '${incl_dir}
......
......@@ -53,11 +53,12 @@ endif
cd $here
# NKW 22/02/2014
#Not pretty but will work.
if ( $pack == "processes" ) then
echo "Copying patched CHIPS sources"
./copyPatchedSource.py
endif
#if ( $pack == "processes" ) then
# echo "Copying patched CHIPS sources"
# ./copyPatchedSource.py
#endif
unset echo
......@@ -33,7 +33,10 @@ if !( -d $p) then
if ( $p != 'externals' ) then
$G4_UNIX_COPY ${G4SRC}/${G4Dir}/${p}/*.* ${p}/.
$G4_UNIX_COPY ${G4SRC}/${G4Dir}/${p}/../include/*.* G4${pack}/.
#nkw Pick up any headers that are missing from the default share/include
$G4_UNIX_COPY ${G4SRC}/${G4Dir}/${p}/../include/*.* ../../InstallArea/include/
echo ' source files have been copied from '${G4SRC}'/'${G4Dir}
echo ' and headers also copied to InstallArea'
else
cd ${G4SRC}/${G4Dir}/$p
set list = `find . -name src -print | sed -e 's;^./;;' | sed -e 's/\/src//g'`
......
......@@ -30,7 +30,10 @@ if [ ! -d $p ]
mkdir -p $p
$G4_UNIX_COPY ${G4SRC}/${G4Dir}/${p}/*.* ${p}/.
$G4_UNIX_COPY ${G4SRC}/${G4Dir}/${p}/../include/*.* G4${pack}/.
#nkw Pick up any headers that are missing from the default share/include
$G4_UNIX_COPY ${G4SRC}/${G4Dir}/${p}/../include/*.* ../../InstallArea/include/
echo ' source files have been copied from '${G4SRC}'/'${G4Dir}
echo ' and headers also copied to InstallArea'
else
echo ${G4Dir}/${p} ' exists - skip copy'
fi
......
package G4config
version v95r2p6
version v95r2p7
branches cmt doc
......@@ -13,12 +13,12 @@ use CLHEP v* LCG_Interfaces
#==============================================================================
set G4_native_version "9.5.p02" \
override-geant4-version "${G4_NATIVE_VERSION}"
set G4VERS v95r2p6
set G4VERS v95r2p7
# =============================================================================
# set Geant4 environment variables
#=============================================================================
set G4PATH "${LCG_external}/geant4"
set G4PATH "/afs/cern.ch/sw/lcg/external/geant4"
set G4SHARE "${G4PATH}/${G4_native_version}/share"
......@@ -87,6 +87,9 @@ pattern G4_copy_hadlists_source \
pattern G4_copy_gdml_source \
apply_pattern G4_copy_pattern type=gdml
pattern G4_copy_examples_source \
apply_pattern G4_copy_pattern type=examples
private
action G4config_copy_include "$(G4CONFIGROOT)/cmt/copy_include.csh" WIN32 "$(G4CONFIGROOT)\cmt\copy_include.bat"
......
v95r2p6
v95r2p7
# Normal packages
foreach(pack analysis digits_hits event geometry global graphics_reps intercoms
materials parmodels particles physics_lists processes readout run
track tracking)
message(STATUS "Copying ${pack} sources")
execute_process(COMMAND find ( -type d -a -name src
-a -not ( -path "*test/*" -o -path "*/abla/*" ) )
#-printf "copying ${pack}/%p\\n"
-exec mkdir -p "@G4DST@/G4${pack}/{}" ";"
-exec cp -r "{}/." "@G4DST@/G4${pack}/{}" ";"
WORKING_DIRECTORY @G4SRC@/${pack})
execute_process(COMMAND find ( -type d -a -name include
-a -not ( -path "*test/*" -o -path "*/abla/*" ) )
#-printf "copying ${pack}/%p\\n"
-exec mkdir -p "@G4DST@/G4${pack}/G4${pack}" ";"
-exec cp -r "{}/." "@G4DST@/G4${pack}/G4${pack}" ";"
WORKING_DIRECTORY @G4SRC@/${pack})
endforeach()
# UI packages
foreach(pack basic common GAG)
message(STATUS "Copying interfaces/${pack} sources")
execute_process(COMMAND mkdir -p @G4DST@/G4UI${pack}/${pack}/src
@G4DST@/G4UI${pack}/G4UI${pack})
execute_process(COMMAND cp -r @G4SRC@/interfaces/${pack}/src/.
@G4DST@/G4UI${pack}/${pack}/src)
execute_process(COMMAND cp -r @G4SRC@/interfaces/${pack}/include/.
@G4DST@/G4UI${pack}/G4UI${pack})
endforeach()
# Vis packages
foreach(pack FukuiRenderer modeling OpenGL RayTracer Tree
management VRML)
if(pack STREQUAL "FukuiRenderer")
set(local_pack G4FR)
elseif(pack STREQUAL "management")
set(local_pack G4vis_management)
else()
set(local_pack G4${pack})
endif()
message(STATUS "Copying visualization/${pack} sources")
execute_process(COMMAND mkdir -p @G4DST@/${local_pack}/${pack}/src
@G4DST@/${local_pack}/${local_pack})
execute_process(COMMAND cp -r @G4SRC@/visualization/${pack}/src/.
@G4DST@/${local_pack}/${pack}/src)
execute_process(COMMAND cp -r @G4SRC@/visualization/${pack}/include/.
@G4DST@/${local_pack}/${local_pack})
endforeach()
set(pack externals)
message(STATUS "Copying visualization/${pack} sources")
execute_process(COMMAND find ( -type d -a -name src
-a -not ( -path "*test/*" -o -path "*/abla/*" ) )
#-printf "copying ${pack}/%p\\n"
-exec mkdir -p "@G4DST@/G4${pack}/{}" ";"
-exec cp -r "{}/." "@G4DST@/G4${pack}/{}" ";"
WORKING_DIRECTORY @G4SRC@/visualization/${pack})
execute_process(COMMAND find ( -type d -a -name include
-a -not ( -path "*test/*" -o -path "*/abla/*" ) )
#-printf "copying ${pack}/%p\\n"
-exec mkdir -p "@G4DST@/G4${pack}/G4${pack}" ";"
-exec cp -r "{}/." "@G4DST@/G4${pack}/G4${pack}" ";"
WORKING_DIRECTORY @G4SRC@/visualization/${pack})
# Vis packages
set(pack gdml)
message(STATUS "Copying persistency/${pack} sources")
set(local_pack G4GDML)
execute_process(COMMAND mkdir -p @G4DST@/${local_pack}/src
@G4DST@/${local_pack}/schema
@G4DST@/${local_pack}/${local_pack})
execute_process(COMMAND cp -r @G4SRC@/persistency/${pack}/src/.
@G4DST@/${local_pack}/src)
execute_process(COMMAND cp -r @G4SRC@/persistency/${pack}/schema/.
@G4DST@/${local_pack}/schema)
execute_process(COMMAND cp -r @G4SRC@/persistency/${pack}/include/.
@G4DST@/${local_pack}/${local_pack})
......@@ -4,6 +4,34 @@
! Purpose : Configuration package for Geant4 build
!-----------------------------------------------------------------------------
! ======================= G4config v95r2p7 2014-07-25 ========================
! 2014-06-27 - Gloria Corti
- Put explicit afs directory for Geant4 sources to fix issue with LCG68 while
still making it work for earlier LCG version. For details refer to
https://its.cern.ch/jira/browse/LHCBGAUSS-221
- Put back version 9.5.p02 as source, since for 9.6 tests and nightlies builds
that is done via the 'override-geant4-version' mechanism setup up by
Marco Cl.
! 2014-03-12 - Marco Clemencic
- Implemented an extra install step to emulate in CMake the way the sources
are copied to the source directories.
! 2014-03-04 - Nigel Watson
- Re-assert suppress copying of local sources.
! 2014-02-27 - James Mccarthy
- Added copy_examples_source for G4examples package
! 2014-02-26 - Nigel Watson
- Update for g4 9.6 tests, suppress copying of local sources.
! 2014-02-19 - Marco Clemencic
- Modified copy_include.csh to avoid problems with the recursive symlink
'Geant4' that appeared in 'include' starting from Geant4 9.6.
(note taht the .sh and .bat versions were not modified, since they are not
used)
! ======================= G4config v95r2p6 2013-12-19 ========================
! 2013-12-19 - Nigel Watson
- Updated Marco's (much improved, for cmake) source patching script
......
include ${LBCONFIGURATIONROOT}/data/Makefile
#============================================================================
# Created : 2014-03-03
# Maintainer : James Mccarthy
#============================================================================
package G4examples
version v4r1
#============================================================================
# Structure, i.e. directories to process.
#============================================================================
branches cmt doc extended
#============================================================================
# Used packages. Specify the version, * at the end specifies 'any revision'
# Put as many lines as needed, with all packages, without the '#'
#============================================================================
use G4Hadr00 v* Geant4/G4examples/extended/hadronic
use G4TestEm7 v* Geant4/G4examples/extended/electromagnetic
use G4TestEm9 v* Geant4/G4examples/extended/electromagnetic
include_path none
#============================================================================
# Component library building rule
#============================================================================
#library G4examples ../src/*.cpp
#============================================================================
# define component library link options
#============================================================================
#apply_pattern component_library library=G4examples
v4r1
!-----------------------------------------------------------------------------
! Package : Geant4/G4examples
! Responsible : James Mccarthy
! Purpose : Examples packages provided my Geant4, used as standalone tests
!-----------------------------------------------------------------------------
!===================== Geant4/G4examples v4r1 2014-07-25 =====================
! 2014-07-24 - Gloria Corti
- Modify requirements of subpackages to remove src and include directory
otherwise made by cmt and copy is not done since directories exist
! 2014-07-17 - Marco Clemencic
- Removed files that were not meant to be committed.
! 2014-07-16 - Gloria Corti
- Modified all requirements files to use pattern linker_library instead of
appending library to XXX_use_linkopts. This fixes compilation issues on
slc5, see details on https://its.cern.ch/jira/browse/LHCBGAUSS-193
!===================== Geant4/G4examples v4r0 2014-07-11 =====================
! 2014-03-27 - Nigel Watson
- Adapted requirements for nightly builds, following Marco Cl.'s
recommendations.
!=============================================================================
package G4TestEm7
version v4r0
branches cmt doc scripts
##################################################
# Package to run extended Geant4 example TestEm7 #
##################################################
use G4physics_lists v* Geant4
use G4analysis v* Geant4
include_dirs ../include
#------ Example TestEm7- -------
#------ Building the library -------
library G4TestEm7 $(G4LibraryFlags) ../src/*.cc
apply_pattern linker_library library=G4TestEm7
#------ Building the application ---
application testEm7 ../TestEm7.cc
#========================================================================
private
apply_pattern G4_copy_examples_source
macro_append testEm7_dependencies " G4TestEm7 "
end_private
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment