This is an automated email from the ASF dual-hosted git repository.

jxie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-mxnet.git


The following commit(s) were added to refs/heads/master by this push:
     new 25c7232  Update install-mxnet-osx-python.sh (#8825)
25c7232 is described below

commit 25c72322fc83df8ea9a698bf445e7fe530bb7ede
Author: Steffen Rochel <[email protected]>
AuthorDate: Mon Jan 15 12:45:47 2018 -0800

    Update install-mxnet-osx-python.sh (#8825)
    
    * 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"
    
    * 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
    
    * 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.
    
    * Update install-mxnet-osx-python.sh
    
    empty change to trigger build.
    
    * Update install-mxnet-osx-python.sh
    
    another dummy change to fight the CI system.
---
 setup-utils/install-mxnet-osx-python.sh | 103 +++++++++++++++++++++++++-------
 1 file changed, 80 insertions(+), 23 deletions(-)

diff --git a/setup-utils/install-mxnet-osx-python.sh 
b/setup-utils/install-mxnet-osx-python.sh
index d6efa40..3cb5fcd 100755
--- a/setup-utils/install-mxnet-osx-python.sh
+++ b/setup-utils/install-mxnet-osx-python.sh
@@ -26,14 +26,14 @@
 
 #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
-       #
-       # TODO: Change this to latest tag
-       #       to avoid updating this value for every release
-       #
-       export MXNET_TAG="1.0.0"
+    export MXNET_BRANCH_TAG=""
+else
+    export MXNET_BRANCH_TAG="--branch $MXNET_TAG"
 fi
 
 export TARIKH=`/bin/date +%Y-%m-%d-%H:%M:%S`
@@ -79,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), "
@@ -89,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
@@ -348,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"
@@ -360,21 +427,11 @@ 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 release"
-       echo " "
-       sleep ${SLEEP_TIME}
-
-       chkret git clone ${MXNET_GITPATH} ${MXNET_HOME} --recursive
+       
+       chkret git clone ${MXNET_BRANCH_TAG} ${MXNET_GITPATH}.git ${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
@@ -465,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"
@@ -488,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

-- 
To stop receiving notification emails like this one, please contact
['"[email protected]" <[email protected]>'].

Reply via email to