SINGA-94 Move call to google::InitGoogleLogging() from Driver::Init() to main()
update rnnlm example to init glog in its main.cc Project: http://git-wip-us.apache.org/repos/asf/incubator-singa/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-singa/commit/e5e679f8 Tree: http://git-wip-us.apache.org/repos/asf/incubator-singa/tree/e5e679f8 Diff: http://git-wip-us.apache.org/repos/asf/incubator-singa/diff/e5e679f8 Branch: refs/heads/master Commit: e5e679f8c2e6c3953c07451449648c4da7a7867c Parents: 4abee35 Author: wang sheng <[email protected]> Authored: Tue Oct 20 18:12:23 2015 +0800 Committer: wang sheng <[email protected]> Committed: Tue Oct 20 18:12:23 2015 +0800 ---------------------------------------------------------------------- examples/rnnlm/main.cc | 5 +++++ src/main.cc | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/e5e679f8/examples/rnnlm/main.cc ---------------------------------------------------------------------- diff --git a/examples/rnnlm/main.cc b/examples/rnnlm/main.cc index eb264cd..9124383 100644 --- a/examples/rnnlm/main.cc +++ b/examples/rnnlm/main.cc @@ -18,12 +18,17 @@ * under the License. * *************************************************************/ + +#include <glog/logging.h> #include <string> #include "singa/singa.h" #include "rnnlm.h" #include "rnnlm.pb.h" int main(int argc, char **argv) { + // initialize glog before creating the driver + google::InitGoogleLogging(argv[0]); + singa::Driver driver; driver.Init(argc, argv); http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/e5e679f8/src/main.cc ---------------------------------------------------------------------- diff --git a/src/main.cc b/src/main.cc index fc094ad..a07f86b 100644 --- a/src/main.cc +++ b/src/main.cc @@ -19,8 +19,8 @@ * *************************************************************/ -#include <iostream> #include <glog/logging.h> +#include <iostream> #include "singa/singa.h" /**
