Experimental binary packages for CentOS Stream 8

Hi, I created some experimental binary packages of Geant4 11.0.1 for CentOS Stream 8 and would like to get feedback from the community ahead of next release, so that we can maybe offer binary releases like this officially in the future for the most common platforms. In order to install the experimental Geant4 binary packages, please follow the instructions below:

  1. Create a repository configuration for Geant4:

Create a file named /etc/yum.repos.d/geant4.repo with the following contents:

[geant4]
name=Geant4 Collaboration
baseurl=http://lcgpackages.web.cern.ch/lcgpackages/test/geant4
enabled=1
gpgcheck=0
priority=10
  1. Install epel-release with dnf install -y epel-release

Geant4 must depend on epel-release because xerces-c is only available there and is needed for GDML support in Geant4.

  1. Install Geant4 with dnf install -y geant4-devel

Note that the main package provides only the libraries without headers. Installing geant4-examples or geant4-devel will pull all dependencies needed to build your own projects against Geant4. If you create your own binary and distribute it pre-compiled, then only the geant4 package will be required to run it.

  1. Try to build your package using Geant4

For example, below I show how to build TestEm3 using the geant4-examples package:

$ sudo dnf install geant4-examples
...
$ cmake -S /usr/share/geant4/examples/extended/electromagnetic/TestEm3 -B TestEm3-build
-- The C compiler identification is GNU 8.5.0
-- The CXX compiler identification is GNU 8.5.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found EXPAT: /usr/lib64/libexpat.so (found suitable version "2.2.5", minimum required is "2.2.5") 
-- Found ZLIB: /usr/lib64/libz.so (found suitable version "1.2.11", minimum required is "1.2.11") 
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Check if compiler accepts -pthread
-- Check if compiler accepts -pthread - yes
-- Found Threads: TRUE  
-- Found TBB: /usr (found suitable version "2018.0", minimum required is "2018.0")  
-- Found XercesC: /usr/lib64/libxerces-c.so (found suitable version "3.2.2", minimum required is "3.2.2") 
-- Found Freetype: /usr/lib64/libfreetype.so (found suitable version "2.9.1", minimum required is "2.9.1") 
-- Found X11: /usr/include   
-- Looking for XOpenDisplay in /usr/lib64/libX11.so;/usr/lib64/libXext.so
-- Looking for XOpenDisplay in /usr/lib64/libX11.so;/usr/lib64/libXext.so - found
-- Looking for gethostbyname
-- Looking for gethostbyname - found
-- Looking for connect
-- Looking for connect - found
-- Looking for remove
-- Looking for remove - found
-- Looking for shmat
-- Looking for shmat - found
-- Looking for IceConnectionNumber in ICE
-- Looking for IceConnectionNumber in ICE - found
-- Found OpenGL: /usr/lib64/libOpenGL.so   
-- Found Motif: /usr/lib64/libXm.so  
-- Found Python3: /usr/bin/python3.6 (found suitable version "3.6.8", minimum required is "3.6") found components: Interpreter Development.Module Development.Embed 
-- Found GLEW: /usr/lib64/libGLEW.so  
-- Found OpenGL: /usr/lib64/libOpenGL.so  found components: OpenGL GLX 
-- HDF5: Using hdf5 compiler wrapper to determine C configuration
-- Found HDF5: /usr/lib64/libhdf5.so;/usr/lib64/libsz.so;/usr/lib64/libz.so;/usr/lib64/libdl.so;/usr/lib64/libm.so (found version "1.10.5") found components: C HL 
-- Found OGG: /usr/lib64/libogg.so  
-- Found THEORA: /usr/lib64/libtheora.so  
-- Found PkgConfig: /usr/bin/pkg-config (found version "1.4.2") 
-- Found PEGTL: /usr/include/tao (found suitable version "2.8.1", minimum required is "2.0.0") 
-- Found JsonCpp: /usr/lib64/libjsoncpp.so (found suitable version "1.8.4", minimum required is "0.7.0") 
-- Found LibXml2: /usr/lib64/libxml2.so (found version "2.9.7") 
-- Found ZLIB: /usr/lib64/libz.so (found version "1.2.11") 
-- Found LibHaru: /usr/lib64/libhpdf.so (found suitable version "2.3.0-RC2", minimum required is "2.3.0") 
-- Found PNG: /usr/lib64/libpng.so (found version "1.6.34") 
-- Found Boost: /usr/include (found suitable exact version "1.66.0")  
-- Found Boost: /usr/include (found suitable exact version "1.66.0") found components: serialization 
-- Found SQLite3: /usr/include (found version "3.26.0") 
-- Found GDAL: /usr/lib64/libgdal.so (found version "3.0.4") 
-- Found LibPROJ: /usr/lib64/libproj.so (found version "6.3.2") 
-- Found OpenSlide: /usr/lib64/libopenslide.so  
-- Found LibArchive: /usr/lib64/libarchive.so (found version "3.3.3") 
-- Found EXPAT: /usr/lib64/libexpat.so (found version "2.2.5") 
-- Found double-conversion: /usr/lib64/libdouble-conversion.so  
-- Found LZ4: /usr/lib64/liblz4.so (found version "1.8.3") 
-- Found LZMA: /usr/lib64/liblzma.so (found version "5.2.4") 
-- Found utf8cpp: /usr/include  
-- Found Eigen3: /usr/include/eigen3 (found version "3.3.4") 
-- Found JPEG: /usr/lib64/libjpeg.so (found version "62") 
-- Found TIFF: /usr/lib64/libtiff.so (found version "4.0.9")  
-- Found Freetype: /usr/lib64/libfreetype.so (found version "2.9.1") 
-- Found Geant4: /usr/lib64/Geant4-11.0.1/Geant4Config.cmake (found version "11.0.1") 
-- Configuring done
-- Generating done
-- Build files have been written to: /TestEm3-build
$ cmake --build TestEm3-build
[  5%] Building CXX object CMakeFiles/TestEm3.dir/TestEm3.cc.o
[ 10%] Building CXX object CMakeFiles/TestEm3.dir/src/ActionInitialization.cc.o
[ 15%] Building CXX object CMakeFiles/TestEm3.dir/src/DetectorConstruction.cc.o
[ 20%] Building CXX object CMakeFiles/TestEm3.dir/src/DetectorMessenger.cc.o
[ 25%] Building CXX object CMakeFiles/TestEm3.dir/src/EmAcceptance.cc.o
[ 30%] Building CXX object CMakeFiles/TestEm3.dir/src/EventAction.cc.o
[ 35%] Building CXX object CMakeFiles/TestEm3.dir/src/HistoManager.cc.o
[ 40%] Building CXX object CMakeFiles/TestEm3.dir/src/PhysListEmStandard.cc.o
[ 45%] Building CXX object CMakeFiles/TestEm3.dir/src/PhysicsList.cc.o
[ 50%] Building CXX object CMakeFiles/TestEm3.dir/src/PhysicsListMessenger.cc.o
[ 55%] Building CXX object CMakeFiles/TestEm3.dir/src/PrimaryGeneratorAction.cc.o
[ 60%] Building CXX object CMakeFiles/TestEm3.dir/src/PrimaryGeneratorMessenger.cc.o
[ 65%] Building CXX object CMakeFiles/TestEm3.dir/src/Run.cc.o
[ 70%] Building CXX object CMakeFiles/TestEm3.dir/src/RunAction.cc.o
[ 75%] Building CXX object CMakeFiles/TestEm3.dir/src/RunActionMessenger.cc.o
[ 80%] Building CXX object CMakeFiles/TestEm3.dir/src/StepMax.cc.o
[ 85%] Building CXX object CMakeFiles/TestEm3.dir/src/StepMaxMessenger.cc.o
[ 90%] Building CXX object CMakeFiles/TestEm3.dir/src/SteppingAction.cc.o
[ 95%] Building CXX object CMakeFiles/TestEm3.dir/src/TrackingAction.cc.o
[100%] Linking CXX executable TestEm3
[100%] Built target TestEm3
$ # Now we need to setup environment variables to be able to run it
$ eval $(geant4-config --datasets | awk '{printf "export %s=%s\n", $2, $3}')
$ cd TestEm3-build
$ ./TestEm3 TestEm3.in

**************************************************************
 Geant4 version Name: geant4-11-00-patch-01 [MT]   (8-March-2022)
  << in Multi-threaded mode >> 
                       Copyright : Geant4 Collaboration
                      References : NIM A 506 (2003), 250-303
                                 : IEEE-TNS 53 (2006), 270-278
                                 : NIM A 835 (2016), 186-225
                             WWW : http://geant4.org/
**************************************************************

...
[normal TestEm3 output should follow]

Notes:

I’ve tried to create as complete a package as possible, however, I had to keep HDF5 support disabled because the binary package that comes with the distribution is not compatible with compiling Geant4 with multi-threading support. Open Inventor packages (SoXt and/or SoQt) are also not available. Python support also needs a small patch to work, so I left it out for this experimental package. The output of geant4-config --help is as follows:

$ geant4-config --help | sed -ne '/Known Features/,/^$/{ p }'
Known Features:
 staticlibs[no]
 multithreading[yes]
 smartstack[no]
 php_as_hp[no]
 clhep[yes]
 expat[no]
 zlib[no]
 gdml[yes]
 ptl[yes]
 usolids[no]
 freetype[yes]
 hdf5[no]
 g3tog4[yes]
 qt[yes]
 motif[yes]
 raytracer-x11[yes]
 opengl-x11[yes]
 openinventor[no]

Please send us your feedback. Thank you!

1 Like