Skip to content

Commit 21cfb7b

Browse files
Mac geant4 builds
0 parents  commit 21cfb7b

File tree

2 files changed

+51
-0
lines changed

2 files changed

+51
-0
lines changed

.github/bin/install-deps-macos.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
3+
brew install clhep root bison xerces-c qt@5 qt@6 xquartz cgal libpng vtk

.github/workflows/main.yaml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: build mac geant4
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- "releases/**"
8+
pull_request:
9+
release:
10+
11+
12+
jobs:
13+
build-geant4:
14+
name: Build geant4
15+
runs-on ${{ matrix.os }}
16+
17+
strategy:
18+
fail-fast: false
19+
matrix:
20+
geant4-version: ["v10.7.4", "v11.0.4", "v11.1.3", "v11.2.2"]
21+
os: [macOS-13, macOS-14]
22+
23+
steps:
24+
- uses: actions/checkout@v4
25+
26+
- name: Install brew dependencies on MacOS
27+
if: runner.os == 'macOS'
28+
run: .github/bin/install-deps-macos.sh
29+
30+
- name: Get number of CPU cores
31+
uses: SimenB/github-actions-cpu-cores@v2
32+
id: cpu-cores
33+
34+
- name: Build Geant4
35+
shell: bash
36+
run: |
37+
git clone https://gitlab.cern.ch/geant4/geant4.git
38+
cd geant4
39+
git checkout ${{ matrix.geant4-version }}
40+
cd ../
41+
mkdir geant4-build
42+
mkdir geant4-${{ matrix.geant4-version }}
43+
cd geant4-build
44+
cmake -DCMAKE_INSTALL_PREFIX=../geant4-${{ matrix.geant4-version }} ../geant4 -DGEANT4_INSTALL_DATA=ON -DGEANT4_USE_GDML=ON -DGEANT4_USE_OPENGL_X11=ON -DGEANT4_USE_SYSTEM_CLHEP=ON -DGEANT4_USE_RAYTRACER_X11=ON
45+
make -j${{ steps.cpu-cores.outputs.count }}
46+
make install
47+
cd ../
48+
tar zcf geant4-${{ matrix.geant4-version }}.tgz geant4-${{ matrix.geant4-version }}

0 commit comments

Comments
 (0)