Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/workflows/centos7/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM centos:7.8.2003

# Copies your code file from your action repository to the filesystem path `/` of the container
COPY entrypoint.sh /entrypoint.sh

# Code file to execute when the docker container starts up (`entrypoint.sh`)
ENTRYPOINT ["/entrypoint.sh"]
15 changes: 15 additions & 0 deletions .github/workflows/centos7/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: 'Compile GEANT4'
description: 'GEANT4'
inputs:
who-to-greet: # id of input
description: 'Set something'
required: true
default: 'Hi !'
outputs:
time: # id of output
description: 'Some result'
runs:
using: 'docker'
image: 'Dockerfile'
args:
- ${{ inputs.who-to-greet }}
23 changes: 23 additions & 0 deletions .github/workflows/centos7/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/sh -l
set -x
uname -a
cat /etc/issue
yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
yum -y install gcc gcc-c++ gcc-gfortran make which
yum -y install cmake3 cmake3-data
yum -y install HepMC3*
#yum -y install lapack-static lapack-devel lapack gengetopt blas-devel blas atlas-devel atlas
#yum -y install libX11-devel libX11 libXmu-devel libXmu libXau-devel libXau libXcursor-devel libXcursor libSM-devel libSM libICE libICE-devel libXext-devel libXext
#yum -y install root-*6* --exclude=*doc* --exclude=*debug* --skip-broken

#sh GEANT4install.sh



#yum -y install pythia8-devel pythia8 pythia8-data


#sh GEANT4test.sh

out=$?
echo ::set-output name=out::$out
7 changes: 7 additions & 0 deletions .github/workflows/centos8/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM centos:8

# Copies your code file from your action repository to the filesystem path `/` of the container
COPY entrypoint.sh /entrypoint.sh

# Code file to execute when the docker container starts up (`entrypoint.sh`)
ENTRYPOINT ["/entrypoint.sh"]
15 changes: 15 additions & 0 deletions .github/workflows/centos8/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: 'Compile GEANT4'
description: 'GEANT4'
inputs:
who-to-greet: # id of input
description: 'Set something'
required: true
default: 'Hi !'
outputs:
time: # id of output
description: 'Some result'
runs:
using: 'docker'
image: 'Dockerfile'
args:
- ${{ inputs.who-to-greet }}
26 changes: 26 additions & 0 deletions .github/workflows/centos8/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/sh -l
set -x
uname -a
cat /etc/issue
yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
yum -y install dnf-plugins-core
#dnf config-manager --set-enabled PowerTools
#dnf config-manager --set-enabled powertools
yum -y install gcc gcc-c++ gcc-gfortran make which cmake cmake-data cmake-filesystem
yum -y install HepMC3 HepMC3-devel HepMC HepMC-devel
yum -y install yum-plugin-copr
yum -y copr enable averbyts/HEPrpms
yum -y install clhep clhep-devel PTL-devel redhat-rpm-config expat expat-devel zlib zlib-devel pythia6 lhapdf lhapdf-devel
#yum -y install pythia8-devel pythia8 pythia8-data


export FC=gfortran
export FCFLAGS=
mkdir -p test
cd test
cmake -B. -S ../examples/extended/eventgenerator -DGeant4_DIR=/usr/lib64/Geant4-10.7.0 -DHepMC3_DIR=/usr/share/HepMC3/cmake -DCMAKE_Fortran_FLAGS=-fPIC -DCMAKE_C_FLAGS=-fPIC -DCMAKE_CXX_FLAGS=-fPIC
make -j 2


out=$?
echo ::set-output name=out::$out
7 changes: 7 additions & 0 deletions .github/workflows/fedora35/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM fedora:35

# Copies your code file from your action repository to the filesystem path `/` of the container
COPY entrypoint.sh /entrypoint.sh

# Code file to execute when the docker container starts up (`entrypoint.sh`)
ENTRYPOINT ["/entrypoint.sh"]
15 changes: 15 additions & 0 deletions .github/workflows/fedora35/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: 'Compile GEANT4'
description: 'GEANT4'
inputs:
who-to-greet: # id of input
description: 'Set something'
required: true
default: 'Hi !'
outputs:
time: # id of output
description: 'Some result'
runs:
using: 'docker'
image: 'Dockerfile'
args:
- ${{ inputs.who-to-greet }}
22 changes: 22 additions & 0 deletions .github/workflows/fedora35/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/sh -l
set -x
uname -a
cat /etc/issue
yum -y install dnf-plugins-core
yum -y install gcc gcc-c++ gcc-gfortran make which cmake cmake-data cmake-filesystem
yum -y install HepMC3 HepMC3-devel HepMC HepMC-devel
yum -y install yum-plugin-copr
yum -y copr enable averbyts/HEPrpms
yum -y install geant4 geant4-devel clhep clhep-devel PTL-devel expat expat-devel zlib zlib-devel pythia6 lhapdf lhapdf-devel
#yum -y install pythia8-devel pythia8 pythia8-data

export FC=gfortran
export FCFLAGS=
mkdir -p test
cd test
cmake -B. -S ../examples/extended/eventgenerator -DGeant4_DIR=/usr/lib64/Geant4-10.7.0 -DHepMC3_DIR=/usr/share/HepMC3/cmake -DCMAKE_Fortran_FLAGS=-fPIC -DCMAKE_C_FLAGS=-fPIC -DCMAKE_CXX_FLAGS=-fPIC
make -j 2


out=$?
echo ::set-output name=out::$out
60 changes: 60 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: build
on:
push:
pull_request:
schedule:
#Every 50 days at midnight
- cron: "0 0 1/600 * *"

jobs:
# compilejobCentOS7:
# if: "!contains(github.event.head_commit.message, 'skip ci')"
# runs-on: ubuntu-latest
# name: Geant4_on_CentOS7
# steps:
# - name: Checkout
# uses: actions/checkout@v2
# - name: Compile
# id: compileindocker
# uses: ./.github/workflows/centos7
# - name: Get the output status
# run: exit ${{ steps.compileindocker.outputs.out }}

compilejobFedora35:
if: "!contains(github.event.head_commit.message, 'skip ci')"
runs-on: ubuntu-latest
name: Geant4_on_Fedora35
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Compile
id: compileindocker
uses: ./.github/workflows/fedora35
- name: Get the output status
run: exit ${{ steps.compileindocker.outputs.out }}

#compilejobCentOS8:
#if: "!contains(github.event.head_commit.message, 'skip ci')"
#runs-on: ubuntu-latest
#name: Geant4_on_CentOS8
#steps:
#- name: Checkout
#uses: actions/checkout@v2
#- name: Compile
#id: compileindocker
#uses: ./.github/workflows/centos8
#- name: Get the output status
#run: exit ${{ steps.compileindocker.outputs.out }}



# compilejobOSX:
# if: "!contains(github.event.head_commit.message, 'skip ci')"
# runs-on: macos-latest
# name: Geant4_on_OSX
# steps:
# - name: Checkout
# uses: actions/checkout@v2
# - name: Compile
# id: compile
# run: ./.github/workflows/osx/entrypoint.sh
17 changes: 17 additions & 0 deletions .github/workflows/osx/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/sh -l
set -x
brew install wget coreutils gcc
brew tap davidchall/hep
brew install hepmc3
brew cask install xquartz
#wget --no-verbose https://root.cern/download/root_v6.22.02.macosx64-10.15-clang110.tar.gz
#tar -zxf root_v6.22.02.macosx64-10.15-clang110.tar.gz
#. root/bin/thisroot.sh

#sh jadeinstall.sh



#brew install pythia8

#sh jadetest.sh
29 changes: 29 additions & 0 deletions cmake/Modules/FindLHAPDF.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# - Locate LHAPDF library
# in a directory defined via LHAPDF_ROOT_DIR or LHAPDF_DIR environment variable
# Defines:
#
# LHAPDF_FOUND
# LHAPDF_INCLUDE_DIR
# LHAPDF_INCLUDE_DIRS (not cached)
# LHAPDF_LIBRARIES

find_path(LHAPDF_INCLUDE_DIR LHAPDF.h
HINTS $ENV{LHAPDF_ROOT_DIR}/include ${LHAPDF_ROOT_DIR}/include
$ENV{LHAPDF_DIR}/include ${LHAPDF_DIR}/include)

find_library(LHAPDF_LIBRARIES NAMES LHAPDF
HINTS $ENV{LHAPDF_ROOT_DIR}/lib ${LHAPDF_ROOT_DIR}/lib
HINTS $ENV{LHAPDF_DIR}/lib ${LHAPDF_DIR}/lib
HINTS $ENV{LHAPDF_ROOT_DIR}/lib64 ${LHAPDF_ROOT_DIR}/lib64
HINTS $ENV{LHAPDF_DIR}/lib64 ${LHAPDF_DIR}/lib64
)


set(LHAPDF_INCLUDE_DIRS ${LHAPDF_INCLUDE_DIR})

# handle the QUIETLY and REQUIRED arguments and set LHAPDF_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LHAPDF DEFAULT_MSG LHAPDF_INCLUDE_DIR LHAPDF_LIBRARIES)

mark_as_advanced(LHAPDF_FOUND LHAPDF_INCLUDE_DIR LHAPDF_LIBRARIES)
2 changes: 1 addition & 1 deletion environments/g4py/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# In particular, Geant4Py must be matched exactly to a given Geant4 release

# Require Python 3 or newer, calling Interp before Libs to help find a consistent set
# Boost python requirement is reliant on correct user config (not yet known how to check
# Boost python3 requirement is reliant on correct user config (not yet known how to check
# which Python an install of Boost Python uses)...
find_package(PythonInterp 3.0 REQUIRED)
find_package(PythonLibs REQUIRED)
Expand Down
13 changes: 12 additions & 1 deletion examples/extended/eventgenerator/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

cmake_minimum_required(VERSION 3.16...3.21)

set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/Modules ${CMAKE_MODULE_PATH})
find_package(Geant4)
include(${Geant4_USE_FILE})

Expand All @@ -21,10 +22,20 @@ else()
message(STATUS "G4 Examples: HepMC package not found. --> HepMC examples disabled.")
endif()

#----------------------------------------------------------------------------
# HepMC3 examples require HepMC3
#
find_package(HepMC3)
if(HepMC3_FOUND)
add_subdirectory(HepMC3)
else()
message(STATUS "G4 Examples: HepMC3 package not found. --> HepMC3 examples disabled.")
endif()

#----------------------------------------------------------------------------
# decayer6 example requires Pythia6
#
find_package(Pythia6 QUIET)
find_package(Pythia6)
if(PYTHIA6_FOUND)
add_subdirectory(pythia/decayer6)
else()
Expand Down
19 changes: 16 additions & 3 deletions examples/extended/eventgenerator/HepMC/HepMCEx01/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,24 @@ find_package(HepMC REQUIRED)
# Find Pythia6 (optional package)
#
find_package(Pythia6 QUIET)
SET(OLD_CMAKE_POSITION_INDEPENDENT_CODE ${CMAKE_POSITION_INDEPENDENT_CODE})
SET(CMAKE_POSITION_INDEPENDENT_CODE ON)
message("Flags ${CMAKE_Fortran_FLAGS}" )
include(CheckLanguage)
check_language(Fortran)
SET(CMAKE_POSITION_INDEPENDENT_CODE ${OLD_CMAKE_POSITION_INDEPENDENT_CODE})
if(PYTHIA6_FOUND)
message(STATUS "G4 Examples: Pythia6 found. --> HepMCEx01 example with Pythia6 enabled.")
add_definitions(-DG4LIB_USE_PYTHIA)
add_definitions(-DG4LIB_USE_PYTHIA)
enable_language(Fortran)
set (generator_sources
${PROJECT_SOURCE_DIR}/external/upevnt.F
${PROJECT_SOURCE_DIR}/external/upinit.F
${PROJECT_SOURCE_DIR}/external/upveto.F
)
else()
set(PYTHIA6_LIBRARIES "")
set (generator_sources "")
endif()

#----------------------------------------------------------------------------
Expand All @@ -48,13 +61,13 @@ file(GLOB headers ${PROJECT_SOURCE_DIR}/include/*.hh)
#----------------------------------------------------------------------------
# Add the executable, and link it to the Geant4 libraries
#
add_executable(HepMCEx01 HepMCEx01.cc ${sources} ${headers})
add_executable(HepMCEx01 HepMCEx01.cc ${sources} ${headers} ${generator_sources})
#target_link_libraries(HepMCEx01 ${Geant4_LIBRARIES}
# ${HEPMC_LIBRARIES} ${HEPMC_FIO_LIBRARIES}
# ${PYTHIA6_LIBRARIES} gfortran)
target_link_libraries(HepMCEx01 ${Geant4_LIBRARIES}
${HEPMC_LIBRARIES} ${HEPMC_FIO_LIBRARIES}
${PYTHIA6_LIBRARIES})
${PYTHIA6_LIBRARIES} LHAPDF gfortran)

# if pythia is compiled with g77, link with -lg2c instead.
#target_link_libraries(HepMCEx01 ${Geant4_LIBRARIES}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@

C*********************************************************************

C...UPEVNT
C...Dummy routine, to be replaced by a user implementing external
C...processes. Depending on cross section model chosen, it either has
C...to generate a process of the type IDPRUP requested, or pick a type
C...itself and generate this event. The event is to be stored in the
C...HEPEUP commonblock, including (often) an event weight.

SUBROUTINE UPEVNT

C...Double precision and integer declarations.
IMPLICIT DOUBLE PRECISION(A-H, O-Z)
IMPLICIT INTEGER(I-N)

C...User process event common block.
INTEGER MAXNUP
PARAMETER (MAXNUP=500)
INTEGER NUP,IDPRUP,IDUP,ISTUP,MOTHUP,ICOLUP
DOUBLE PRECISION XWGTUP,SCALUP,AQEDUP,AQCDUP,PUP,VTIMUP,SPINUP
COMMON/HEPEUP/NUP,IDPRUP,XWGTUP,SCALUP,AQEDUP,AQCDUP,IDUP(MAXNUP),
&ISTUP(MAXNUP),MOTHUP(2,MAXNUP),ICOLUP(2,MAXNUP),PUP(5,MAXNUP),
&VTIMUP(MAXNUP),SPINUP(MAXNUP)
SAVE /HEPEUP/

RETURN
END
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@

C*********************************************************************

C...UPINIT
C...Dummy routine, to be replaced by a user implementing external
C...processes. Is supposed to fill the HEPRUP commonblock with info
C...on incoming beams and allowed processes.

SUBROUTINE UPINIT

C...Double precision and integer declarations.
IMPLICIT DOUBLE PRECISION(A-H, O-Z)
IMPLICIT INTEGER(I-N)

C...User process initialization commonblock.
INTEGER MAXPUP
PARAMETER (MAXPUP=100)
INTEGER IDBMUP,PDFGUP,PDFSUP,IDWTUP,NPRUP,LPRUP
DOUBLE PRECISION EBMUP,XSECUP,XERRUP,XMAXUP
COMMON/HEPRUP/IDBMUP(2),EBMUP(2),PDFGUP(2),PDFSUP(2),
&IDWTUP,NPRUP,XSECUP(MAXPUP),XERRUP(MAXPUP),XMAXUP(MAXPUP),
&LPRUP(MAXPUP)
SAVE /HEPRUP/

RETURN
END
Loading