Skip to content

A few fixes to yaml, cmake 3, and weird crash when reading parameters

Oleksandr Zenaiev requested to merge sz_fixes into master

Fixes:

(1) backward compatibility for old yaml-cpp-0.6.1 (I hope it works with newer 0.7.0 as well, but did not test - CI should do it)

UPD Tested with yaml-cpp-0.7.0: works fine

(2) use cmake3 command only if availale; otherwise use cmake (helps on system w/o cmake3 command)

(3) weird problems with parameter names in FORTRAN and C: the code crashes for me on gcc version 11.2.1 20220127 (Red Hat 11.2.1-9) when reading parameters:

terminate called after throwing an instance of 'std::out_of_range'
  what():  basic_string::erase
Aborted

After fixing this crash (related to erase in add_to_param_map_ in xfitter_pars.cc), there were crashes in mnpout, and finally a problem with parameter names written to parsout_? (real parameter name + garbage); all other changes were done to fix this. Some references which I used:

http://www.math.utah.edu/software/c-with-fortran.html#calling-sequence-diffs

(in particular to assign a source string to a target string in a loop with TMP variable)

Edited by Oleksandr Zenaiev

Merge request reports