Skip to content

Commit 0bd3238

Browse files
committed
adding zlib_dep to example executables
1 parent ff9191c commit 0bd3238

4 files changed

Lines changed: 96 additions & 10 deletions

File tree

.github/workflows/dockers_deploy_and_test.yml renamed to .github/workflows/deploy.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ permissions:
66

77
# default versions. This is overwritten by distros_tags.sh
88
env:
9-
GEMC_TAG: dev # default gemc tag
10-
GEANT4_TAG: 11.4.1 # default geant4 tag
119
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
1210

1311
concurrency:
@@ -116,8 +114,8 @@ jobs:
116114
python3 ci/dockerfile_creator.py \
117115
-i "${{ matrix.image }}" \
118116
-t "${{ matrix.image_tag }}" \
119-
--gemc-version "${{ matrix.gemc_tag || env.GEMC_TAG }}" \
120-
--geant4-version "${{ matrix.geant4_tag || env.GEANT4_TAG }}" \
117+
--gemc-version "${{ matrix.gemc_tag }}" \
118+
--geant4-version "${{ matrix.geant4_tag }}" \
121119
--with-package \
122120
--source context \
123121
--package-arch "${{ matrix.arch }}" \

examples/meson.build

Lines changed: 49 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,22 @@ sql_db = get_option('prefix') + '/examples/gemc.db'
55

66
install_subdir(meson.current_source_dir(), install_dir : '.')
77

8-
# Test all solid creators
8+
gemc_analyzer = find_program('gemc-analyzer', dirs : [venv_bin])
9+
10+
# Test all solid creators.
11+
# Optional keys:
12+
# plot_var – variable name to histogram from the digitized stream (ascii, default variation only)
13+
# plot_yvsx – if true, plot avgx vs avgy from the true-info stream (ascii, default variation only)
914
examples_map = {
1015
'basic' : {
11-
'simple_flux' : { 'runs' : ['1'], 'variations' : ['default'] },
12-
'b1' : { 'runs' : ['1'], 'variations' : ['default', 'test'] },
13-
'b2' : { 'runs' : ['1', '11'], 'variations' : ['default', 'alt'] },
16+
'simple_flux' : { 'runs' : ['1'], 'variations' : ['default'], 'plot_var' : 'totEdep' },
17+
'b1' : { 'runs' : ['1'], 'variations' : ['default', 'test'], 'plot_var' : 'dose', 'n_events' : '50' },
18+
'b2' : { 'runs' : ['1', '11'], 'variations' : ['default', 'alt'], 'plot_var' : 'totEdep' },
1419
'b3' : { 'runs' : ['1', '11'], 'variations' : ['default', 'alt'] }
1520
},
1621
'optical' : {
17-
'cherenkov' : { 'runs' : ['1'], 'variations' : ['default', 'mediumIndexRadiator', 'highIndexRadiator'] },
22+
'cherenkov' : { 'runs' : ['1'], 'variations' : ['default', 'mediumIndexRadiator', 'highIndexRadiator'],
23+
'plot_yvsx' : true },
1824
}
1925
}
2026

@@ -91,5 +97,43 @@ foreach branch : examples_map.keys()
9197
endforeach
9298

9399
endforeach
100+
101+
# CSV output run + plot tests — one dedicated gemc run per example with a csv streamer,
102+
# placed after all ascii/root runs (priority -15) so geometry is already built.
103+
plot_var = config.get('plot_var', '')
104+
do_yvsx = config.get('plot_yvsx', false)
105+
if plot_var != '' or do_yvsx
106+
csv_base = test_outdir + '/' + branch + '_' + example + '_csv'
107+
n_events = config.get('n_events', '')
108+
n_events_arg = n_events != '' ? ['-n=' + n_events] : []
109+
test('examples_run_csv_' + branch + '_' + example,
110+
gemc,
111+
args : [yaml_file,
112+
'-gsystem="[{name: ' + example + ', factory: ascii}]"',
113+
'-gstreamer="[{format: csv, filename: ' + csv_base + '}]"'] + n_events_arg,
114+
workdir : example_dir,
115+
is_parallel : false,
116+
priority : -15)
117+
if plot_var != ''
118+
test('examples_plot_' + branch + '_' + example,
119+
gemc_analyzer,
120+
args : [csv_base + '_t0_digitized.csv', plot_var,
121+
'--save', test_outdir + '/' + branch + '_' + example + '_plot.png'],
122+
workdir : example_dir,
123+
is_parallel : false,
124+
priority : -20)
125+
endif
126+
if do_yvsx
127+
test('examples_plot_yvsx_' + branch + '_' + example,
128+
gemc_analyzer,
129+
args : [csv_base + '_t0_true_info.csv',
130+
'--kind', 'csv', '--data', 'true_info', '--plot', 'yvsx',
131+
'--xlim', '-55', '55', '--ylim', '-55', '55',
132+
'--save', test_outdir + '/' + branch + '_' + example + '_yvsx.png'],
133+
workdir : example_dir,
134+
is_parallel : false,
135+
priority : -20)
136+
endif
137+
endif
94138
endforeach
95139
endforeach

meson.build

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,11 +194,12 @@ foreach L : LD
194194
example_sources = sources_and_arguments[0] + qrc_examples_compiled_sources
195195
arguments = sources_and_arguments[1]
196196

197+
example_deps = this_deps + [zlib_dep]
197198
exe = executable(
198199
name,
199200
example_sources,
200201
install : true,
201-
dependencies : this_deps,
202+
dependencies : example_deps,
202203
include_directories : all_includes + ('gemc' / this_lib_name) + additional_includes,
203204
link_with : this_library_link_with,
204205
# Builds the executable as a PIE (position-independent executable).

releases/0.3.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ This version includes:
1111
- `GEMC_PLUGIN_PATH` and `-plugin_path` for external plugin discovery
1212
- Pre-parse plugin options hook for dynamic plugin option registration
1313
- ROOT gstreamer and event-action bug fixes
14+
- Plotting tests for digitizing-SD examples and Cherenkov photon hit maps
1415

1516
<br/>
1617

@@ -99,6 +100,17 @@ This version includes:
99100
executable in `PATH`.
100101
- Updated the Cherenkov optical example with neutral demonstration radiator names:
101102
`lowIndexRadiator`, `mediumIndexRadiator`, and `highIndexRadiator`.
103+
- Simplified the Test workflow so it runs directly inside the matching
104+
`ghcr.io/gemc/g4install:<geant4>-<os>-<tag>` job container instead of
105+
generating and building a temporary Dockerfile.
106+
- Consolidated Test, Sanitize, and Deploy matrix generation in
107+
`ci/distros_tags.sh`; the shared matrix source now emits normal build,
108+
sanitizer, and manifest matrices with consistent image, Geant4, runner, and
109+
container fields.
110+
- Reduced sanitizer-build static linkage by allowing GEMC internal libraries to
111+
follow Meson's `default_library` option and selecting shared GEMC libraries
112+
for sanitizer builds, avoiding static-TLS pressure when tests load plugins
113+
with `dlopen`.
102114
- Added y-vs-x analyzer plotting support in `pygemc` and used it for the
103115
Cherenkov homepage plots.
104116
- Reorganized all source modules under a `gemc/` subdirectory and adopted
@@ -163,7 +175,18 @@ This version includes:
163175
removed the manual Geant4 container build from the analysis workflow.
164176
- Made installed examples database generation skip cleanly when sanitizer
165177
builds intentionally skip installing the Python environment.
178+
- Made the Test and Sanitize workflows use the same runner/container execution
179+
model and shared matrix source; Sanitize differs only by passing the sanitizer
180+
option to `ci/build.sh` and by naming sanitizer log artifacts.
181+
- Switched sanitizer builds to shared GEMC project libraries so plugin-loading
182+
tests avoid Linux/aarch64 static TLS exhaustion from sanitizer-instrumented
183+
static archives.
166184
- Added analyzer coverage in `pygemc` for y-vs-x plotting and CLI image output.
185+
- Added `gemc-analyzer` plot tests to the examples test suite: examples with a digitizing SD
186+
(`simple_flux`, `b1`, `b2`) get a dedicated CSV gemc run at priority -15 feeding into a
187+
`gemc-analyzer` histogram test at priority -20; `b1` overrides `n` to 50 events so the
188+
dosimeter fires reliably (a 6 MeV gamma has only ~27% interaction probability per event in
189+
bone). The Cherenkov example gets a y-vs-x photon hit-position map from its true-info stream.
167190

168191
<br/>
169192

@@ -287,6 +310,18 @@ Both x86_64 and ARM64 platforms are supported.
287310
`GEMC_SKIP_PYTHON_ENV_INSTALL=1` or the installed `python_env` interpreter is
288311
absent, fixing sanitizer installs that intentionally omit the Python
289312
environment.
313+
- Replaced the sanitizer-specific matrix generator with `matrix_sanitize`
314+
output from `ci/distros_tags.sh`, keeping the sanitizer matrix on the same OS,
315+
architecture, Geant4, runner, and container definitions as the Test and Deploy
316+
matrices.
317+
- Changed the Test workflow to source the `g4install` container entrypoint, load
318+
the selected Geant4 module, and run `ci/build.sh` directly in the job
319+
container; logs are packaged from `/root/src/logs` without a BuildKit
320+
logs-export stage.
321+
- Changed the GEMC Meson module loop from `static_library()` to `library()` so
322+
sanitizer CI can request shared project libraries with
323+
`-Ddefault_library=shared -Ddefault_both_libraries=shared` while normal builds
324+
keep the default static-library behavior.
290325
- Better generator statistics for some examples
291326
- Api and analyzer moved to pygemc module
292327
- Examples and tests adapted to use pygemc
@@ -350,6 +385,14 @@ Both x86_64 and ARM64 platforms are supported.
350385
the fallback warning. The Lund file reader pre-converts its computed doubles
351386
via `gutilities::getG4Number(value, unit)` before passing them to the
352387
constructor.
388+
- Added `gemc-analyzer` plot tests to `examples/meson.build`: the `examples_map` gains optional
389+
`plot_var`, `plot_yvsx`, and `n_events` keys. For each example that carries one of these keys,
390+
a dedicated `examples_run_csv_<branch>_<example>` test (priority -15) runs `gemc` with
391+
`factory: ascii` and a CSV streamer, then `examples_plot_<branch>_<example>` (priority -20)
392+
invokes `gemc-analyzer` to save a PNG. `simple_flux` and `b2` plot `totEdep`; `b1` plots
393+
`dose` with `n_events: 50` so enough gammas traverse the bone dosimeter. The Cherenkov example
394+
uses `plot_yvsx: true` to generate a 2D `avgx`-vs-`avgy` photon hit-position map from
395+
its true-info stream with ±55 cm axis limits.
353396
- Added `gemc::collectPluginOptions(int argc, char* argv[])` declared in `gemc_options.h` and
354397
implemented in `gemc_options.cc`. Before the main `GOptions` parsing constructor is called in
355398
`main()`, GEMC scans every YAML file listed in `argv` for `gsystem` entries, resolves each

0 commit comments

Comments
 (0)