24 #ifndef GRAPHLAB_COMMAND_LINE_OPTIONS
25 #define GRAPHLAB_COMMAND_LINE_OPTIONS
31 #include <boost/program_options.hpp>
34 #include <graphlab/options/graphlab_options.hpp>
44 std::stringstream strm;
46 for(
size_t i = 0; i < vec.size(); ++i) {
48 if(i < vec.size() - 1) strm <<
", ";
60 std::string lexical_cast< std::string>(
const std::vector<int>& vec);
68 std::string lexical_cast< std::string>(
const std::vector<uint32_t>& vec);
76 std::string lexical_cast<std::string>(
const std::vector<uint64_t>& vec);
85 std::string lexical_cast< std::string >(
const std::vector<double>& vec);
93 std::string lexical_cast< std::string>(
const std::vector<float>& vec);
101 std::string lexical_cast< std::string>(
const std::vector<std::string>& vec);
169 boost::program_options::options_description desc;
170 boost::program_options::positional_options_description
172 size_t num_positional;
173 boost::program_options::variables_map vm;
175 bool suppress_graphlab_options;
177 std::vector<std::string> unrecognized_options;
195 bool suppress_graphlab_options =
false) :
196 desc(desc_str), num_positional(0),
197 suppress_graphlab_options(suppress_graphlab_options) {
199 namespace boost_po = boost::program_options;
200 desc.add_options()(
"help",
"Print this help message.");
221 bool parse(
int argc,
const char*
const* argv,
222 bool allow_unregistered =
false);
229 bool is_set(
const std::string& option);
237 return unrecognized_options;
263 const std::string& description) {
264 namespace boost_po = boost::program_options;
266 (option.c_str(), boost_po::value<T>(&ret_var)->default_value(ret_var),
267 description.c_str());