Skip to content

Commit ae174b3

Browse files
committed
Remove WITH_GLOG and WITH_GFLAGS in cmake
1 parent 3d0e73b commit ae174b3

File tree

9 files changed

+18
-48
lines changed

9 files changed

+18
-48
lines changed

cmake/check_packages.cmake

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,9 @@ if(WITH_STYLE_CHECK)
1414
find_package(PythonInterp REQUIRED)
1515
endif()
1616

17-
if(WITH_GLOG)
18-
find_package(Glog REQUIRED)
19-
endif()
17+
find_package(Glog REQUIRED)
2018

21-
if(WITH_GFLAGS)
22-
find_package(Gflags REQUIRED)
23-
endif()
19+
find_package(Gflags REQUIRED)
2420

2521
if(WITH_TESTING)
2622
find_package(GTest REQUIRED)

cmake/util.cmake

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ endmacro()
6565
# link_paddle_exe
6666
# add paddle library for a paddle executable, such as trainer, pserver.
6767
#
68-
# It will handle WITH_PYTHON/WITH_GLOG etc.
68+
# It will handle WITH_PYTHON etc.
6969
function(link_paddle_exe TARGET_NAME)
7070
if(WITH_RDMA)
7171
generate_rdma_links()
@@ -108,6 +108,8 @@ function(link_paddle_exe TARGET_NAME)
108108
paddle_cuda
109109
${METRIC_LIBS}
110110
${PROTOBUF_LIBRARY}
111+
${LIBGLOG_LIBRARY}
112+
${GFLAGS_LIBRARIES}
111113
${CMAKE_THREAD_LIBS_INIT}
112114
${CBLAS_LIBS}
113115
${ZLIB_LIBRARIES}
@@ -125,16 +127,6 @@ function(link_paddle_exe TARGET_NAME)
125127
${PYTHON_LIBRARIES})
126128
endif()
127129

128-
if(WITH_GLOG)
129-
target_link_libraries(${TARGET_NAME}
130-
${LIBGLOG_LIBRARY})
131-
endif()
132-
133-
if(WITH_GFLAGS)
134-
target_link_libraries(${TARGET_NAME}
135-
${GFLAGS_LIBRARIES})
136-
endif()
137-
138130
if(WITH_GPU)
139131
if(NOT WITH_DSO OR WITH_METRIC)
140132
target_link_libraries(${TARGET_NAME}

doc/getstarted/build_and_install/build_from_source_en.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,8 @@ PaddlePaddle supports some build options. To enable it, first you need to instal
4949
<tbody>
5050
<tr><td class="left">WITH_GPU</td><td class="left">Compile with GPU mode.</td></tr>
5151
<tr><td class="left">WITH_DOUBLE</td><td class="left">Compile with double precision floating-point, default: single precision.</td></tr>
52-
<tr><td class="left">WITH_GLOG</td><td class="left">Compile with glog. If not found, default: an internal log implementation.</td></tr>
53-
<tr><td class="left">WITH_GFLAGS</td><td class="left">Compile with gflags. If not found, default: an internal flag implementation.</td></tr>
5452
<tr><td class="left">WITH_TESTING</td><td class="left">Compile with gtest for PaddlePaddle's unit testing.</td></tr>
55-
<tr><td class="left">WITH_DOC</td><td class="left"> Compile to generate PaddlePaddle's docs, default: disabled (OFF).</td></tr>
53+
<tr><td class="left">WITH_DOC</td><td class="left"> Compile to generate PaddlePaddle's docs, default: disabled (OFF).</td></tr>
5654
<tr><td class="left">WITH_SWIG_PY</td><td class="left">Compile with python predict API, default: disabled (OFF).</td></tr>
5755
<tr><td class="left">WITH_STYLE_CHECK</td><td class="left">Compile with code style check, default: enabled (ON).</td></tr>
5856
</tbody>

doc/getstarted/build_and_install/cmake/compile_options.csv

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ WITH_AVX,是否编译含有AVX指令集的PaddlePaddle二进制文件,是
66
WITH_PYTHON,是否内嵌PYTHON解释器。方便今后的嵌入式移植工作。,是
77
WITH_STYLE_CHECK,是否编译时进行代码风格检查,是
88
WITH_RDMA,是否开启RDMA,否
9-
WITH_GLOG,是否开启GLOG。如果不开启,则会使用一个简化版的日志,同时方便今后的嵌入式移植工作。,取决于是否寻找到GLOG
10-
WITH_GFLAGS,是否使用GFLAGS。如果不开启,则会使用一个简化版的命令行参数解析器,同时方便今后的嵌入式移植工作。,取决于是否寻找到GFLAGS
119
WITH_TIMER,是否开启计时功能。如果开启会导致运行略慢,打印的日志变多,但是方便调试和测Benchmark,否
1210
WITH_TESTING,是否开启单元测试,取决于是否寻找到GTEST
1311
WITH_DOC,是否编译中英文文档,否

doc/getstarted/build_and_install/ubuntu_install_cn.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,6 @@ PaddlePaddle提供了ubuntu 14.04 deb安装包。
4646
with_double: OFF
4747
with_python: ON
4848
with_rdma: OFF
49-
with_glog: ON
50-
with_gflags: ON
5149
with_metric_learning:
5250
with_timer: OFF
5351
with_predict_sdk:

paddle/api/CMakeLists.txt

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,22 +17,18 @@ add_library(paddle_api STATIC
1717
${API_SOURCES})
1818
add_dependencies(paddle_api gen_proto_cpp)
1919

20+
list(LENGTH "${GFLAGS_LIBRARIES}" GFLAGS_LIBRARIES_LENGTH)
2021

21-
if(WITH_GFLAGS)
22-
list(LENGTH "${GFLAGS_LIBRARIES}" GFLAGS_LIBRARIES_LENGTH)
23-
24-
if(${GFLAGS_LIBRARIES_LENGTH} EQUAL 0 AND TARGET "${GFLAGS_LIBRARIES}")
25-
# Because gflags compiled by cmake, so it is imported by cmake target,
26-
# not a real library path. Get the real library path here.
27-
message(STATUS "GFLAGS Libraries is ${GFLAGS_LIBRARIES}")
28-
get_target_property(GFLAGS_LOCATION ${GFLAGS_LIBRARIES} LOCATION)
29-
message(STATUS "GFLAGS Target location is ${GFLAGS_LOCATION}")
30-
else()
31-
set(GFLAGS_LOCATION ${GFLAGS_LIBRARIES})
32-
endif()
22+
if(${GFLAGS_LIBRARIES_LENGTH} EQUAL 0 AND TARGET "${GFLAGS_LIBRARIES}")
23+
# Because gflags compiled by cmake, so it is imported by cmake target,
24+
# not a real library path. Get the real library path here.
25+
message(STATUS "GFLAGS Libraries is ${GFLAGS_LIBRARIES}")
26+
get_target_property(GFLAGS_LOCATION ${GFLAGS_LIBRARIES} LOCATION)
27+
message(STATUS "GFLAGS Target location is ${GFLAGS_LOCATION}")
28+
else()
29+
set(GFLAGS_LOCATION ${GFLAGS_LIBRARIES})
3330
endif()
3431

35-
3632
configure_file(
3733
paddle_api_config.py.in
3834
${PROJ_ROOT}/paddle/api/paddle_api_config.py
@@ -57,7 +53,7 @@ add_custom_command(OUTPUT ${PROJ_ROOT}/paddle/dist/.timestamp
5753
paddle_trainer
5854
paddle_api
5955
paddle_cuda
60-
${PY_PADDLE_PYTHON_FILES}
56+
${PY_PADDLE_PYTHON_FILES}
6157
)
6258

6359
install(DIRECTORY ${PROJ_ROOT}/paddle/dist/

paddle/api/paddle_api_config.py.in

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@ CMAKE_DL_LIBS="@CMAKE_DL_LIBS@"
88

99
WITH_PYTHON="@WITH_PYTHON@"
1010
PYTHON_LIBRARIES="@PYTHON_LIBRARIES@"
11-
WITH_GLOG="@WITH_GLOG@"
1211
LIBGLOG_LIBRARY="@LIBGLOG_LIBRARY@"
13-
WITH_GFLAGS="@WITH_GFLAGS@"
1412
GFLAGS_LIBRARIES="@GFLAGS_LIBRARIES@"
1513
GFLAGS_LOCATION="@GFLAGS_LOCATION@"
1614
CBLAS_LIBRARIES="@CBLAS_LIBS@"

paddle/api/paddle_ld_flags.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,8 @@ def __init__(self):
4747
self.with_python = PaddleLDFlag.cmake_bool(WITH_PYTHON)
4848
self.python_libs = PYTHON_LIBRARIES
4949

50-
self.with_glog = PaddleLDFlag.cmake_bool(WITH_GLOG)
5150
self.glog_libs = LIBGLOG_LIBRARY
5251

53-
self.with_gflags = PaddleLDFlag.cmake_bool(WITH_GFLAGS)
5452
self.with_coverage = PaddleLDFlag.cmake_bool(WITH_COVERALLS)
5553
self.gflags_libs = GFLAGS_LIBRARIES
5654
self.gflags_location = GFLAGS_LOCATION
@@ -88,6 +86,8 @@ def libs_str(self):
8886
"-lpaddle_cuda",
8987
"-lpaddle_api",
9088
self.normalize_flag(self.protolib),
89+
self.normalize_flag(self.glog_libs),
90+
self.normalize_flag(self.gflags_libs),
9191
self.normalize_flag(self.zlib),
9292
self.normalize_flag(self.thread),
9393
self.normalize_flag(self.dl_libs),
@@ -96,10 +96,6 @@ def libs_str(self):
9696

9797
if self.with_python:
9898
libs.append(self.normalize_flag(self.python_libs))
99-
if self.with_glog:
100-
libs.append(self.normalize_flag(self.glog_libs))
101-
if self.with_gflags:
102-
libs.append(self.normalize_flag(self.gflags_libs))
10399
if self.with_gpu:
104100
libs.append(self.normalize_flag(self.curt))
105101
if self.with_coverage:

paddle/scripts/submit_local.sh.in

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ function version(){
2121
echo " with_double: @WITH_DOUBLE@"
2222
echo " with_python: @WITH_PYTHON@"
2323
echo " with_rdma: @WITH_RDMA@"
24-
echo " with_glog: @WITH_GLOG@"
25-
echo " with_gflags: @WITH_GFLAGS@"
2624
echo " with_metric_learning: @WITH_METRIC@"
2725
echo " with_timer: @WITH_TIMER@"
2826
echo " with_predict_sdk: @WITH_PREDICT_SDK@"

0 commit comments

Comments
 (0)