Skip to content

Commit 108f8e7

Browse files
authored
[Geant4] Bump to latest version (#10218)
1 parent da2598c commit 108f8e7

File tree

2 files changed

+79
-139
lines changed

2 files changed

+79
-139
lines changed

G/Geant4/build_tarballs.jl

+12-7
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
using BinaryBuilder
44

55
name = "Geant4"
6-
version = v"11.2.1"
6+
version = v"11.3.0"
77

88
# Collection of sources required to build
99
sources = [
1010
ArchiveSource("https://gitlab.cern.ch/geant4/geant4/-/archive/v$(version)/geant4-v$(version).tar.gz",
11-
"76c9093b01128ee2b45a6f4020a1bcb64d2a8141386dea4674b5ae28bcd23293"),
11+
"d9d71daff8890a7b5e0e33ea9a65fe6308ad6713000b43ba6705af77078e7ead"),
1212
ArchiveSource("https://github.com/phracker/MacOSX-SDKs/releases/download/10.15/MacOSX10.15.sdk.tar.xz",
1313
"2408d07df7f324d3beea818585a6d990ba99587c218a3969f924dfcc4de93b62"),
1414
DirectorySource("./bundled")
@@ -35,7 +35,10 @@ fi
3535
mkdir build && cd build
3636
FLAGS=()
3737
if [[ "${target}" != *-w64-* && "${target}" != *-apple-* ]]; then
38-
FLAGS=(-DGEANT4_USE_OPENGL_X11=ON)
38+
FLAGS+=(-DGEANT4_USE_OPENGL_X11=ON)
39+
fi
40+
if [[ "${target}" == *-apple-* ]]; then
41+
FLAGS+=(-DGEANT4_USE_SYSTEM_ZLIB=ON)
3942
fi
4043
if [[ "${target}" == *-w64-* ]]; then
4144
FLAGS+=(-DGEANT4_BUILD_MULTITHREADED=OFF)
@@ -58,8 +61,11 @@ install_license ../LICENSE
5861
# These are the platforms we will build for by default, unless further
5962
# platforms are passed in on the command line
6063
platforms = expand_cxxstring_abis(supported_platforms())
61-
platforms = filter(p -> libc(p) != "musl" && os(p) != "freebsd" && arch(p) != "armv6l" && arch(p) != "i686", platforms)
62-
64+
platforms = filter(p -> libc(p) != "musl" &&
65+
os(p) != "freebsd" &&
66+
arch(p) != "armv6l" &&
67+
arch(p) != "i686" &&
68+
arch(p) != "riscv64", platforms)
6369

6470
# The products that we will ensure are always built
6571
products = [
@@ -73,7 +79,6 @@ products = [
7379
LibraryProduct("libG4GMocren", :libG4Mocren),
7480
LibraryProduct("libG4particles", :libG4Particles),
7581
LibraryProduct("libG4graphics_reps", :libG4Graphics),
76-
LibraryProduct("libG4zlib", :libG4Zlib),
7782
LibraryProduct("libG4geometry", :libG4Geometry),
7883
LibraryProduct("libG4modeling", :libG4Modeling),
7984
LibraryProduct("libG4interfaces", :libG4Interfaces),
@@ -101,7 +106,7 @@ products = [
101106

102107
# Dependencies that must be installed before this package can be built
103108
dependencies = [
104-
Dependency("Expat_jll"; compat="2.4.8"),
109+
Dependency("Expat_jll"; compat="2.6.4"),
105110
Dependency("Xorg_libXmu_jll"),
106111
Dependency("Libglvnd_jll"),
107112
Dependency("Xerces_jll"),
+67-132
Original file line numberDiff line numberDiff line change
@@ -1,140 +1,75 @@
1-
diff --git a/source/externals/ptl/src/Threading.cc b/source/externals/ptl/src/Threading.cc
2-
index 324d6c12d7..a7553d8db2 100644
3-
--- a/source/externals/ptl/src/Threading.cc
4-
+++ b/source/externals/ptl/src/Threading.cc
5-
@@ -27,7 +27,7 @@
6-
#include "PTL/Utility.hh"
7-
8-
#if defined(PTL_WINDOWS)
9-
-# include <Windows.h>
10-
+# include <windows.h>
11-
#endif
12-
13-
#if defined(PTL_MACOS)
14-
diff --git a/source/global/management/src/G4FindDataDir.cc b/source/global/management/src/G4FindDataDir.cc
15-
index 8c80180f71..7c5a6e0158 100644
16-
--- a/source/global/management/src/G4FindDataDir.cc
17-
+++ b/source/global/management/src/G4FindDataDir.cc
18-
@@ -34,7 +34,7 @@
19-
#include <cstdlib>
20-
#include <cstring>
21-
22-
-#if defined(_MSC_VER)
23-
+#if defined(_WIN32)
24-
#define setenv(name, value, overwrite) _putenv_s(name, value)
25-
#endif
26-
27-
diff --git a/source/global/management/src/G4Threading.cc b/source/global/management/src/G4Threading.cc
28-
index 3c6bd77b14..d793a7abff 100644
29-
--- a/source/global/management/src/G4Threading.cc
30-
+++ b/source/global/management/src/G4Threading.cc
31-
@@ -34,8 +34,8 @@
32-
#include "G4AutoLock.hh"
33-
#include "globals.hh"
34-
35-
-#if defined(WIN32) || defined(__MINGW32__)
36-
-# include <Windows.h>
37-
+#if defined(_WIN32)
38-
+# include <windows.h>
1+
diff --git a/source/global/management/include/G4SliceTimer.hh b/source/global/management/include/G4SliceTimer.hh
2+
index fca9b3eb369..04c2d739267 100644
3+
--- a/source/global/management/include/G4SliceTimer.hh
4+
+++ b/source/global/management/include/G4SliceTimer.hh
5+
@@ -39,7 +39,7 @@
6+
#ifndef G4SLICE_TIMER_HH
7+
#define G4SLICE_TIMER_HH 1
8+
9+
-#if !(defined(WIN32) || defined(__MINGW32__))
10+
+#if !defined(_WIN32)
11+
# include <sys/times.h>
12+
# include <unistd.h>
3913
#else
40-
# include <sys/syscall.h>
41-
# include <sys/types.h>
42-
diff --git a/source/processes/electromagnetic/dna/utils/include/G4MoleculeGun.hh b/source/processes/electromagnetic/dna/utils/include/G4MoleculeGun.hh
43-
index ef764260ac..54f9a8a17f 100644
44-
--- a/source/processes/electromagnetic/dna/utils/include/G4MoleculeGun.hh
45-
+++ b/source/processes/electromagnetic/dna/utils/include/G4MoleculeGun.hh
46-
@@ -110,6 +110,8 @@ protected:
47-
void ShootAtFixedPosition(G4MoleculeGun*){}
48-
};
49-
50-
+template<> void TG4MoleculeShoot<G4Track>::Shoot(G4MoleculeGun* gun);
51-
+
52-
template<typename TYPE>
53-
G4shared_ptr<G4MoleculeShoot> G4MoleculeShoot::ChangeType()
14+
@@ -49,7 +49,7 @@
15+
extern "C"
5416
{
55-
diff --git a/source/processes/hadronic/models/lend/include/MCGIDI.h b/source/processes/hadronic/models/lend/include/MCGIDI.h
56-
index e11303d2f4..3e4fa17887 100644
57-
--- a/source/processes/hadronic/models/lend/include/MCGIDI.h
58-
+++ b/source/processes/hadronic/models/lend/include/MCGIDI.h
59-
@@ -9,7 +9,7 @@
60-
#define MCGIDI_VERSION_MINOR 0
61-
#define MCGIDI_VERSION_PATCHLEVEL 0
62-
63-
-#ifdef WIN32
64-
+#ifdef _WIN32
65-
#define M_PI 3.141592653589793238463
66-
#endif
67-
68-
diff --git a/source/processes/hadronic/models/lend/include/nf_specialFunctions.h b/source/processes/hadronic/models/lend/include/nf_specialFunctions.h
69-
index 4321f47a59..4868a156da 100644
70-
--- a/source/processes/hadronic/models/lend/include/nf_specialFunctions.h
71-
+++ b/source/processes/hadronic/models/lend/include/nf_specialFunctions.h
72-
@@ -6,15 +6,12 @@
73-
#ifndef specialFunctions_h_included
74-
#define specialFunctions_h_included
75-
76-
+#define _USE_MATH_DEFINES
77-
#include <math.h>
78-
#include <float.h>
17+
int sysconf(int);
18+
-};
19+
+}
20+
21+
// Structure returned by times()
22+
//
23+
@@ -64,7 +64,7 @@ struct tms
24+
extern "C"
25+
{
26+
extern clock_t times(struct tms*);
27+
-};
28+
+}
29+
#endif /* WIN32 */
30+
31+
#include "G4Types.hh"
32+
diff --git a/source/global/management/include/G4Timer.hh b/source/global/management/include/G4Timer.hh
33+
index 022e3557df8..b0d8a358956 100644
34+
--- a/source/global/management/include/G4Timer.hh
35+
+++ b/source/global/management/include/G4Timer.hh
36+
@@ -72,7 +72,7 @@
37+
#ifndef G4TIMER_HH
38+
#define G4TIMER_HH 1
39+
40+
-#if !(defined(WIN32) || defined(__MINGW32__))
41+
+#if !defined(_WIN32)
42+
# include <sys/times.h>
43+
# include <unistd.h>
44+
#else
45+
@@ -82,7 +82,7 @@
46+
extern "C"
47+
{
48+
int sysconf(int);
49+
-};
50+
+}
7951

80-
#include "nf_utilities.h"
52+
// Structure returned by times()
8153

82-
-#ifdef WIN32
83-
-#define M_PI 3.141592653589793238463
84-
-#endif
85-
-
86-
#if defined __cplusplus
87-
extern "C" {
88-
namespace GIDI {
89-
diff --git a/source/processes/hadronic/models/lend/src/MCGIDI_energy.cc b/source/processes/hadronic/models/lend/src/MCGIDI_energy.cc
90-
index 65644c9727..d94d42eb78 100644
91-
--- a/source/processes/hadronic/models/lend/src/MCGIDI_energy.cc
92-
+++ b/source/processes/hadronic/models/lend/src/MCGIDI_energy.cc
93-
@@ -5,7 +5,7 @@
94-
#include <string.h>
95-
#include <cmath>
54+
@@ -97,7 +97,7 @@ struct tms
55+
extern "C"
56+
{
57+
extern clock_t times(struct tms*);
58+
-};
59+
+}
60+
#endif /* WIN32 */
61+
62+
#include "G4Types.hh"
63+
diff --git a/source/global/management/src/G4Timer.cc b/source/global/management/src/G4Timer.cc
64+
index 461d0141a0a..d45631602e6 100644
65+
--- a/source/global/management/src/G4Timer.cc
66+
+++ b/source/global/management/src/G4Timer.cc
67+
@@ -41,7 +41,7 @@
68+
# endif
69+
#endif
9670

9771
-#ifdef WIN32
9872
+#ifdef _WIN32
99-
#define M_PI 3.141592653589793238463
100-
#endif
101-
102-
diff --git a/source/processes/hadronic/models/lend/src/MCGIDI_outputChannel.cc b/source/processes/hadronic/models/lend/src/MCGIDI_outputChannel.cc
103-
index d22caeb84d..86a3fbccef 100644
104-
--- a/source/processes/hadronic/models/lend/src/MCGIDI_outputChannel.cc
105-
+++ b/source/processes/hadronic/models/lend/src/MCGIDI_outputChannel.cc
106-
@@ -2,6 +2,7 @@
107-
# <<BEGIN-copyright>>
108-
# <<END-copyright>>
109-
*/
110-
+#define _USE_MATH_DEFINES
111-
#include <string.h>
112-
#include <cmath>
113-
114-
diff --git a/source/processes/hadronic/models/lend/src/nf_angularMomentumCoupling.cc b/source/processes/hadronic/models/lend/src/nf_angularMomentumCoupling.cc
115-
index ce8946de18..bc59181626 100644
116-
--- a/source/processes/hadronic/models/lend/src/nf_angularMomentumCoupling.cc
117-
+++ b/source/processes/hadronic/models/lend/src/nf_angularMomentumCoupling.cc
118-
@@ -54,6 +54,7 @@
119-
*/
120-
121-
#include <stdlib.h>
122-
+#define _USE_MATH_DEFINES
123-
#include <cmath>
124-
125-
#include "nf_specialFunctions.h"
126-
diff --git a/source/processes/hadronic/models/lend/src/xDataTOM_importXML.cc b/source/processes/hadronic/models/lend/src/xDataTOM_importXML.cc
127-
index afa8a06987..07245f1a2c 100644
128-
--- a/source/processes/hadronic/models/lend/src/xDataTOM_importXML.cc
129-
+++ b/source/processes/hadronic/models/lend/src/xDataTOM_importXML.cc
130-
@@ -11,8 +11,8 @@
131-
#include <fcntl.h>
132-
#include <errno.h>
73+
# include <sys/types.h>
74+
# include <windows.h>
13375

134-
-#if defined(WIN32) || defined(__MINGW32__)
135-
-#include <BaseTsd.h>
136-
+#if defined(_WIN32)
137-
+#include <basetsd.h>
138-
#include <io.h>
139-
#include <windows.h>
140-
#define realpath( a, b ) GetFullPathName( a, PATH_MAX, b, NULL )

0 commit comments

Comments
 (0)