From 44813dd69fd6b3e7c9b98b56a55bced7f955fbdd Mon Sep 17 00:00:00 2001 From: Steffen Rochel Date: Sun, 26 Nov 2017 18:44:47 -0800 Subject: [PATCH 1/5] Update install-mxnet-osx-python.sh Fixed handling of MXNET_TAG. If not set latest from master will be cloned to local directory. If a tag is specified, that tag will be used to clone the repository. Tested with MXNET_TAG="1.0.0.rc0" --- setup-utils/install-mxnet-osx-python.sh | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/setup-utils/install-mxnet-osx-python.sh b/setup-utils/install-mxnet-osx-python.sh index 25a44796cb2f..9c943f79c663 100755 --- a/setup-utils/install-mxnet-osx-python.sh +++ b/setup-utils/install-mxnet-osx-python.sh @@ -29,11 +29,9 @@ export MXNET_GITPATH="https://github.com/dmlc/mxnet.git" if [ -z ${MXNET_TAG} ]; then - # - # TODO: Change this to latest tag - # to avoid updating this value for every release - # - export MXNET_TAG="0.12.0" + export MXNET_BRANCH_TAG="" +else + export MXNET_BRANCH_TAG="--branch $MXNET_TAG" fi export TARIKH=`/bin/date +%Y-%m-%d-%H:%M:%S` @@ -362,19 +360,16 @@ download_mxnet() { echo " " echo "MXNET GIT Path = ${MXNET_GITPATH}" - #echo "MXNET Tag = ${MXNET_TAG}" - #echo "You can set \$MXNET_TAG to the appropriate github repo tag" - #echo "If not set, the default value used is the latest release" - echo " " + echo "MXNET Tag = ${MXNET_TAG}" + echo "You can set \$MXNET_TAG to the appropriate github repo tag" + echo "If not set, the default value used is the latest version on master" + echo " " sleep ${SLEEP_TIME} - chkret git clone ${MXNET_GITPATH} ${MXNET_HOME} --recursive + chkret git clone ${MXNET_BRANCH_TAG} ${MXNET_GITPATH} ${MXNET_HOME} --recursive sleep ${SLEEP_TIME} cd ${MXNET_HOME} echo " " - #echo "Checkout tag = ${MXNET_TAG}" - #chkret git checkout ${MXNET_TAG} - #echo " " sleep ${SLEEP_TIME} echo "END: Download MXNet" echo $LINE From e078d843c6e51b7891b9f0abf7d8aa4e82fc6547 Mon Sep 17 00:00:00 2001 From: Steffen Rochel Date: Sat, 16 Dec 2017 15:22:33 -0800 Subject: [PATCH 2/5] Update install-mxnet-osx-python.sh added following modifications: a) added selection for reporting list of available tags b) moved the tag selection into the introduction section open: still need to resolve proper installation of the build version --- setup-utils/install-mxnet-osx-python.sh | 53 +++++++++++++++++++------ 1 file changed, 41 insertions(+), 12 deletions(-) diff --git a/setup-utils/install-mxnet-osx-python.sh b/setup-utils/install-mxnet-osx-python.sh index 9c943f79c663..d437a21009f4 100755 --- a/setup-utils/install-mxnet-osx-python.sh +++ b/setup-utils/install-mxnet-osx-python.sh @@ -26,7 +26,9 @@ #set -ex -export MXNET_GITPATH="https://github.com/dmlc/mxnet.git" +export MXNET_GITPATH="https://github.com/apache/incubator-mxnet" + + if [ -z ${MXNET_TAG} ]; then export MXNET_BRANCH_TAG="" @@ -77,7 +79,7 @@ print_intro_msg() { echo "This script has been tested on: MacOS El Capitan (10.11) and Sierra (10.12)" echo " " echo "If you face any problems with this script, please let us know at:" - echo " https://stackoverflow.com/questions/tagged/mxnet" + echo " https://discuss.mxnet.io/" echo " " echo "Typical run-time for this script is around 10 minutes." echo "If your environment has never been setup for development (e.g. gcc), " @@ -87,8 +89,42 @@ print_intro_msg() { echo "Your macOS version is: $MACOS_VERSION" echo " " echo $LINE + read -p "Do you want to continue? (y/n): " response echo " " - sleep ${SLEEP_TIME} + while true; do + case $response in + [Yy]* ) break;; + [Nn]* ) exit;; + * ) echo "Please answer yes or no.";; + esac + done + echo " " + echo " " + echo "MXNET GIT Path = ${MXNET_GITPATH}" + echo "MXNET Tag = ${MXNET_TAG}" + echo "You can set \$MXNET_TAG to the appropriate github repo tag" + echo "If not set, the default value used is the latest version on master" + read -p "Do you want to get a list of available tags? (y/n): " response + while true; do + case $response in + [Yy]* ) + echo "Available tags are:" + git ls-remote --tags ${MXNET_GITPATH} | sed 's/refs\/tags\///' | grep -v v | grep -v 201 \ + | grep -v "{}" | awk '{ print " ", $2 }'; + break;; + [Nn]* ) break;; + * ) echo "Please answer yes or no.";; + esac + done + read -p "Do you want to continue? (y/n): " response + echo " " + while true; do + case $response in + [Yy]* ) break;; + [Nn]* ) exit;; + * ) echo "Please answer yes or no.";; + esac + done } # print_intro_msg() # wrapper routine to stop the script if the command invoked returns error @@ -358,15 +394,8 @@ download_mxnet() { sleep ${SLEEP_TIME} fi - echo " " - echo "MXNET GIT Path = ${MXNET_GITPATH}" - echo "MXNET Tag = ${MXNET_TAG}" - echo "You can set \$MXNET_TAG to the appropriate github repo tag" - echo "If not set, the default value used is the latest version on master" - echo " " - sleep ${SLEEP_TIME} - - chkret git clone ${MXNET_BRANCH_TAG} ${MXNET_GITPATH} ${MXNET_HOME} --recursive + + chkret git clone ${MXNET_BRANCH_TAG} ${MXNET_GITPATH}.git ${MXNET_HOME} --recursive sleep ${SLEEP_TIME} cd ${MXNET_HOME} echo " " From dc85c262268060f6a75dd8abbdd6dc0f044f6fa7 Mon Sep 17 00:00:00 2001 From: Steffen Rochel Date: Tue, 26 Dec 2017 16:20:45 -0800 Subject: [PATCH 3/5] Update install-mxnet-osx-python.sh Added check if mxnet was already installed on the system (e.g. pip install), as this might interfere with the attempt to download and install a new version. Performed manual tests, all passing. This is a final commit. --- setup-utils/install-mxnet-osx-python.sh | 39 +++++++++++++++++++++++-- 1 file changed, 36 insertions(+), 3 deletions(-) diff --git a/setup-utils/install-mxnet-osx-python.sh b/setup-utils/install-mxnet-osx-python.sh index d437a21009f4..3cb5fcdc8712 100755 --- a/setup-utils/install-mxnet-osx-python.sh +++ b/setup-utils/install-mxnet-osx-python.sh @@ -382,6 +382,39 @@ install_dep_pip_for_mxnet() { echo " " } # install_dep_pip_for_mxnet() +# check if mxnet is already installed through other means +chk_mxnet_installed() { + mxnet_installed=`pip list --format=columns | grep mxnet` + if [ "$mxnet_installed" != "" ] + then + mxnet_version=`echo $mxnet_installed | awk '{print $2}'` + echo "MXNet ${mxnet_version} is already installed." + echo "This installation might interfere with current installation attempt." + read -p "Do you want to remove installed version? (y/n): " response + while true; do + case $response in + [Yy]* ) + sudo -H pip uninstall mxnet + chk_mxnet_installed + break + ;; + [Nn]* ) + while true; do + read -p "Do you want to continue? (y/n): " response1 + echo " " + case $response1 in + [Yy]* ) break 2;; # break out of nested loop + [Nn]* ) exit;; + * ) echo "Please answer yes or no.";; + esac + done + ;; + * ) echo "Please answer yes or no.";; + esac + done + fi +} # chk_mxnet + download_mxnet() { echo " " echo "BEGIN: Download MXNet" @@ -489,13 +522,12 @@ END echo "FYI : You can fine-tune MXNet run-time behavior using environment variables described at:" echo " http://mxnet.io/how_to/env_var.html" echo " " - echo "NEXT: Try the MNIST tutorial at: http://mxnet.io/tutorials/python/mnist.html" - echo " Try other tutorials at : http://mxnet.io/tutorials" + echo "NEXT: Try the tutorials at: http://mxnet.io/tutorials" echo " " echo $LINE echo " " rm -f mxnet_test.log mxnet_test.expected - exit 0 + return 0 else echo " " echo "ERROR: Following files differ: mxnet_test.log mxnet_test.expected" @@ -512,6 +544,7 @@ main() { chk_mac_vers install_mac_pkg_manager install_dep_pip_for_mxnet + chk_mxnet_installed download_mxnet compile_mxnet install_mxnet_python From c234f1076b8794b778d4778ed22319b9d6ab3685 Mon Sep 17 00:00:00 2001 From: Steffen Rochel Date: Tue, 9 Jan 2018 23:06:21 -0800 Subject: [PATCH 4/5] Update install-mxnet-osx-python.sh empty change to trigger build. --- setup-utils/install-mxnet-osx-python.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup-utils/install-mxnet-osx-python.sh b/setup-utils/install-mxnet-osx-python.sh index 3cb5fcdc8712..41a9d6f71306 100755 --- a/setup-utils/install-mxnet-osx-python.sh +++ b/setup-utils/install-mxnet-osx-python.sh @@ -549,6 +549,6 @@ main() { compile_mxnet install_mxnet_python test_mxnet_python -} # main +} # main main From a7816e7e478792df572a6642f61fb790c9d6b8cb Mon Sep 17 00:00:00 2001 From: Steffen Rochel Date: Wed, 10 Jan 2018 10:09:51 -0800 Subject: [PATCH 5/5] Update install-mxnet-osx-python.sh another dummy change to fight the CI system. --- setup-utils/install-mxnet-osx-python.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup-utils/install-mxnet-osx-python.sh b/setup-utils/install-mxnet-osx-python.sh index 41a9d6f71306..3cb5fcdc8712 100755 --- a/setup-utils/install-mxnet-osx-python.sh +++ b/setup-utils/install-mxnet-osx-python.sh @@ -549,6 +549,6 @@ main() { compile_mxnet install_mxnet_python test_mxnet_python -} # main +} # main main