Consolidate tools.

This is to consolidate the various tools that caffe has into one single binary ("caffe.bin"), and deprecate the multiple binaries hard to remember. In the meantime, we will also switch to the gflags library and get rid of all the argv[4] type hard-coding.

As a result, if you want to do device query, do:

build/tools/caffe.bin devicequery --device_id=0

if you want to do e.g. training with an option of finetuning, do

build/tools/caffe.bin train --solver_proto_file=solver.prototxt [--pretrained_net_file=pretrained.binaryproto]

I have currently deprecated device_query, train_net, finetune_net, net_speed_benchmark. Others could be potentially deprecated in the same way.
Thanks for consolidating like we talked about @Yangqing! Looks good to
merge once the bundled examples are updated and Jeff's comments are
addressed.

I too would rather have "caffe" instead of "caffe.bin" but for deprecation
let's just add the symlink to the Makefile, then in the following
release drop the .bin.

On Friday, July 25, 2014, Jeff Donahue <notifications@github.com> wrote:

> In tools/train_net.cpp:
>
> > -
> > -  SolverParameter solver_param;
> > -  ReadProtoFromTextFileOrDie(argv[1], &solver_param);
> > -
> > -  LOG(INFO) << "Starting Optimization";
> > -  SGDSolver<float> solver(solver_param);
> > -  if (argc == 3) {
> > -    LOG(INFO) << "Resuming from " << argv[2];
> > -    solver.Solve(argv[2]);
> > -  } else {
> > -    solver.Solve();
> > -  }
> > -  LOG(INFO) << "Optimization Done.";
> > -
> > +  LOG(ERROR) << "Deprecated. Use caffe.bin train --solver_proto_file=... "
> > +                "[--resume_point_file=...] instead.";
>
> (obviously this doesn't matter much because the tool no longer does
> anything anyway, but I think it might be good to have the script fail by
> returning 1 and/or LOG(FATAL)ing in case someone actually makes use of
> those exit codes to see if their script calling train_net.bin succeeded)
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/BVLC/caffe/pull/789/files#r15431553>.
>