Package Details: geant4 10.3.1-1

Git Clone URL: https://aur.archlinux.org/geant4.git (read-only)
Package Base: geant4
Description: A simulation toolkit for particle physics interactions.
Upstream URL: http://geant4.cern.ch/
Licenses: custom: http://geant4.cern.ch/license/
Replaces: geant4-deb
Submitter: Eothred
Maintainer: donpicoro
Last Packager: donpicoro
Votes: 11
Popularity: 0.000000
First Submitted: 2010-04-08 08:54
Last Updated: 2017-02-28 16:42

Dependencies (31)

Sources (2)

Latest Comments

donpicoro commented on 2015-01-22 13:54

I do not want to roll it to everybody just yet. Mine with Qt4 work just fine. I tried with Qt5 and it seems to work as well and you help me trying it out

In order to make it work with Qt5 please when compiling comment out the following line:
#patch -Np1 Geant4InterfaceOptions.cmake < ${srcdir}/Geant4InterfaceOptions.patch

and simply change QT_SELECT=4 by QT_SELECT=5. I would appreciate the feedback if people let me know it works for them as well.

donpicoro commented on 2015-01-22 13:53

I tried and it seems like it is working but I do not want to roll it to everybody just yet. Mine with Qt4 work just fine. I tried with Qt5 and its to work as well.

In order to make it work with Qt5 please when compiling comment out the following line:
#patch -Np1 Geant4InterfaceOptions.cmake < ${srcdir}/Geant4InterfaceOptions.patch

and simply change QT_SELECT=4 by QT_SELECT=5 and try it. I would appreciate the feedback if people let me know it works for them as well.

Stevenwalton commented on 2015-01-22 07:40

Since the new package has come out are you going to add the fix for qt5?

Hell-G commented on 2014-12-16 19:21

Anybody having issues with the new Geant4 version?
I can't run my code and the official examples I have tested. I always get an error concerning the G4EMLOW data files. I have version 6.41 installed, as it comes with this package. This is also the version reported on the Geant4 homepage for version 10.01. According to the error message, it looks like that Geant4 is looking for the data file from version 6.35 of G4EMLOW but that is of course not installed anymore. Here is a sample error message:

-------- EEEE ------- G4Exception-START -------- EEEE -------
*** G4Exception : em0003
issued by : G4SeltzerBergerModel::ReadData()
Bremsstrahlung data file </usr/share/geant4-ledata/G4EMLOW6.35/brem_SB/br1> is not opened!G4LEDATA version should be G4EMLOW6.23 or later.

*** Fatal Exception *** core dump ***
-------- EEEE -------- G4Exception-END --------- EEEE -------


*** G4Exception: Aborting execution ***

Thanks for your feedback!

donpicoro commented on 2014-10-27 09:53

The only reason to have the "internal" clhep as opposed the "external" one was to save the user from compiling something extra. Most of my applications work perfectly with the internal one but I guess in order to be more inclusive we can have it as a dependency until the point something breaks.

And as for the Qt, I do not justify a new release bump for it. As I said let's wait and see the actual support for Qt in the next release.

JP-Ellis commented on 2014-10-27 09:48

Regarding the cmake >= 3, I did that because cmake 3 introduces a new way of importing libraries and remember getting some issues at one stage... but I can't replicate them now so it probably isn't strictly necessary.

Also, regarding the CLHEP, I thought it better to include the full CLHEP (and I in fact created a clhep-git version on AUR); however, I was doing a long run just then and it appears that the latest CLHEP isn't as compatible as I had hoped as it (very rarely) generates an invalid floating point operation.

Having said that, the floating point error may be restricted to my computer, since on my computer I get "WARNING - FPE detection is activated" at the start of every Geant4 run, but on another computer I regularly use I do not. I guess it is up to you whether to make CLHEP a dependency or not.

PS: I also made a mistake with one of the building options. `-DQT_QMAKE_EXECUTABLE=ON` can be ignored (in fact, it is invalid as it stands and shows that Geant4 completely ignores your environment and manually looks for the files).

JP-Ellis commented on 2014-10-27 09:43

Regarding the cmake >= 3, I did that because cmake 3 introduces a new way of importing libraries and remember getting some issues at one stage... but I can't replicate them now so it probably isn't strictly necessary.

Also, regarding the CLHEP, I thought it better to include the full CLHEP (and I in fact created a clhep-git version on AUR); however, I was doing a long run just then and it appears that the latest CLHEP isn't as compatible as I had hoped as it (very rarely) generates an invalid floating point operation.

Having said that, the floating point error may be restricted to my computer, since on my computer I get "WARNING - FPE detection is activated" at the start of every Geant4 run, but on another computer I regularly use I do not. I guess it is up to you whether to make CLHEP a dependency or not.

donpicoro commented on 2014-10-26 22:52

I see, just commenting those lines out, eh?

I reverted to the stable version. People can use the version they prefer but I plan to 'maintain' only the stable one.

I kept the external clhep as you had it and the cmake>=3 dependency although not sure why. The important one is definitively NOT to have 2.6 ;-)

Thanks for the patch and I hope it works for everybody =P.
We'll see how it turns out on Dec. 05 when the new release comes out.

/Pico



JP-Ellis commented on 2014-10-26 11:37

This has issues with Qt5, and unfortunately, Geant4 by default searches for the Qt5 libraries first (despite Qt5 support being experimental at the moment). It also searches for the Qt5 libraries in such a way that using QT_SELECT=4 is ignored.

I have managed to fix this issue by patching the cmake file so that it ignores Qt5 entirely. Note that the pkgbuild has been update to the beta version (feel free to revert it).

### START OF PKGBUILD ###
# Maintainer: Luis Sarmiento < Luis.Sarmiento-ala-nuclear.lu.se >
pkgname='geant4'
pkgver=10.1beta1
_pkgver=10.01.b01
#pkgver=10.0.2
#_pkgver=10.00.p02
pkgrel=1
pkgdesc="A simulation toolkit for particle physics interactions."
depends=('cmake>=3' 'xerces-c' 'qt4' 'glu' 'soxt' 'mesa' 'clhep')
replaces=('geant4-deb')
optdepends=('java-environment: for histogram visualizations and analysis'
'tcsh: for C Shell support'
'python: for G4Python support'
'geant4-abladata: Data files for nuclear shell effects in INCL/ABLA hadronic mode'
'geant4-ledata: Data files for low energy electromagnetic processes'
'geant4-levelgammadata: Data files for photon evaporation'
'geant4-neutronhpdata: Neutron data files with thermal cross sections'
'geant4-neutronxsdata: Data files for evaluated neutron cross sections on natural composition of elements'
'geant4-piidata: Data files for shell ionisation cross sections'
'geant4-radioactivedata: Data files for radioactive decay hadronic processes'
'geant4-realsurfacedata: Data files for measured optical surface reflectance'
'geant4-saiddata: Data files from evaluated cross-sections in SAID data-base')
url="http://geant4.cern.ch/"
arch=('x86_64' 'i686')
license=('custom: http://geant4.cern.ch/license/')
options=('!emptydirs')
install="${pkgname}.install"
source=("http://geant4.cern.ch/support/source/${pkgname}.${_pkgver}.tar.gz"
"Geant4InterfaceOptions.patch"
"${pkgname}.install")
md5sums=('6e2276cf017a60f042f1edc271e0c172'
'1d282b540d671bad495b3d86c32e4324'
'c3652d79011cd3fab2e1081e22f9f513')

prepare() {
cd ${srcdir}/${pkgname}.${_pkgver}
patch -Np1 -i ../Geant4InterfaceOptions.patch
}

build() {
[ -d ${srcdir}/build ] || mkdir ${srcdir}/build
cd ${srcdir}/build
env -i \
QT_SELECT=4 \
PATH=/usr/bin \
cmake -Wno-dev \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_INSTALL_LIBDIR=lib \
-DGEANT4_USE_GDML=ON \
-DGEANT4_USE_G3TOG4=ON \
-DGEANT4_USE_QT=ON \
-DQT_QMAKE_EXECUTABLE=ON \
-DGEANT4_USE_XM=ON \
-DGEANT4_BUILD_MULTITHREADED=ON \
-DGEANT4_USE_SYSTEM_CLHEP=ON \
-DGEANT4_USE_OPENGL_X11=ON \
-DGEANT4_USE_INVENTOR=ON \
-DGEANT4_USE_RAYTRACER_X11=ON \
-DGEANT4_USE_SYSTEM_EXPAT=ON \
-DGEANT4_USE_SYSTEM_ZLIB=ON \
-DGEANT4_BUILD_CXXSTD=c++11 \
../${pkgname}.${_pkgver}

make
}

package() {

#Since the basic package does not include the data files, their
#configuration should be removed from the configuration file. Data
#files are also available on the AUR and the environment variables are
#set automatically for you from the packages.

msg "Removing wrongly set environment variables"

variables=("G4LEDATA" \
"G4LEVELGAMMADATA" \
"G4NEUTRONHPDATA" \
"G4NEUTRONXSDATA" \
"G4PIIDATA" \
"G4RADIOACTIVEDATA" \
"G4REALSURFACEDATA" \
"G4SAIDXSDATA" \
"G4ABLADATA" )


for _varname in ${variables[*]}
do
sed -i "/${_varname}/d" ${srcdir}/build/InstallTreeFiles/geant4.sh
sed -i "/${_varname}/d" ${srcdir}/build/InstallTreeFiles/geant4.csh
done

cd ${srcdir}/build
make DESTDIR="${pkgdir}" install

echo 'pushd /usr/bin &> /dev/null && source geant4.sh && popd &>/dev/null' > ${srcdir}/geant4.profile.sh
echo 'pushd /usr/bin &> /dev/null && source geant4.csh && popd &>/dev/null' > ${srcdir}/geant4.profile.csh
install -d ${pkgdir}/etc/profile.d
install -m755 ${srcdir}/geant4.profile.sh ${pkgdir}/etc/profile.d/geant4.sh
install -m755 ${srcdir}/geant4.profile.csh ${pkgdir}/etc/profile.d/geant4.csh
}
### END OF PKGBUILD ###

### START OF Geant4InterfaceOptions.patch ###
diff --git a/cmake/Modules/Geant4InterfaceOptions.cmake b/cmake/Modules/Geant4InterfaceOptions.cmake.new
index 256bc91..94c2de6 100644
--- a/cmake/Modules/Geant4InterfaceOptions.cmake
+++ b/cmake/Modules/Geant4InterfaceOptions.cmake
@@ -88,29 +88,29 @@ if(GEANT4_USE_QT)
find_package(Qt5OpenGL QUIET)
find_package(Qt5PrintSupport QUIET)

- if(Qt5Core_FOUND
- AND Qt5Gui_FOUND
- AND Qt5Widgets_FOUND
- AND Qt5OpenGL_FOUND
- AND Qt5PrintSupport_FOUND)
- # Compatibility
- macro(qt4_wrap_cpp)
- qt5_wrap_cpp(${ARGN})
- endmacro()
- set(Qt5_USE_FILE_IN "${PROJECT_SOURCE_DIR}/cmake/Templates/Geant4UseQt5.cmake.in")
- set(QT_USE_FILE "${PROJECT_BINARY_DIR}/Geant4UseQt5.cmake")
- configure_file("${Qt5_USE_FILE_IN}" "${QT_USE_FILE}" @ONLY)
- get_target_property(QT_QMAKE_EXECUTABLE ${Qt5Core_QMAKE_EXECUTABLE} IMPORTED_LOCATION)
- set(G4QTLIBLIST "-lQt5PrintSupport -lQt5Widgets -lQt5Gui -lQt5Core")
- set(G4GLQTLIBLIST "-lQt5OpenGL ${G4QTLIBLIST}")
- else()
+ # if(Qt5Core_FOUND
+ # AND Qt5Gui_FOUND
+ # AND Qt5Widgets_FOUND
+ # AND Qt5OpenGL_FOUND
+ # AND Qt5PrintSupport_FOUND)
+ # # Compatibility
+ # macro(qt4_wrap_cpp)
+ # qt5_wrap_cpp(${ARGN})
+ # endmacro()
+ # set(Qt5_USE_FILE_IN "${PROJECT_SOURCE_DIR}/cmake/Templates/Geant4UseQt5.cmake.in")
+ # set(QT_USE_FILE "${PROJECT_BINARY_DIR}/Geant4UseQt5.cmake")
+ # configure_file("${Qt5_USE_FILE_IN}" "${QT_USE_FILE}" @ONLY)
+ # get_target_property(QT_QMAKE_EXECUTABLE ${Qt5Core_QMAKE_EXECUTABLE} IMPORTED_LOCATION)
+ # set(G4QTLIBLIST "-lQt5PrintSupport -lQt5Widgets -lQt5Gui -lQt5Core")
+ # set(G4GLQTLIBLIST "-lQt5OpenGL ${G4QTLIBLIST}")
+ # else()
unset(Qt5Core_DIR CACHE)
unset(Qt5Gui_DIR CACHE)
unset(Qt5Widgets_DIR CACHE)
unset(Qt5OpenGL_DIR CACHE)
unset(Qt5PrintSupport_DIR CACHE)
find_package(Qt4 REQUIRED COMPONENTS QtCore QtGui QtOpenGL)
- endif()
+ # endif()

find_package(OpenGL REQUIRED)
### END OF Geant4InterfaceOptions.patch ###

Hell-G commented on 2014-05-21 20:26

No worries! Thank you very much for your help!
I don't think it has anything to do with you preparing the package. I guess it is Geant4 and Qt5 related. I will see, if I can get help from the Geant4 community.

All comments