#define CAFFE_COMMON_HPP_
#include <boost/shared_ptr.hpp>
+#include <gflags/gflags.h>
#include <glog/logging.h>
#include <cmath>
#include "caffe/util/device_alternate.hpp"
+// gflags 2.1 issue: namespace google was changed to gflags without warning.
+// Luckily we will be able to use GFLAGS_GFAGS_H_ to detect if it is version
+// 2.1. If yes , we will add a temporary solution to redirect the namespace.
+// TODO(Yangqing): Once gflags solves the problem in a more elegant way, let's
+// remove the following hack.
+#ifndef GFLAGS_GFLAGS_H_
+namespace gflags = google;
+#endif // GFLAGS_GFLAGS_H_
+
// Disable the copy and assignment operator for a class.
#define DISABLE_COPY_AND_ASSIGN(classname) \
private:\
-#include <gflags/gflags.h>
#include <glog/logging.h>
#include <cstdio>
#include <ctime>
#include "caffe/common.hpp"
#include "caffe/util/rng.hpp"
-// gflags 2.1 issue: namespace google was changed to gflags without warning.
-// Luckily we will be able to use GFLAGS_GFAGS_H_ to detect if it is version
-// 2.1. If yes , we will add a temporary solution to redirect the namespace.
-// TODO(Yangqing): Once gflags solves the problem in a more elegant way, let's
-// remove the following hack.
-#ifdef GFLAGS_GFLAGS_H_
-namespace google {
-using ::gflags::ParseCommandLineFlags;
-} // namespace google
-#endif // GFLAGS_GFLAGS_H_
-
namespace caffe {
shared_ptr<Caffe> Caffe::singleton_;
void GlobalInit(int* pargc, char*** pargv) {
// Google flags.
- ::google::ParseCommandLineFlags(pargc, pargv, true);
+ ::gflags::ParseCommandLineFlags(pargc, pargv, true);
// Google logging.
::google::InitGoogleLogging(*(pargv)[0]);
}