-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Remove utils/CommandLineParser.h #989
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -24,10 +24,10 @@ limitations under the License. */ | |||
#include <fstream> | ||||
#include <mutex> | ||||
|
||||
#include "paddle/utils/Logging.h" | ||||
#include <gflags/gflags.h> | ||||
|
||||
#include "CommandLineParser.h" | ||||
#include "CustomStackTrace.h" | ||||
#include "Logging.h" | ||||
#include "StringUtil.h" | ||||
#include "Thread.h" | ||||
#include "ThreadLocal.h" | ||||
|
@@ -152,7 +152,12 @@ void initMain(int argc, char** argv) { | |||
line += ' '; | ||||
} | ||||
LOG(INFO) << "commandline: " << line; | ||||
ParseCommandLineFlags(&argc, argv, true); | ||||
|
||||
#ifndef GFLAGS_GFLAGS_H_ | ||||
namespace gflags = google; | ||||
#endif | ||||
|
||||
gflags::ParseCommandLineFlags(&argc, &argv, true); | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 有个bug,gflags的namespace不一定是gflags。 paddle/utils/CommandLineParser.cpp 这里有对namespace的特殊性进行处理。。 不过,如果我们依赖确定某个版本的gflags就没这个问题了。。。 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 我之前也check了一下,应该是老版有这个问题 Line 159 in 46bd5f5
|
||||
CHECK_EQ(argc, 1) << "Unknown commandline argument: " << argv[1]; | ||||
|
||||
installProfilerSwitch(); | ||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
后期可以移到common.h
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent.