@@ -31,72 +31,67 @@ ls -l $setup_log
3131ls -l $compile_log
3232ls -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
3635echo " > Root-config: $( which root-config) : $( root-config --version) " | tee -a $setup_log
3736
3837setup_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
5250meson 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
5854if [ $? -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
6258else
63- echo Compile Successful
64- echo ; echo
59+ echo Build Configure Successful
60+ echo
61+ echo
6562fi
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
7367if [ $? -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
7771else
78- echo Install Successful
79- echo ; echo
72+ echo Compile Successful
73+ echo
74+ echo
8075fi
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
8682if [[ $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}' )
9187fi
9288
9389echo
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
9793if [[ " $( uname) " == " Darwin" ]]; then
9894 otool -L $GEMC /bin/gemc
9995else
100- ldd $GEMC /bin/gemc | tee -a $compile_log
96+ ldd $GEMC /bin/gemc | tee -a $compile_log
10197fi
102-
0 commit comments