Skip to content

Commit 6540cda

Browse files
committed
Merge remote-tracking branch 'origin/develop' into feature/recordio
2 parents af5dcda + d43469b commit 6540cda

File tree

133 files changed

+2808
-727
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

133 files changed

+2808
-727
lines changed

.travis.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,17 @@ cache:
44
- $HOME/.ccache
55
- $HOME/.cache/pip
66
- $TRAVIS_BUILD_DIR/build/third_party
7+
- $TRAVIS_BUILD_DIR/build_android/third_party
78
sudo: required
89
dist: trusty
10+
services:
11+
- docker
912
os:
1013
- linux
1114
env:
1215
- JOB=build_doc
1316
- JOB=check_style
17+
- JOB=build_android
1418
addons:
1519
apt:
1620
packages:
@@ -41,8 +45,10 @@ before_install:
4145
function timeout() { perl -e 'alarm shift; exec @ARGV' "$@"; }
4246
script:
4347
- |
44-
timeout 2580 paddle/scripts/travis/${JOB}.sh # 43min timeout
45-
RESULT=$?; if [ $RESULT -eq 0 ] || [ $RESULT -eq 142 ]; then true ;else exit 1; fi;
48+
# 43min timeout
49+
if [[ "$JOB" == "build_android" ]]; then timeout 2580 docker run -it --rm -v "$TRAVIS_BUILD_DIR:/paddle" paddlepaddle/paddle:latest-dev-android;
50+
else timeout 2580 paddle/scripts/travis/${JOB}.sh; fi;
51+
RESULT=$?; if [ $RESULT -eq 0 ] || [ $RESULT -eq 142 ]; then true; else exit 1; fi;
4652
- |
4753
if [[ "$JOB" != "build_doc" ]]; then exit 0; fi;
4854
if [[ "$TRAVIS_PULL_REQUEST" != "false" ]]; then exit 0; fi;

AUTHORS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
| Github account | name |
22
|---|---|
3+
| abhinavarora | Abhinav Arora |
34
| backyes | Yan-Fei Wang |
45
| beckett1124 | Bin Qi |
56
| JiayiFeng | Jia-Yi Feng |

CMakeLists.txt

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ set(PADDLE_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})
1919

2020
include(system)
2121

22-
project(paddle CXX C Go)
22+
project(paddle CXX C)
2323
message(STATUS "CXX compiler: ${CMAKE_CXX_COMPILER}, version: "
2424
"${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION}")
2525
message(STATUS "C compiler: ${CMAKE_C_COMPILER}, version: "
@@ -166,16 +166,16 @@ include_directories("${CMAKE_CURRENT_BINARY_DIR}/proto")
166166
include_directories("${CMAKE_CURRENT_BINARY_DIR}/go/pserver/client/c")
167167

168168
set(EXTERNAL_LIBS
169-
${GFLAGS_LIBRARIES}
170-
${GLOG_LIBRARIES}
169+
gflags
170+
glog
171171
${CBLAS_LIBRARIES}
172-
${PROTOBUF_LIBRARY}
173-
${ZLIB_LIBRARIES}
172+
protobuf
173+
zlib
174174
${PYTHON_LIBRARIES}
175175
)
176176

177177
if(WITH_GPU)
178-
include(cuda)
178+
include(cuda)
179179
endif(WITH_GPU)
180180

181181
if(WITH_MKLML)
@@ -202,17 +202,18 @@ endif()
202202
# "add_subdirectory(paddle)" and "add_subdirectory(python)" should be
203203
# placed after this block, because they depends on it.
204204
if(WITH_GOLANG)
205+
enable_language(Go)
205206
add_subdirectory(go)
206207
endif(WITH_GOLANG)
207208

208209
set(PADDLE_PYTHON_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}/python/build")
209210

210-
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O3 -g -DNDEBUG")
211-
SET(CMAKE_C_FLAGS_RELWITHDEBINFO "-O3 -g -DNDEBUG")
211+
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O3 -g -DNDEBUG")
212+
set(CMAKE_C_FLAGS_RELWITHDEBINFO "-O3 -g -DNDEBUG")
212213

213214
add_subdirectory(paddle)
214215
if(WITH_PYTHON)
215-
add_subdirectory(python)
216+
add_subdirectory(python)
216217
endif()
217218

218219
if(WITH_DOC)

Dockerfile.android

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,6 @@ RUN apt-get update && \
2121
wget curl tar unzip gcc g++ locales clang-format-3.8 swig cmake && \
2222
apt-get clean -y
2323

24-
# Install Go and glide
25-
RUN wget -qO- go.tgz https://storage.googleapis.com/golang/go1.8.1.linux-amd64.tar.gz | \
26-
tar -xz -C /usr/local && \
27-
mkdir /root/gopath && \
28-
mkdir /root/gopath/bin && \
29-
mkdir /root/gopath/src
30-
ENV GOROOT=/usr/local/go GOPATH=/root/gopath
31-
# should not be in the same line with GOROOT definition, otherwise docker build could not find GOROOT.
32-
ENV PATH=${PATH}:${GOROOT}/bin:${GOPATH}/bin
33-
3424
# git credential to skip password typing
3525
RUN git config --global credential.helper store
3626

cmake/configure.cmake

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ endif(NOT WITH_GOLANG)
5959

6060
if(NOT WITH_GPU)
6161
add_definitions(-DHPPL_STUB_FUNC)
62-
add_definitions("-DCUPTI_LIB_PATH=\"\"")
6362

6463
list(APPEND CMAKE_CXX_SOURCE_FILE_EXTENSIONS cu)
6564
else()
@@ -77,9 +76,7 @@ else()
7776
if(CUPTI_FOUND)
7877
include_directories(${CUPTI_INCLUDE_DIR})
7978
add_definitions(-DPADDLE_WITH_CUPTI)
80-
add_definitions("-DCUPTI_LIB_PATH=\"${CUPTI_LIBRARY_PATH}\"")
8179
else()
82-
add_definitions("-DCUPTI_LIB_PATH=\"\"")
8380
message(STATUS "Cannot find CUPTI, GPU Profiling is incorrect.")
8481
endif()
8582
set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} "-Xcompiler ${SIMD_FLAG}")

cmake/external/zlib.cmake

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ ENDIF(WIN32)
2828
INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIR})
2929

3030
ExternalProject_Add(
31-
zlib
31+
extern_zlib
3232
${EXTERNAL_PROJECT_LOG_ARGS}
3333
GIT_REPOSITORY "https://github.com/madler/zlib.git"
3434
GIT_TAG "v1.2.8"
@@ -49,9 +49,11 @@ ExternalProject_Add(
4949
-DCMAKE_BUILD_TYPE:STRING=${THIRD_PARTY_BUILD_TYPE}
5050
)
5151

52+
ADD_LIBRARY(zlib STATIC IMPORTED GLOBAL)
53+
SET_PROPERTY(TARGET zlib PROPERTY IMPORTED_LOCATION ${ZLIB_LIBRARIES})
54+
ADD_DEPENDENCIES(zlib extern_zlib)
55+
5256
LIST(APPEND external_project_dependencies zlib)
53-
ADD_LIBRARY(zlib_target STATIC IMPORTED GLOBAL)
54-
SET_PROPERTY(TARGET zlib_target PROPERTY IMPORTED_LOCATION ${ZLIB_LIBRARIES})
5557

5658
IF(WITH_C_API)
5759
INSTALL(DIRECTORY ${ZLIB_INCLUDE_DIR} DESTINATION third_party/zlib)

cmake/generic.cmake

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,9 @@ function(merge_static_libs TARGET_NAME)
104104
foreach(lib ${libs})
105105
list(APPEND libs_deps ${${lib}_LIB_DEPENDS})
106106
endforeach()
107-
list(REMOVE_DUPLICATES libs_deps)
107+
if(libs_deps)
108+
list(REMOVE_DUPLICATES libs_deps)
109+
endif()
108110

109111
# To produce a library we need at least one source file.
110112
# It is created by add_custom_command below and will helps
@@ -191,10 +193,13 @@ function(cc_library TARGET_NAME)
191193
list(REMOVE_ITEM cc_library_DEPS warpctc)
192194
add_dependencies(${TARGET_NAME} warpctc)
193195
endif()
194-
# Support linking flags: --whole-archive (Linux) / -force_load (MacOS)
195-
target_circle_link_libraries(${TARGET_NAME} ${cc_library_DEPS})
196196
if("${cc_library_DEPS}" MATCHES "ARCHIVE_START")
197+
# Support linking flags: --whole-archive (Linux) / -force_load (MacOS).
198+
# WARNING: Please don't use ARCHIVE_START&ARCHIVE_END if TARGET_NAME will be linked by other libraries.
199+
target_circle_link_libraries(${TARGET_NAME} ${cc_library_DEPS})
197200
list(REMOVE_ITEM cc_library_DEPS ARCHIVE_START ARCHIVE_END)
201+
else()
202+
target_link_libraries(${TARGET_NAME} ${cc_library_DEPS})
198203
endif()
199204
add_dependencies(${TARGET_NAME} ${cc_library_DEPS})
200205
endif()

cmake/inference_lib.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ copy(inference_lib DEPENDS paddle_fluid_shared
7272
)
7373

7474
set(module "platform")
75-
copy(platform_lib
75+
copy(platform_lib DEPS profiler_py_proto
7676
SRCS ${src_dir}/${module}/*.h ${src_dir}/${module}/dynload/*.h ${src_dir}/${module}/details/*.h
7777
DSTS ${dst_dir}/${module} ${dst_dir}/${module}/dynload ${dst_dir}/${module}/details
7878
)

doc/build_and_install/build_from_source_cn.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
为了编译PaddlePaddle,我们需要
1010

1111
1. 一台电脑,可以装的是 Linux, Windows 或者 MacOS 操作系统
12-
1. Docker
12+
2. Docker
1313

1414
不需要依赖其他任何软件了。即便是 Python 和 GCC 都不需要,因为我们会把所有编译工具都安装进一个 Docker 镜像里。
1515

@@ -189,7 +189,7 @@ PaddlePaddle的编译选项,包括生成CPU/GPU二进制文件、链接何种B
189189
"WITH_TESTING", "是否开启单元测试", "OFF"
190190
"WITH_DOC", "是否编译中英文文档", "OFF"
191191
"WITH_SWIG_PY", "是否编译PYTHON的SWIG接口,该接口可用于预测和定制化训练", "Auto"
192-
"WITH_GOLANG", "是否编译go语言的可容错parameter server", "ON"
192+
"WITH_GOLANG", "是否编译go语言的可容错parameter server", "OFF"
193193
"WITH_MKL", "是否使用MKL数学库,如果为否则是用OpenBLAS", "ON"
194194

195195
BLAS

doc/build_and_install/build_from_source_en.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Requirements
99
To build PaddlePaddle, you need
1010

1111
1. A computer -- Linux, Windows, MacOS.
12-
1. Docker.
12+
2. Docker.
1313

1414
Nothing else. Not even Python and GCC, because you can install all build tools into a Docker image.
1515
We run all the tools by running this image.
@@ -191,7 +191,7 @@ You can add :code:`-D` argument to pass such options, like:
191191
"WITH_TESTING", "Build unit tests", "OFF"
192192
"WITH_DOC", "Build documentations", "OFF"
193193
"WITH_SWIG_PY", "Build Python SWIG interface for V2 API", "Auto"
194-
"WITH_GOLANG", "Build fault-tolerant parameter server written in go", "ON"
194+
"WITH_GOLANG", "Build fault-tolerant parameter server written in go", "OFF"
195195
"WITH_MKL", "Use MKL as BLAS library, else use OpenBLAS", "ON"
196196

197197

0 commit comments

Comments
 (0)