提交 ae174b33 编写于 作者: L liaogang

Remove WITH_GLOG and WITH_GFLAGS in cmake

上级 3d0e73bd
...@@ -14,13 +14,9 @@ if(WITH_STYLE_CHECK) ...@@ -14,13 +14,9 @@ if(WITH_STYLE_CHECK)
find_package(PythonInterp REQUIRED) find_package(PythonInterp REQUIRED)
endif() endif()
if(WITH_GLOG) find_package(Glog REQUIRED)
find_package(Glog REQUIRED)
endif()
if(WITH_GFLAGS) find_package(Gflags REQUIRED)
find_package(Gflags REQUIRED)
endif()
if(WITH_TESTING) if(WITH_TESTING)
find_package(GTest REQUIRED) find_package(GTest REQUIRED)
......
...@@ -65,7 +65,7 @@ endmacro() ...@@ -65,7 +65,7 @@ endmacro()
# link_paddle_exe # link_paddle_exe
# add paddle library for a paddle executable, such as trainer, pserver. # add paddle library for a paddle executable, such as trainer, pserver.
# #
# It will handle WITH_PYTHON/WITH_GLOG etc. # It will handle WITH_PYTHON etc.
function(link_paddle_exe TARGET_NAME) function(link_paddle_exe TARGET_NAME)
if(WITH_RDMA) if(WITH_RDMA)
generate_rdma_links() generate_rdma_links()
...@@ -108,6 +108,8 @@ function(link_paddle_exe TARGET_NAME) ...@@ -108,6 +108,8 @@ function(link_paddle_exe TARGET_NAME)
paddle_cuda paddle_cuda
${METRIC_LIBS} ${METRIC_LIBS}
${PROTOBUF_LIBRARY} ${PROTOBUF_LIBRARY}
${LIBGLOG_LIBRARY}
${GFLAGS_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT} ${CMAKE_THREAD_LIBS_INIT}
${CBLAS_LIBS} ${CBLAS_LIBS}
${ZLIB_LIBRARIES} ${ZLIB_LIBRARIES}
...@@ -125,16 +127,6 @@ function(link_paddle_exe TARGET_NAME) ...@@ -125,16 +127,6 @@ function(link_paddle_exe TARGET_NAME)
${PYTHON_LIBRARIES}) ${PYTHON_LIBRARIES})
endif() endif()
if(WITH_GLOG)
target_link_libraries(${TARGET_NAME}
${LIBGLOG_LIBRARY})
endif()
if(WITH_GFLAGS)
target_link_libraries(${TARGET_NAME}
${GFLAGS_LIBRARIES})
endif()
if(WITH_GPU) if(WITH_GPU)
if(NOT WITH_DSO OR WITH_METRIC) if(NOT WITH_DSO OR WITH_METRIC)
target_link_libraries(${TARGET_NAME} target_link_libraries(${TARGET_NAME}
......
...@@ -49,8 +49,6 @@ PaddlePaddle supports some build options. To enable it, first you need to instal ...@@ -49,8 +49,6 @@ PaddlePaddle supports some build options. To enable it, first you need to instal
<tbody> <tbody>
<tr><td class="left">WITH_GPU</td><td class="left">Compile with GPU mode.</td></tr> <tr><td class="left">WITH_GPU</td><td class="left">Compile with GPU mode.</td></tr>
<tr><td class="left">WITH_DOUBLE</td><td class="left">Compile with double precision floating-point, default: single precision.</td></tr> <tr><td class="left">WITH_DOUBLE</td><td class="left">Compile with double precision floating-point, default: single precision.</td></tr>
<tr><td class="left">WITH_GLOG</td><td class="left">Compile with glog. If not found, default: an internal log implementation.</td></tr>
<tr><td class="left">WITH_GFLAGS</td><td class="left">Compile with gflags. If not found, default: an internal flag implementation.</td></tr>
<tr><td class="left">WITH_TESTING</td><td class="left">Compile with gtest for PaddlePaddle's unit testing.</td></tr> <tr><td class="left">WITH_TESTING</td><td class="left">Compile with gtest for PaddlePaddle's unit testing.</td></tr>
<tr><td class="left">WITH_DOC</td><td class="left"> Compile to generate PaddlePaddle's docs, default: disabled (OFF).</td></tr> <tr><td class="left">WITH_DOC</td><td class="left"> Compile to generate PaddlePaddle's docs, default: disabled (OFF).</td></tr>
<tr><td class="left">WITH_SWIG_PY</td><td class="left">Compile with python predict API, default: disabled (OFF).</td></tr> <tr><td class="left">WITH_SWIG_PY</td><td class="left">Compile with python predict API, default: disabled (OFF).</td></tr>
......
...@@ -6,8 +6,6 @@ WITH_AVX,是否编译含有AVX指令集的PaddlePaddle二进制文件,是 ...@@ -6,8 +6,6 @@ WITH_AVX,是否编译含有AVX指令集的PaddlePaddle二进制文件,是
WITH_PYTHON,是否内嵌PYTHON解释器。方便今后的嵌入式移植工作。,是 WITH_PYTHON,是否内嵌PYTHON解释器。方便今后的嵌入式移植工作。,是
WITH_STYLE_CHECK,是否编译时进行代码风格检查,是 WITH_STYLE_CHECK,是否编译时进行代码风格检查,是
WITH_RDMA,是否开启RDMA,否 WITH_RDMA,是否开启RDMA,否
WITH_GLOG,是否开启GLOG。如果不开启,则会使用一个简化版的日志,同时方便今后的嵌入式移植工作。,取决于是否寻找到GLOG
WITH_GFLAGS,是否使用GFLAGS。如果不开启,则会使用一个简化版的命令行参数解析器,同时方便今后的嵌入式移植工作。,取决于是否寻找到GFLAGS
WITH_TIMER,是否开启计时功能。如果开启会导致运行略慢,打印的日志变多,但是方便调试和测Benchmark,否 WITH_TIMER,是否开启计时功能。如果开启会导致运行略慢,打印的日志变多,但是方便调试和测Benchmark,否
WITH_TESTING,是否开启单元测试,取决于是否寻找到GTEST WITH_TESTING,是否开启单元测试,取决于是否寻找到GTEST
WITH_DOC,是否编译中英文文档,否 WITH_DOC,是否编译中英文文档,否
......
...@@ -46,8 +46,6 @@ PaddlePaddle提供了ubuntu 14.04 deb安装包。 ...@@ -46,8 +46,6 @@ PaddlePaddle提供了ubuntu 14.04 deb安装包。
with_double: OFF with_double: OFF
with_python: ON with_python: ON
with_rdma: OFF with_rdma: OFF
with_glog: ON
with_gflags: ON
with_metric_learning: with_metric_learning:
with_timer: OFF with_timer: OFF
with_predict_sdk: with_predict_sdk:
......
...@@ -17,22 +17,18 @@ add_library(paddle_api STATIC ...@@ -17,22 +17,18 @@ add_library(paddle_api STATIC
${API_SOURCES}) ${API_SOURCES})
add_dependencies(paddle_api gen_proto_cpp) add_dependencies(paddle_api gen_proto_cpp)
list(LENGTH "${GFLAGS_LIBRARIES}" GFLAGS_LIBRARIES_LENGTH)
if(WITH_GFLAGS) if(${GFLAGS_LIBRARIES_LENGTH} EQUAL 0 AND TARGET "${GFLAGS_LIBRARIES}")
list(LENGTH "${GFLAGS_LIBRARIES}" GFLAGS_LIBRARIES_LENGTH) # Because gflags compiled by cmake, so it is imported by cmake target,
# not a real library path. Get the real library path here.
if(${GFLAGS_LIBRARIES_LENGTH} EQUAL 0 AND TARGET "${GFLAGS_LIBRARIES}") message(STATUS "GFLAGS Libraries is ${GFLAGS_LIBRARIES}")
# Because gflags compiled by cmake, so it is imported by cmake target, get_target_property(GFLAGS_LOCATION ${GFLAGS_LIBRARIES} LOCATION)
# not a real library path. Get the real library path here. message(STATUS "GFLAGS Target location is ${GFLAGS_LOCATION}")
message(STATUS "GFLAGS Libraries is ${GFLAGS_LIBRARIES}") else()
get_target_property(GFLAGS_LOCATION ${GFLAGS_LIBRARIES} LOCATION) set(GFLAGS_LOCATION ${GFLAGS_LIBRARIES})
message(STATUS "GFLAGS Target location is ${GFLAGS_LOCATION}")
else()
set(GFLAGS_LOCATION ${GFLAGS_LIBRARIES})
endif()
endif() endif()
configure_file( configure_file(
paddle_api_config.py.in paddle_api_config.py.in
${PROJ_ROOT}/paddle/api/paddle_api_config.py ${PROJ_ROOT}/paddle/api/paddle_api_config.py
......
...@@ -8,9 +8,7 @@ CMAKE_DL_LIBS="@CMAKE_DL_LIBS@" ...@@ -8,9 +8,7 @@ CMAKE_DL_LIBS="@CMAKE_DL_LIBS@"
WITH_PYTHON="@WITH_PYTHON@" WITH_PYTHON="@WITH_PYTHON@"
PYTHON_LIBRARIES="@PYTHON_LIBRARIES@" PYTHON_LIBRARIES="@PYTHON_LIBRARIES@"
WITH_GLOG="@WITH_GLOG@"
LIBGLOG_LIBRARY="@LIBGLOG_LIBRARY@" LIBGLOG_LIBRARY="@LIBGLOG_LIBRARY@"
WITH_GFLAGS="@WITH_GFLAGS@"
GFLAGS_LIBRARIES="@GFLAGS_LIBRARIES@" GFLAGS_LIBRARIES="@GFLAGS_LIBRARIES@"
GFLAGS_LOCATION="@GFLAGS_LOCATION@" GFLAGS_LOCATION="@GFLAGS_LOCATION@"
CBLAS_LIBRARIES="@CBLAS_LIBS@" CBLAS_LIBRARIES="@CBLAS_LIBS@"
......
...@@ -47,10 +47,8 @@ try: ...@@ -47,10 +47,8 @@ try:
self.with_python = PaddleLDFlag.cmake_bool(WITH_PYTHON) self.with_python = PaddleLDFlag.cmake_bool(WITH_PYTHON)
self.python_libs = PYTHON_LIBRARIES self.python_libs = PYTHON_LIBRARIES
self.with_glog = PaddleLDFlag.cmake_bool(WITH_GLOG)
self.glog_libs = LIBGLOG_LIBRARY self.glog_libs = LIBGLOG_LIBRARY
self.with_gflags = PaddleLDFlag.cmake_bool(WITH_GFLAGS)
self.with_coverage = PaddleLDFlag.cmake_bool(WITH_COVERALLS) self.with_coverage = PaddleLDFlag.cmake_bool(WITH_COVERALLS)
self.gflags_libs = GFLAGS_LIBRARIES self.gflags_libs = GFLAGS_LIBRARIES
self.gflags_location = GFLAGS_LOCATION self.gflags_location = GFLAGS_LOCATION
...@@ -88,6 +86,8 @@ try: ...@@ -88,6 +86,8 @@ try:
"-lpaddle_cuda", "-lpaddle_cuda",
"-lpaddle_api", "-lpaddle_api",
self.normalize_flag(self.protolib), self.normalize_flag(self.protolib),
self.normalize_flag(self.glog_libs),
self.normalize_flag(self.gflags_libs),
self.normalize_flag(self.zlib), self.normalize_flag(self.zlib),
self.normalize_flag(self.thread), self.normalize_flag(self.thread),
self.normalize_flag(self.dl_libs), self.normalize_flag(self.dl_libs),
...@@ -96,10 +96,6 @@ try: ...@@ -96,10 +96,6 @@ try:
if self.with_python: if self.with_python:
libs.append(self.normalize_flag(self.python_libs)) libs.append(self.normalize_flag(self.python_libs))
if self.with_glog:
libs.append(self.normalize_flag(self.glog_libs))
if self.with_gflags:
libs.append(self.normalize_flag(self.gflags_libs))
if self.with_gpu: if self.with_gpu:
libs.append(self.normalize_flag(self.curt)) libs.append(self.normalize_flag(self.curt))
if self.with_coverage: if self.with_coverage:
......
...@@ -21,8 +21,6 @@ function version(){ ...@@ -21,8 +21,6 @@ function version(){
echo " with_double: @WITH_DOUBLE@" echo " with_double: @WITH_DOUBLE@"
echo " with_python: @WITH_PYTHON@" echo " with_python: @WITH_PYTHON@"
echo " with_rdma: @WITH_RDMA@" echo " with_rdma: @WITH_RDMA@"
echo " with_glog: @WITH_GLOG@"
echo " with_gflags: @WITH_GFLAGS@"
echo " with_metric_learning: @WITH_METRIC@" echo " with_metric_learning: @WITH_METRIC@"
echo " with_timer: @WITH_TIMER@" echo " with_timer: @WITH_TIMER@"
echo " with_predict_sdk: @WITH_PREDICT_SDK@" echo " with_predict_sdk: @WITH_PREDICT_SDK@"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册