You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by gi...@git.apache.org on 2017/07/29 01:18:04 UTC

[GitHub] rahul003 commented on a change in pull request #7166: add support for port package manager

rahul003 commented on a change in pull request #7166: add support for port package manager
URL: https://github.com/apache/incubator-mxnet/pull/7166#discussion_r130206398
 
 

 ##########
 File path: setup-utils/install-mxnet-osx-python.sh
 ##########
 @@ -25,37 +25,134 @@ then
 fi
 export MXNET_HOME_OLD="$HOME/mxnet_${TARIKH}"
 export MXNET_LOG=${MXNET_HOME}/buildMXNet_mac.log
+
 # Insert the Homebrew directory at the top of your PATH environment variable
-export PATH=/usr/local/bin:/usr/local/sbin:$PATH
+export PATH="/usr/local/bin:/usr/local/sbin:$PATH" # for brew
+export PATH="/usr/bin:/opt/local/bin:$PATH"        # for macports
+
+export MACPORTS_WEB="https://guide.macports.org/chunked/installing.macports.html"
+
+export BREW_PKGS="pkg-config python   opencv graphviz homebrew/science/openblas"
+export PORT_PKGS="pkgconfig  python36 opencv graphviz openblas-devel"
+
+# graphviz, opencv-python skipped since already installed via brew/port
+export PIP_PKGS_ALL="cython numpy"
+export PIP_PKGS_USER="requests jupyter"
+
 export SLEEP_TIME=2
 LINE="########################################################################"
 
-echo $LINE
-echo " "
-echo "This script installs MXNet on MacOS in \${MXNET_HOME}"
-echo "If not set, the default value of \${MXNET_HOME} = ~/mxnet"
-echo "The current value of \${MXNET_HOME} = ${MXNET_HOME}"
-echo " "
-echo "If this directory is already present, it is renamed to retain earlier contents."
-echo "You may want to check and delete this directory if not required."
-echo " "
-echo "This script has been tested on: MacOS El Capitan and Sierra"
-echo " "
-echo "If you face any problems with this script, please let us know at:"
-echo "    https://stackoverflow.com/questions/tagged/mxnet"
-echo " "
-echo "Typical run-time for this script is around 7 minutes."
-echo "If your environment has never been setup for development (e.g. gcc), "
-echo "it could take up to 30 minutes or longer."
-echo " "
-MACOS_VERSION=`/usr/bin/uname -r`
-echo "Your macOS version is: $MACOS_VERSION"
-echo " "
-echo $LINE
-sleep ${SLEEP_TIME}
-
-echo "You may have to enter your password for sudo access to install python for MXNet."
-sudo ls > /dev/null
+print_intro_msg() {
+	#
+	# NOTE: Please test and ensure that the message does NOT scroll
+	#       beyond the standard 80x25 format of a terminal shell.
+	#
+	echo $LINE
+	echo " "
+	echo "MXNet is a flexible, efficient and scalable library for Deep Learning."
+	echo " "
+	echo "This script installs MXNet on MacOS in \${MXNET_HOME}"
+	echo "If not set, the default value of \${MXNET_HOME} = ~/mxnet"
+	echo "The current value of \${MXNET_HOME} = ${MXNET_HOME}"
+	echo " "
+	echo "If this directory is already present, it is renamed to retain earlier contents."
+	echo "You may want to check and delete this directory if not required."
+	echo " "
+	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 " "
+	echo "Typical run-time for this script is around 10 minutes."
+	echo "If your environment has never been setup for development (e.g. gcc), "
+	echo "it could take up to 30 minutes or longer."
+	echo " "
+	MACOS_VERSION=`/usr/bin/uname -r`
+	echo "Your macOS version is: $MACOS_VERSION"
+	echo " "
+	echo $LINE
+	echo " "
+	sleep ${SLEEP_TIME}
+} # print_intro_msg()
+
+# wrapper routine to stop the script if the command invoked returns error
+chkret() {
+	cmd=$*
+	echo "$cmd"
+	$cmd
+	ret=$?
+	if [[ ${ret} != 0 ]]; then
+		echo " "
+		echo "ERROR: Return value non-zero for: $cmd"
+		echo " "
+		exit 1
+	fi
+} # chkret()
+
+chk_mac_vers() {
+	export mac_vers=`sw_vers -productVersion | cut -d '.' -f 1,2`
+	if [[ $mac_vers != "10.11" && $mac_vers != "10.12" ]];
+	then
+		echo " "
+		echo "ERROR: macOS version $mac_vers NOT supported."
+		echo " "
+		echo "Your macOS version is:"
+		sw_vers
+		echo " "
+		exit 1
+	fi
+} # chk_mac_vers()
+
+install_brew() {
+	echo " "
+	echo "BEGIN: Check/Install/Update Homebrew"
 
 Review comment:
   It's confusing here because the question that follows this line asks about installing homebrew AND dependencies, but the heading here is for Homebrew only. It might be better if this ```BEGIN:...``` is printed after that question is asked. Because that is when the step actually starts. 
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services