Created attachment 238692 [details] archive containing the port files Port of Geant4 (https://geant4.web.cern.ch/) which is a toolkit for the simulation of the passage of particles through matter. I attach the port files as a tgz archive here, since it would exceed the file size limit in shar archive format. The port has passed a `poudriere testport` on the 2022Q4 branch of 13.1R-p5 amd64 on my end.
Forgot to mention: The CMake project contained in this port fetches data files for the library during build. As such, I had to enable ALLOW_NETWORKING_PACKAGES="geant4" in my poudriere config. If this is a big no-no in production, I can look into fetching the data files prior to building - perhaps with some guidance. The way it is already implemented during build of Geant4 seems quite sober to me.
"Data files", as in "not libraries upon which the port depends", but data files which the library itself indexes for experimentally documented values to be used in its simulations after installation of the port.
Yes, ALLOW_NETWORKING_PACKAGES will never be activated on the compilation farm, and the package will fail. You have to set these datafiles in DISTFILES, maybe add an extra target post-patch: to move them from $WRKDIR to the expected directory, and patch the makefile to not fetch them.
Created attachment 239025 [details] archive containing the port files Updated patch such that data files are fetched during do-fetch rather than during the project's own CMake build step
During configure, the hereunder message is displayed: ------------------------------------------------------------------------ *WARNING* Geant4 has been pre-configured to look for datasets in the directory: /usr/local/share/Geant4-11.0.3/data but the following datasets are NOT present on disk at that location: G4NDL (4.6) G4EMLOW (8.0) PhotonEvaporation (5.7) RadioactiveDecay (5.6) G4PARTICLEXS (4.0) G4PII (1.3) RealSurface (2.2) G4SAIDDATA (2.0) G4ABLA (3.1) G4INCL (1.0) G4ENSDFSTATE (2.3) If you want to have these datasets installed automatically simply re-run cmake and set the GEANT4_INSTALL_DATA variable to ON. This will configure the build to download and install these datasets for you. For example, on the command line, do: cmake -DGEANT4_INSTALL_DATA=ON <otherargs> The variable can also be toggled in ccmake or cmake-gui. If you're running on a Windows system, this is the best solution as CMake will unpack the datasets for you without any further software being required Alternatively, you can install these datasets manually now or after you have installed Geant4. To do this, download the following files: https://cern.ch/geant4-data/datasets/G4NDL.4.6.tar.gz https://cern.ch/geant4-data/datasets/G4EMLOW.8.0.tar.gz https://cern.ch/geant4-data/datasets/G4PhotonEvaporation.5.7.tar.gz https://cern.ch/geant4-data/datasets/G4RadioactiveDecay.5.6.tar.gz https://cern.ch/geant4-data/datasets/G4PARTICLEXS.4.0.tar.gz https://cern.ch/geant4-data/datasets/G4PII.1.3.tar.gz https://cern.ch/geant4-data/datasets/G4RealSurface.2.2.tar.gz https://cern.ch/geant4-data/datasets/G4SAIDDATA.2.0.tar.gz https://cern.ch/geant4-data/datasets/G4ABLA.3.1.tar.gz https://cern.ch/geant4-data/datasets/G4INCL.1.0.tar.gz https://cern.ch/geant4-data/datasets/G4ENSDFSTATE.2.3.tar.gz and unpack them under the directory: /usr/local/share/Geant4-11.0.3/data As we supply the datasets packed in gzipped tar files, you will need the 'tar' utility to unpack them. Nota bene: Missing datasets will not affect or break compilation and installation of the Geant4 libraries. ------------------------------------------------------------------------ Maybe you could add an option for these datasets?
Committed (with some modifications to pet portlint: tabs after variable assignation, trailing spaces, etc.). Thanks! Note: the port CLHEP, science/clhep, is lagging, but once updated it would be better to depend on it.
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=3f600a75eaafb4430d0c19a19d27e542f77b13ef commit 3f600a75eaafb4430d0c19a19d27e542f77b13ef Author: Erik Jensen <erik@tenku.dk> AuthorDate: 2022-12-26 15:01:50 +0000 Commit: Thierry Thomas <thierry@FreeBSD.org> CommitDate: 2022-12-26 15:04:31 +0000 science/geant4: adding Geant4, a TK for the simulation of the passage of particles through matter PR: 268300 Reported by: erik (at) tenku.dk science/Makefile | 1 + science/geant4/Makefile (new) | 79 + science/geant4/distinfo (new) | 25 + science/geant4/files/patch-CMakeLists.txt (new) | 8 + ..._global_management_include_G4Backtrace.hh (new) | 11 + ...h-source_global_management_include_tls.hh (new) | 12 + science/geant4/pkg-descr (new) | 9 + science/geant4/pkg-plist (new) | 54962 +++++++++++++++++++ 8 files changed, 55107 insertions(+)
(In reply to Thierry Thomas from comment #5) These are the datasets I referred to in comment #1. For the changes attached in comment #4, I turned off the CMake flag GEANT4_INSTALL_DATA, which the warning message mentions, because this implies fetching the data over https during building of the library. Instead, the datasets are fetched as DISTFILES during do-fetch and installed to the relevant place in the post-install step. For my next patch, I can look into adding an option to toggle the fetching and installation of these datasets on/off in the port Makefile, if that is what you mean? The most sensible default is to install Geant4 with the datasets. Cheers, Erik
(In reply to Thierry Thomas from comment #6) Thanks Thierry! As for the dependency on science/clhep, what do you have in mind here?
(In reply to Erik Jensen from comment #8) I can also patch the CMake config so it does not produce this warning, if/when the fetching of datasets is enabled.
(In reply to Erik Jensen from comment #10) No problem for the datasets, I thought that these warnings applied some other files! No worry, this is fine, and an option is not necessary.
(In reply to Erik Jensen from comment #9) According to their notes, Geant4 would use a recent CLHEP if it finds one, but since science/clhep is too old, ATM it builds a minimum clhep. It the port science/clhep get updated, I suggest to switch to it.
(In reply to Thierry Thomas from comment #12) Gotcha - I will keep an eye on this. Thanks again!
I see that science/clhep has been upgraded. I have the update of Geant4 to version 11.1.0 on my todo list, and I will modify the port to depend on science/clhep while I am at it.