-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lazy install Paddle wheels #49
Changes from 2 commits
7cf8e0c
ddb0f8a
6ef0b7c
b76682c
62da4ad
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,6 +43,40 @@ fi | |
|
||
export PYTHONPATH=${PWD}:${PYTHONPATH} | ||
|
||
|
||
# Check python lib installed or not. | ||
pip --help > /dev/null | ||
if [ $? -ne 0 ]; then | ||
echo "pip should be installed to run paddle." | ||
exit 1 | ||
fi | ||
|
||
INSTALLED_VERSION=`pip freeze 2>/dev/null | grep '^paddle' | sed 's/.*==//g'` | ||
|
||
if [ -z ${INSTALLED_VERSION} ]; then | ||
INSTALLED_VERSION="0.0.0" # not installed | ||
fi | ||
cat <<EOF | python - | ||
from distutils.version import LooseVersion | ||
import sys | ||
if LooseVersion("${INSTALLED_VERSION}") < LooseVersion("@PADDLE_VERSION@"): | ||
sys.exit(1) | ||
else: | ||
sys.exit(0) | ||
EOF | ||
|
||
if [ $? -eq 1 ]; then # Older version installed, or not installed at all | ||
echo "First time run paddle, need to install some python dependencies." | ||
BASEDIR=$(dirname "$0") | ||
pip install ${BASEDIR}/../opt/paddle/share/wheels/*.whl | ||
if [ $? -ne 0 ]; then | ||
echo "pip install wheels failed. " | ||
echo "Please use 'sudo paddle' at the first time you use PaddlePaddle" | ||
echo "PaddlePaddle will install some python dependencies automatically." | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add an error logs here. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No point to run the rest, should exit here. |
||
fi | ||
echo "Python dependencies are installed." | ||
fi | ||
|
||
case "$1" in | ||
"train") | ||
${DEBUGGER} $MYDIR/../opt/paddle/bin/paddle_trainer ${@:2} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,5 @@ | ||
#!/bin/bash | ||
|
||
cd `dirname $0` | ||
cd ../../../ | ||
set -e | ||
mkdir build | ||
cd build | ||
source ./common.sh | ||
cmake .. -DCMAKE_BUILD_TYPE=Debug -DWITH_GPU=OFF -DWITH_DOC=OFF -DWITH_TESTING=ON -DON_TRAVIS=ON | ||
make -j `nproc` |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/bash | ||
set -e | ||
mkdir -p ../../../build | ||
cd ../../../build | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/bash | ||
cd `dirname $0` | ||
source ./common.sh | ||
sudo make install | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. test make install |
||
sudo paddle version |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
#!/bin/bash | ||
set -e | ||
cd `dirname $0` | ||
cd ../../../build | ||
source ./common.sh | ||
env CTEST_OUTPUT_ON_FAILURE=1 make test ARGS="-j `nproc`" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also test make install during travis-ci