39 throw std::runtime_error(
40 "Program is not compiled with with millepede2. Please enable \"WITH_MILLEPEDE=ON\" with CMake.");
45 auto launch_args = std::vector<std::string>{
"-i", steer_filepath.string() };
46 auto exe_path = std::filesystem::path(exe_string);
47 if (not std::filesystem::exists(exe_path))
49 throw std::runtime_error(fmt::format(
"Command {:?} cannot be found or executed!", exe_string));
54 auto pede_program = bpv2::process{
ios_,
58 bpv2::process_stdio{ .in =
nullptr, .out = stdout, .err = stderr } };
59 pede_program.async_wait(
60 [](
const std::error_code& err,
int ret)
64 fmt::println(
"Error occurred from the pede program. Error message: {}", err.message());
66 fmt::println(
"The pede program is closed successfully with the return value: {}", ret);
71 catch (std::exception& ex)
73 throw std::runtime_error(fmt::format(
"Error occurred when launching pede with \"{} {}\": \n {}",
75 fmt::join(launch_args,
" "),