Skip to content

Commit 8bd197e

Browse files
committed
added archlinux, root not used if not found, improved build.sh
1 parent 1fbf23d commit 8bd197e

12 files changed

Lines changed: 193 additions & 229 deletions

File tree

.github/workflows/build_and_test.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ jobs:
3030
echo ""
3131
echo "For amd64 CPUS (for example, MacOS silicon):"
3232
echo '```bash'
33+
echo 'VPORTS=(-p 6080:6080 -p 5900:5900)'
34+
echo 'VNC_PASS=(-e X11VNC_PASSWORD=change-me)'
35+
echo 'VNC_BIND=(-e VNC_BIND=0.0.0.0)'
3336
echo 'VPLATFORM="--platform=linux/amd64"'
3437
echo '```'
3538
echo "---"
@@ -111,6 +114,7 @@ jobs:
111114
# Add -amd64 suffix to the arch-specific image tag
112115
tags: ${{ steps.meta.outputs.tags }}-amd64
113116
labels: ${{ steps.meta.outputs.labels }}
117+
# Comment these if the cache is old
114118
#cache-from: type=registry,ref=${{ needs.discover.outputs.image }}:cache-amd64
115119
#cache-to: type=registry,ref=${{ needs.discover.outputs.image }}:cache-amd64,mode=max
116120

@@ -225,6 +229,7 @@ jobs:
225229
push: true
226230
tags: ${{ steps.meta.outputs.tags }}-arm64
227231
labels: ${{ steps.meta.outputs.labels }}
232+
# Comment these if the cache is old
228233
#cache-from: type=registry,ref=${{ needs.discover.outputs.image }}:cache-arm64
229234
#cache-to: type=registry,ref=${{ needs.discover.outputs.image }}:cache-arm64,mode=max
230235

ci/build.sh

Lines changed: 32 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -31,72 +31,67 @@ ls -l $setup_log
3131
ls -l $compile_log
3232
ls -l $test_log
3333

34-
35-
echo " > Geant-config: $(which geant4-config) : $(geant4-config --version)" | tee $setup_log
34+
echo " > Geant-config: $(which geant4-config) : $(geant4-config --version)" | tee $setup_log
3635
echo " > Root-config: $(which root-config) : $(root-config --version)" | tee -a $setup_log
3736

3837
setup_options=" --native-file=core.ini $meson_option -Dprefix=$GEMC --wipe "
3938

40-
echo " > Running build Configure with setup build options: $setup_options" | tee -a $setup_log
41-
meson setup build $=setup_options >> $setup_log
42-
if [ $? -ne 0 ]; then
43-
echo "Build Configure failed. Log: "
44-
cat $setup_log
45-
exit 1
46-
else
47-
echo Build Configure Successful
48-
echo ; echo
49-
fi
39+
local mode="${1:-release}"
40+
local install_dir="${GEMC:?GEMC not set}"
41+
42+
local args=(
43+
"--native-file=core.ini"
44+
"-Di_test=true"
45+
"-Droot=enabled"
46+
"-Dprefix=${install_dir}"
47+
)
5048

51-
echo " > Applying patch to version 0.8.0" | tee -a $setup_log
49+
echo " > Applying patch to version 0.8.0" | tee -a $setup_log
5250
meson subprojects update yaml-cpp --reset
53-
meson setup --reconfigure build
5451

55-
cd build || exit 1
56-
echo " > Running meson compile -v -j $max_threads" | tee $compile_log
57-
meson compile -v -j $max_threads >> $compile_log
52+
echo " > Running build Configure with setup build options: ${args[@]}" | tee -a $setup_log
53+
meson setup build "${args[@]}" --wipe >> $setup_log
5854
if [ $? -ne 0 ]; then
59-
echo "Compile failed. Log: "
60-
cat $compile_log
55+
echo "Build Configure failed. Log: "
56+
cat $setup_log
6157
exit 1
6258
else
63-
echo Compile Successful
64-
echo ; echo
59+
echo Build Configure Successful
60+
echo
61+
echo
6562
fi
6663

6764

68-
echo " > Current directory: $(pwd) content:" | tee -a $compile_log
69-
ls -l >> $compile_log
70-
71-
echo " > Running meson install" | tee -a $compile_log
72-
meson install >> $compile_log
65+
echo " > Running meson install -v -j $max_threads" | tee $compile_log
66+
meson install -C build -v -j $max_threads >> $compile_log
7367
if [ $? -ne 0 ]; then
74-
echo "Install failed. Log: "
75-
cat $compile_log
68+
echo "Compile or Install failed. Log: "
69+
cat $compile_log
7670
exit 1
7771
else
78-
echo Install Successful
79-
echo ; echo
72+
echo Compile Successful
73+
echo
74+
echo
8075
fi
8176

82-
echo " > $GEMC recursive content:" | tee -a $compile_log
83-
ls -lR $GEMC >> $compile_log
77+
78+
echo " > $GEMC recursive content:" | tee -a $compile_log
79+
ls -lR $GEMC >>$compile_log
8480

8581
# if $1 is NOT one of sanitize option, run meson test
8682
if [[ $1 != @(address|thread|undefined|memory|leak) ]]; then
87-
echo " > Running meson test" | tee $test_log
88-
meson test -j 1 --print-errorlogs --no-rebuild --num-processes 1 >> $test_log
83+
echo " > Running meson test" | tee $test_log
84+
meson test -C build -j 1 --print-errorlogs --no-rebuild --num-processes 1 >>$test_log
8985
echo Successful: $(cat $test_log | grep "Ok:" | awk '{print $2}')
9086
echo Failures: $(cat $test_log | grep "Fail:" | awk '{print $2}')
9187
fi
9288

9389
echo
94-
echo " ldd of $GEMC/bin/gemc:" | tee -a $compile_log
90+
echo " ldd of $GEMC/bin/gemc:" | tee -a $compile_log
9591

9692
# if on unix, use ldd , if on mac, use otool -L
9793
if [[ "$(uname)" == "Darwin" ]]; then
9894
otool -L $GEMC/bin/gemc
9995
else
100-
ldd $GEMC/bin/gemc | tee -a $compile_log
96+
ldd $GEMC/bin/gemc | tee -a $compile_log
10197
fi
102-

ci/distros_tags.sh

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ build_matrix() {
2020
{"osname":"fedora", "image":"$(get_geant4_tag)-fedora-$(get_fedora_latest)", "gemc_tag":"$(get_gemc_tag)", "geant4_tag":"$(get_geant4_tag)"},
2121
{"osname":"almalinux", "image":"$(get_geant4_tag)-almalinux-$(get_almalinux_latest)", "gemc_tag":"$(get_gemc_tag)", "geant4_tag":"$(get_geant4_tag)"},
2222
{"osname":"debian", "image":"$(get_geant4_tag)-debian-$(get_debian_latest)", "gemc_tag":"$(get_gemc_tag)", "geant4_tag":"$(get_geant4_tag)"}
23+
{"osname":"archlinux", "image":"$(get_geant4_tag)-archlinux-$(get_archlinux_latest)", "gemc_tag":"$(get_gemc_tag)", "geant4_tag":"$(get_geant4_tag)"}
2324
]}
2425
EOF
2526
)
@@ -30,10 +31,6 @@ EOF
3031
fi
3132
}
3233

33-
# {"image":"debian-$(get_debian_latest)", "gemc_tag":"$(get_gemc_tag)"}
34-
# {"image":"archlinux-$(get_archlinux_latest)", "gemc_tag":"$(get_gemc_tag)"},
35-
36-
3734
# portable lowercasing (works on old bash, dash, zsh)
3835
lc() { printf '%s' "$1" | tr '[:upper:]' '[:lower:]'; }
3936

ci/test.sh

Lines changed: 0 additions & 17 deletions
This file was deleted.

dbselect/meson.build

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
sub_dir_name = meson.current_source_dir().split('/').get(-1)
22

3+
with_gui = ['']
4+
if get_option('i_test')
5+
with_gui = ['-gui']
6+
endif
7+
38
example_source = files('examples/test_dbselect.cc')
49
examples_dir = get_option('prefix') + '/test/' + sub_dir_name
510
dbhost = ['-sql=' + examples_dir + '/gemc.db']
@@ -10,12 +15,6 @@ verbosity = ['-verbosity.dbselect=2',
1015
'-verbosity.gsystem=2',
1116
'-debug.gsystem=true']
1217

13-
with_gui = ['']
14-
if get_option('i_test')
15-
with_gui = ['-gui']
16-
endif
17-
18-
1918
sources = files(
2019
'dbselect_options.cc',
2120
'dbselectView.cc',

g4dialog/meson.build

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -33,23 +33,12 @@ examples = {
3333
}
3434

3535

36-
if get_option('i_test')
37-
LD += {
38-
'name' : sub_dir_name,
39-
'sources' : sources,
40-
'headers' : headers,
41-
'moc_headers' : moc_headers,
42-
'dependencies' : [yaml_cpp_dep, qt6_deps, clhep_deps, geant4_deps],
43-
'additional_includes' : ['g4dialog', 'g4dialog/tabs'],
44-
'examples' : examples
45-
}
46-
else
47-
LD += {
48-
'name' : sub_dir_name,
49-
'sources' : sources,
50-
'headers' : headers,
51-
'moc_headers' : moc_headers,
52-
'dependencies' : [yaml_cpp_dep, qt6_deps, clhep_deps, geant4_deps],
53-
'additional_includes' : ['g4dialog', 'g4dialog/tabs'],
54-
}
55-
endif
36+
LD += {
37+
'name' : sub_dir_name,
38+
'sources' : sources,
39+
'headers' : headers,
40+
'moc_headers' : moc_headers,
41+
'dependencies' : [yaml_cpp_dep, qt6_deps, clhep_deps, geant4_deps],
42+
'additional_includes' : ['g4dialog', 'g4dialog/tabs'],
43+
'examples' : examples
44+
}

gboard/meson.build

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -31,23 +31,12 @@ examples = {
3131
}
3232

3333

34-
if get_option('i_test')
35-
LD += {
36-
'name' : sub_dir_name,
37-
'sources' : sources,
38-
'headers' : headers,
39-
'moc_headers' : moc_headers,
40-
'dependencies' : [yaml_cpp_dep, qt6_deps, clhep_deps, geant4_deps],
41-
'additional_includes' : ['gboard'],
42-
'examples' : examples
43-
}
44-
else
45-
LD += {
46-
'name' : sub_dir_name,
47-
'sources' : sources,
48-
'headers' : headers,
49-
'moc_headers' : moc_headers,
50-
'dependencies' : [yaml_cpp_dep, qt6_deps, clhep_deps, geant4_deps],
51-
'additional_includes' : ['gboard'],
52-
}
53-
endif
34+
LD += {
35+
'name' : sub_dir_name,
36+
'sources' : sources,
37+
'headers' : headers,
38+
'moc_headers' : moc_headers,
39+
'dependencies' : [yaml_cpp_dep, qt6_deps, clhep_deps, geant4_deps],
40+
'additional_includes' : ['gboard'],
41+
'examples' : examples
42+
}

gqtbuttonswidget/meson.build

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -20,23 +20,13 @@ examples = {
2020
'test_gqtbuttons_widget' : [files('examples/gqtbuttons_example.cc'), ['-gui']],
2121
}
2222

23-
if get_option('i_test')
24-
LD += {
25-
'name' : sub_dir_name,
26-
'sources' : sources,
27-
'headers' : headers,
28-
'moc_headers' : moc_headers,
29-
'qrc_examples_sources' : qrc_examples_sources,
30-
'dependencies' : [yaml_cpp_dep, qt6_deps],
31-
'examples' : examples
32-
}
33-
else
34-
LD += {
35-
'name' : sub_dir_name,
36-
'sources' : sources,
37-
'headers' : headers,
38-
'moc_headers' : moc_headers,
39-
'qrc_examples_sources' : qrc_examples_sources,
40-
'dependencies' : [yaml_cpp_dep, qt6_deps]
41-
}
42-
endif
23+
LD += {
24+
'name' : sub_dir_name,
25+
'sources' : sources,
26+
'headers' : headers,
27+
'moc_headers' : moc_headers,
28+
'qrc_examples_sources' : qrc_examples_sources,
29+
'dependencies' : [yaml_cpp_dep, qt6_deps],
30+
'examples' : examples
31+
}
32+

gsplash/meson.build

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -29,21 +29,11 @@ examples = {
2929
}
3030

3131

32-
if get_option('i_test')
33-
LD += {
34-
'name' : sub_dir_name,
35-
'sources' : sources,
36-
'headers' : headers,
37-
'qrc_examples_sources' : qrc_examples_sources,
38-
'dependencies' : [yaml_cpp_dep, qt6_deps, geant4_deps, expat_dep],
39-
'examples' : examples
40-
}
41-
else
42-
LD += {
43-
'name' : sub_dir_name,
44-
'sources' : sources,
45-
'headers' : headers,
46-
'qrc_examples_sources' : qrc_examples_sources,
47-
'dependencies' : [yaml_cpp_dep, qt6_deps, geant4_deps, expat_dep]
48-
}
49-
endif
32+
LD += {
33+
'name' : sub_dir_name,
34+
'sources' : sources,
35+
'headers' : headers,
36+
'qrc_examples_sources' : qrc_examples_sources,
37+
'dependencies' : [yaml_cpp_dep, qt6_deps, geant4_deps, expat_dep],
38+
'examples' : examples
39+
}

0 commit comments

Comments
 (0)