| 26 | namespace py = pybind11; |
| 27 | |
| 28 | void parse_gflags(const std::vector<std::string>& argv) |
| 29 | { |
| 30 | try |
| 31 | { |
| 32 | std::vector<char*> argv_vec; |
| 33 | for (auto& arg : argv) |
| 34 | argv_vec.emplace_back((char*)arg.c_str()); |
| 35 | char** cast = &argv_vec[0]; |
| 36 | int size = (int)argv_vec.size(); |
| 37 | gflags::ParseCommandLineFlags(&size, &cast, true); |
| 38 | } |
| 39 | catch (const std::exception& e) |
| 40 | { |
| 41 | error(e.what(), __LINE__, __FUNCTION__, __FILE__); |
| 42 | } |
| 43 | } |
| 44 | |
| 45 | void init_int(py::dict d) |
| 46 | { |