Skip to content

Commit c19ff1f

Browse files
committed
Add python3.6 and python3.7 support in padde build scripts
test=develop
1 parent 1d9b2a4 commit c19ff1f

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

paddle/scripts/paddle_build.sh

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,18 @@ function cmake_gen() {
116116
export PYTHON_FLAGS="-DPYTHON_EXECUTABLE:FILEPATH=/opt/_internal/cpython-3.5.1/bin/python3
117117
-DPYTHON_INCLUDE_DIR:PATH=/opt/_internal/cpython-3.5.1/include/python3.5m
118118
-DPYTHON_LIBRARIES:FILEPATH=/opt/_internal/cpython-3.5.1/lib/libpython3.so"
119+
elif [ "$1" == "cp36-cp36m" ]; then
120+
export LD_LIBRARY_PATH=/opt/_internal/cpython-3.6.0/lib/:${LD_LIBRARY_PATH}
121+
export PATH=/opt/_internal/cpython-3.6.0/bin/:${PATH}
122+
export PYTHON_FLAGS="-DPYTHON_EXECUTABLE:FILEPATH=/opt/_internal/cpython-3.6.0/bin/python3
123+
-DPYTHON_INCLUDE_DIR:PATH=/opt/_internal/cpython-3.6.0/include/python3.6m
124+
-DPYTHON_LIBRARIES:FILEPATH=/opt/_internal/cpython-3.6.0/lib/libpython3.so"
125+
elif [ "$1" == "cp37-cp37m" ]; then
126+
export LD_LIBRARY_PATH=/opt/_internal/cpython-3.7.0/lib/:${LD_LIBRARY_PATH}
127+
export PATH=/opt/_internal/cpython-3.7.0/bin/:${PATH}
128+
export PYTHON_FLAGS="-DPYTHON_EXECUTABLE:FILEPATH=/opt/_internal/cpython-3.7.0/bin/python3
129+
-DPYTHON_INCLUDE_DIR:PATH=/opt/_internal/cpython-3.7.0/include/python3.7m
130+
-DPYTHON_LIBRARIES:FILEPATH=/opt/_internal/cpython-3.7.0/lib/libpython3.so"
119131
fi
120132
fi
121133
fi
@@ -419,7 +431,7 @@ function assert_api_not_changed() {
419431
source .env/bin/activate
420432
pip install ${PADDLE_ROOT}/build/python/dist/*whl
421433
python ${PADDLE_ROOT}/tools/print_signatures.py paddle.fluid > new.spec
422-
if [ "$1" == "cp35-cp35m" ]; then
434+
if [ "$1" == "cp35-cp35m" ] || [ "$1" == "cp36-cp36m" ] || [ "$1" == "cp37-cp37m" ]; then
423435
# Use sed to make python2 and python3 sepc keeps the same
424436
sed -i 's/arg0: str/arg0: unicode/g' new.spec
425437
sed -i "s/\(.*Transpiler.*\).__init__ ArgSpec(args=\['self'].*/\1.__init__ /g" new.spec

0 commit comments

Comments
 (0)