diff --git a/cmake/configure.cmake b/cmake/configure.cmake index 4d0b04209c059ba06fb0a988310bd3e0f345e09e..dc661fce388fe182fdf60162814180ec8b5219c2 100644 --- a/cmake/configure.cmake +++ b/cmake/configure.cmake @@ -201,10 +201,6 @@ if(WITH_DISTRIBUTE) add_definitions(-DPADDLE_WITH_DISTRIBUTE) endif() -if(WITH_GFLAGS) - add_definitions(-DPADDLE_WITH_GFLAGS) -endif() - if(WITH_PSCORE) add_definitions(-DPADDLE_WITH_PSCORE) endif() diff --git a/cmake/external/gflags.cmake b/cmake/external/gflags.cmake index 75436783c7ede298f40f9f701cd5fd37af692d24..3398f8a28307ec6f8f36bc8f8ff2048da73b905f 100755 --- a/cmake/external/gflags.cmake +++ b/cmake/external/gflags.cmake @@ -110,6 +110,7 @@ endif() set(flags_dep) if(WITH_GFLAGS) list(APPEND flags_dep gflags) + add_definitions(-DPADDLE_WITH_GFLAGS) else() list(APPEND flags_dep paddle_flags) endif() diff --git a/paddle/utils/flags.h b/paddle/utils/flags.h index 3f68ba2f5dc1f43059a8092ecd6f305d82283272..06c84ae15ab7f1302cb91da5e133fe80ded9cc77 100644 --- a/paddle/utils/flags.h +++ b/paddle/utils/flags.h @@ -79,8 +79,8 @@ using gflags::DoubleFromEnv; using gflags::Int32FromEnv; using gflags::Int64FromEnv; using gflags::StringFromEnv; -using gflags::UInt32FromEnv; -using gflags::UInt64FromEnv; +using gflags::Uint32FromEnv; +using gflags::Uint64FromEnv; #else #define DEFINE_FROM_ENV_FUNC(type, name) \ inline type name##FromEnv(const std::string& env_var_name, \ @@ -90,9 +90,9 @@ using gflags::UInt64FromEnv; DEFINE_FROM_ENV_FUNC(bool, Bool); DEFINE_FROM_ENV_FUNC(int32_t, Int32); -DEFINE_FROM_ENV_FUNC(uint32_t, UInt32); +DEFINE_FROM_ENV_FUNC(uint32_t, Uint32); DEFINE_FROM_ENV_FUNC(int64_t, Int64); -DEFINE_FROM_ENV_FUNC(uint64_t, UInt64); +DEFINE_FROM_ENV_FUNC(uint64_t, Uint64); DEFINE_FROM_ENV_FUNC(double, Double); DEFINE_FROM_ENV_FUNC(std::string, String);