File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ before_install:
2929script :
3030 - paddle/scripts/travis/build.sh
3131 - paddle/scripts/travis/unittest.sh
32+ - paddle/scripts/travis/make_install.sh
3233notifications :
3334 email :
3435 on_success : change
Original file line number Diff line number Diff line change 4343
4444export PYTHONPATH=${PWD} :${PYTHONPATH}
4545
46+
47+ # Check python lib installed or not.
48+ pip --help > /dev/null
49+ if [ $? -ne 0 ]; then
50+ echo " pip should be installed to run paddle."
51+ exit 1
52+ fi
53+
54+ INSTALLED_VERSION=` pip freeze 2> /dev/null | grep ' ^paddle' | sed ' s/.*==//g' `
55+
56+ if [ -z ${INSTALLED_VERSION} ]; then
57+ INSTALLED_VERSION=" 0.0.0" # not installed
58+ fi
59+ cat << EOF | python -
60+ from distutils.version import LooseVersion
61+ import sys
62+ if LooseVersion("${INSTALLED_VERSION} ") < LooseVersion("@PADDLE_VERSION@"):
63+ sys.exit(1)
64+ else:
65+ sys.exit(0)
66+ EOF
67+
68+ if [ $? -eq 1 ]; then # Older version installed, or not installed at all
69+ echo " First time run paddle, need to install some python dependencies."
70+ BASEDIR=$( dirname " $0 " )
71+ pip install ${BASEDIR} /../opt/paddle/share/wheels/* .whl
72+ if [ $? -ne 0 ]; then
73+ echo " pip install wheels failed. "
74+ echo " Please use 'sudo paddle' at the first time you use PaddlePaddle"
75+ echo " PaddlePaddle will install some python dependencies automatically."
76+ exit 1
77+ fi
78+ echo " Python dependencies are installed."
79+ fi
80+
4681case " $1 " in
4782 " train" )
4883 ${DEBUGGER} $MYDIR /../opt/paddle/bin/paddle_trainer ${@: 2}
Original file line number Diff line number Diff line change 11#! /bin/bash
2-
32cd ` dirname $0 `
4- cd ../../../
5- set -e
6- mkdir build
7- cd build
3+ source ./common.sh
84cmake .. -DCMAKE_BUILD_TYPE=Debug -DWITH_GPU=OFF -DWITH_DOC=OFF -DWITH_TESTING=ON -DON_TRAVIS=ON
95make -j ` nproc`
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ set -e
3+ mkdir -p ../../../build
4+ cd ../../../build
5+
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ cd ` dirname $0 `
3+ source ./common.sh
4+ sudo make install
5+ sudo paddle version
Original file line number Diff line number Diff line change 11#! /bin/bash
2- set -e
32cd ` dirname $0 `
4- cd ../../../build
3+ source ./common.sh
54env CTEST_OUTPUT_ON_FAILURE=1 make test ARGS=" -j ` nproc` "
65
Original file line number Diff line number Diff line change @@ -22,10 +22,6 @@ find_python_module(pip REQUIRED)
2222find_python_module (wheel REQUIRED )
2323find_python_module (google.protobuf REQUIRED )
2424
25- install (CODE "execute_process(COMMAND ${PYTHON_EXECUTABLE} setup.py install -f
26- WORKING_DIRECTORY
27- ${CMAKE_CURRENT_BINARY_DIR} )" )
28-
2925install (DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} /dist/
3026 DESTINATION opt/paddle/share/wheels
3127)
You can’t perform that action at this time.
0 commit comments