Skip to content

Commit 861c19d

Browse files
author
wopeizl
authored
Merge pull request #15820 from PaddlePaddle/revert-15793-cherry-pick/update_protobuf
Revert "Cherry pick/update protobuf"
2 parents 08a8c1d + 1f01597 commit 861c19d

File tree

6 files changed

+10
-31
lines changed

6 files changed

+10
-31
lines changed

cmake/external/protobuf.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ FUNCTION(build_protobuf TARGET_NAME BUILD_FOR_HOST)
203203
ENDIF()
204204

205205
SET(PROTOBUF_REPO "https://github.com/google/protobuf.git")
206-
SET(PROTOBUF_TAG "v3.6.1")
206+
SET(PROTOBUF_TAG "9f75c5aa851cd877fb0d93ccc31b8567a6706546")
207207

208208
ExternalProject_Add(
209209
${TARGET_NAME}
@@ -231,7 +231,7 @@ FUNCTION(build_protobuf TARGET_NAME BUILD_FOR_HOST)
231231
)
232232
ENDFUNCTION()
233233

234-
SET(PROTOBUF_VERSION 3.6.1)
234+
SET(PROTOBUF_VERSION 3.1)
235235

236236
IF(NOT PROTOBUF_FOUND)
237237
build_protobuf(extern_protobuf FALSE)

cmake/external/python.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ IF(PYTHONINTERP_FOUND)
7474
find_python_module(wheel REQUIRED)
7575
find_python_module(google.protobuf REQUIRED)
7676
FIND_PACKAGE(NumPy REQUIRED)
77-
IF(${PY_GOOGLE.PROTOBUF_VERSION} AND ${PY_GOOGLE.PROTOBUF_VERSION} VERSION_LESS "3.6.1")
78-
MESSAGE(FATAL_ERROR "Found Python Protobuf ${PY_GOOGLE.PROTOBUF_VERSION} < 3.6.1, "
77+
IF(${PY_GOOGLE.PROTOBUF_VERSION} AND ${PY_GOOGLE.PROTOBUF_VERSION} VERSION_LESS "3.0.0")
78+
MESSAGE(FATAL_ERROR "Found Python Protobuf ${PY_GOOGLE.PROTOBUF_VERSION} < 3.0.0, "
7979
"please use pip to upgrade protobuf. pip install -U protobuf")
8080
ENDIF()
8181
ENDIF(PYTHONINTERP_FOUND)

paddle/scripts/paddle_build.sh

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ function cmake_gen() {
8888
-DPYTHON_INCLUDE_DIR:PATH=/Library/Frameworks/Python.framework/Versions/3.5/include/python3.5m/
8989
-DPYTHON_LIBRARY:FILEPATH=/Library/Frameworks/Python.framework/Versions/3.5/lib/libpython3.5m.dylib"
9090
WITH_FLUID_ONLY=${WITH_FLUID_ONLY:-ON}
91-
pip3.5 uninstall -y protobuf
9291
pip3.5 install --user -r ${PADDLE_ROOT}/python/requirements.txt
9392
else
9493
exit 1
@@ -102,7 +101,6 @@ function cmake_gen() {
102101
-DPYTHON_INCLUDE_DIR:PATH=/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m/
103102
-DPYTHON_LIBRARY:FILEPATH=/Library/Frameworks/Python.framework/Versions/3.6/lib/libpython3.6m.dylib"
104103
WITH_FLUID_ONLY=${WITH_FLUID_ONLY:-ON}
105-
pip3.6 uninstall -y protobuf
106104
pip3.6 install --user -r ${PADDLE_ROOT}/python/requirements.txt
107105
else
108106
exit 1
@@ -116,7 +114,6 @@ function cmake_gen() {
116114
-DPYTHON_INCLUDE_DIR:PATH=/Library/Frameworks/Python.framework/Versions/3.7/include/python3.7m/
117115
-DPYTHON_LIBRARY:FILEPATH=/Library/Frameworks/Python.framework/Versions/3.7/lib/libpython3.7m.dylib"
118116
WITH_FLUID_ONLY=${WITH_FLUID_ONLY:-ON}
119-
pip3.7 uninstall -y protobuf
120117
pip3.7 install --user -r ${PADDLE_ROOT}/python/requirements.txt
121118
else
122119
exit 1
@@ -131,44 +128,31 @@ function cmake_gen() {
131128
PYTHON_FLAGS="-DPYTHON_EXECUTABLE:FILEPATH=/opt/python/cp27-cp27m/bin/python
132129
-DPYTHON_INCLUDE_DIR:PATH=/opt/python/cp27-cp27m/include/python2.7
133130
-DPYTHON_LIBRARIES:FILEPATH=/opt/_internal/cpython-2.7.11-ucs2/lib/libpython2.7.so"
134-
pip uninstall -y protobuf
135-
pip install -r ${PADDLE_ROOT}/python/requirements.txt
136131
elif [ "$1" == "cp27-cp27mu" ]; then
137132
export LD_LIBRARY_PATH=/opt/_internal/cpython-2.7.11-ucs4/lib:${LD_LIBRARY_PATH#/opt/_internal/cpython-2.7.11-ucs2/lib:}
138133
export PATH=/opt/python/cp27-cp27mu/bin/:${PATH}
139134
PYTHON_FLAGS="-DPYTHON_EXECUTABLE:FILEPATH=/opt/python/cp27-cp27mu/bin/python
140135
-DPYTHON_INCLUDE_DIR:PATH=/opt/python/cp27-cp27mu/include/python2.7
141136
-DPYTHON_LIBRARIES:FILEPATH=/opt/_internal/cpython-2.7.11-ucs4/lib/libpython2.7.so"
142-
pip uninstall -y protobuf
143-
pip install -r ${PADDLE_ROOT}/python/requirements.txt
144137
elif [ "$1" == "cp35-cp35m" ]; then
145138
export LD_LIBRARY_PATH=/opt/_internal/cpython-3.5.1/lib/:${LD_LIBRARY_PATH}
146139
export PATH=/opt/_internal/cpython-3.5.1/bin/:${PATH}
147140
export PYTHON_FLAGS="-DPYTHON_EXECUTABLE:FILEPATH=/opt/_internal/cpython-3.5.1/bin/python3
148141
-DPYTHON_INCLUDE_DIR:PATH=/opt/_internal/cpython-3.5.1/include/python3.5m
149142
-DPYTHON_LIBRARIES:FILEPATH=/opt/_internal/cpython-3.5.1/lib/libpython3.so"
150-
pip3.5 uninstall -y protobuf
151-
pip3.5 install -r ${PADDLE_ROOT}/python/requirements.txt
152143
elif [ "$1" == "cp36-cp36m" ]; then
153144
export LD_LIBRARY_PATH=/opt/_internal/cpython-3.6.0/lib/:${LD_LIBRARY_PATH}
154145
export PATH=/opt/_internal/cpython-3.6.0/bin/:${PATH}
155146
export PYTHON_FLAGS="-DPYTHON_EXECUTABLE:FILEPATH=/opt/_internal/cpython-3.6.0/bin/python3
156147
-DPYTHON_INCLUDE_DIR:PATH=/opt/_internal/cpython-3.6.0/include/python3.6m
157148
-DPYTHON_LIBRARIES:FILEPATH=/opt/_internal/cpython-3.6.0/lib/libpython3.so"
158-
pip3.6 uninstall -y protobuf
159-
pip3.6 install -r ${PADDLE_ROOT}/python/requirements.txt
160149
elif [ "$1" == "cp37-cp37m" ]; then
161150
export LD_LIBRARY_PATH=/opt/_internal/cpython-3.7.0/lib/:${LD_LIBRARY_PATH}
162151
export PATH=/opt/_internal/cpython-3.7.0/bin/:${PATH}
163152
export PYTHON_FLAGS="-DPYTHON_EXECUTABLE:FILEPATH=/opt/_internal/cpython-3.7.0/bin/python3.7
164153
-DPYTHON_INCLUDE_DIR:PATH=/opt/_internal/cpython-3.7.0/include/python3.7m
165154
-DPYTHON_LIBRARIES:FILEPATH=/opt/_internal/cpython-3.7.0/lib/libpython3.so"
166-
pip3.7 uninstall -y protobuf
167-
pip3.7 install -r ${PADDLE_ROOT}/python/requirements.txt
168155
fi
169-
else
170-
pip uninstall -y protobuf
171-
pip install -r ${PADDLE_ROOT}/python/requirements.txt
172156
fi
173157
fi
174158

python/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
requests==2.9.2
22
numpy>=1.12
3-
protobuf>=3.6
3+
protobuf==3.1
44
recordio>=0.1.0
55
matplotlib==2.2.3 # TODO: let python3 paddlepaddle package use latest matplotlib
66
rarfile

tools/manylinux1/Dockerfile.x64

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ RUN wget --no-check-certificate -qO- https://storage.googleapis.com/golang/go1.8
3131
ENV GOROOT=/usr/local/go GOPATH=/root/gopath
3232
ENV PATH=${GOROOT}/bin:${GOPATH}/bin:${PATH}
3333

34-
# protobuf 3.6.1
35-
RUN cd /opt && wget -q --no-check-certificate https://github.com/google/protobuf/releases/download/v3.6.1/protobuf-cpp-3.6.1.tar.gz && \
36-
tar xzf protobuf-cpp-3.6.1.tar.gz && \
37-
cd protobuf-3.6.1 && ./configure && make -j4 && make install && cd .. && rm -f protobuf-cpp-3.6.1.tar.gz
34+
# protobuf 3.1.0
35+
RUN cd /opt && wget -q --no-check-certificate https://github.com/google/protobuf/releases/download/v3.1.0/protobuf-cpp-3.1.0.tar.gz && \
36+
tar xzf protobuf-cpp-3.1.0.tar.gz && \
37+
cd protobuf-3.1.0 && ./configure && make -j4 && make install && cd .. && rm -f protobuf-cpp-3.1.0.tar.gz
3838

3939
RUN wget https://raw.githubusercontent.com/PaddlePaddle/Paddle/develop/python/requirements.txt -O /root/requirements.txt
4040

tools/manylinux1/build_scripts/build.sh

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ OPENSSL_ROOT=openssl-1.1.0i
1717
OPENSSL_HASH=ebbfc844a8c8cc0ea5dc10b86c9ce97f401837f3fa08c17b2cdadc118253cf99
1818
EPEL_RPM_HASH=e5ed9ecf22d0c4279e92075a64c757ad2b38049bcf5c16c4f2b75d5f6860dc0d
1919
DEVTOOLS_HASH=a8ebeb4bed624700f727179e6ef771dafe47651131a00a78b342251415646acc
20-
PATCHELF_HASH=f2aa40a6148cb3b0ca807a1bf836b081793e55ec9e5540a5356d800132be7e0a
2120
CURL_ROOT=curl-7.49.1
2221
CURL_HASH=eb63cec4bef692eab9db459033f409533e6d10e20942f4b060b32819e81885f1
2322
AUTOCONF_ROOT=autoconf-2.69
@@ -107,11 +106,7 @@ curl-config --features
107106
rm -rf /usr/local/ssl
108107

109108
# Install patchelf (latest with unreleased bug fixes)
110-
curl -sLO https://nixos.org/releases/patchelf/patchelf-0.9/patchelf-0.9.tar.gz
111-
check_sha256sum patchelf-0.9.tar.gz $PATCHELF_HASH
112-
tar -xzf patchelf-0.9.tar.gz
113-
(cd patchelf-0.9 && ./configure && make && make install)
114-
rm -rf patchelf-0.9.tar.gz patchelf-0.9
109+
yum install -y patchelf
115110

116111
# Install latest pypi release of auditwheel
117112
LD_LIBRARY_PATH="${ORIGINAL_LD_LIBRARY_PATH}:$(dirname ${PY35_BIN})/lib" $PY35_BIN/pip install auditwheel

0 commit comments

Comments
 (0)