You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@singa.apache.org by wa...@apache.org on 2015/05/27 16:39:18 UTC

[17/22] incubator-singa git commit: Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/incubator-singa into feature-zookeeper

Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/incubator-singa into feature-zookeeper

Conflicts:
	Makefile.example
	src/trainer/trainer.cc

merge with new dependency installation process


Project: http://git-wip-us.apache.org/repos/asf/incubator-singa/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-singa/commit/3921c293
Tree: http://git-wip-us.apache.org/repos/asf/incubator-singa/tree/3921c293
Diff: http://git-wip-us.apache.org/repos/asf/incubator-singa/diff/3921c293

Branch: refs/heads/master
Commit: 3921c293f660e9fe69566338dbb99aacb16f6894
Parents: 76b4119 f1ecd78
Author: wang sheng <wa...@gmail.com>
Authored: Wed May 27 13:49:36 2015 +0800
Committer: wang sheng <wa...@gmail.com>
Committed: Wed May 27 13:49:36 2015 +0800

----------------------------------------------------------------------
 bin/singa-cleanup.sh        |   9 +-
 bin/singa-run.sh            |  14 +-
 bin/zk-service.sh           |  30 +-
 examples/cifar10/model.conf |   4 +-
 include/trainer/worker.h    |   2 +
 script/download.sh          |   3 -
 thirdparty/install.sh       | 706 +++++++++++++++++++++++++++++++++++++++
 7 files changed, 741 insertions(+), 27 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/3921c293/bin/singa-cleanup.sh
----------------------------------------------------------------------
diff --cc bin/singa-cleanup.sh
index 7355a2b,0000000..c38d1e6
mode 100755,000000..100755
--- a/bin/singa-cleanup.sh
+++ b/bin/singa-cleanup.sh
@@@ -1,36 -1,0 +1,37 @@@
 +#!/usr/bin/env bash
 +#
 +#/**
 +# * Copyright 2015 The Apache Software Foundation
 +# *
 +# * Licensed to the Apache Software Foundation (ASF) under one
 +# * or more contributor license agreements.  See the NOTICE file
 +# * distributed with this work for additional information
 +# * regarding copyright ownership.  The ASF licenses this file
 +# * to you under the Apache License, Version 2.0 (the
 +# * "License"); you may not use this file except in compliance
 +# * with the License.  You may obtain a copy of the License at
 +# *
 +# *     http://www.apache.org/licenses/LICENSE-2.0
 +# *
 +# * Unless required by applicable law or agreed to in writing, software
 +# * distributed under the License is distributed on an "AS IS" BASIS,
 +# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 +# * See the License for the specific language governing permissions and
 +# * limitations under the License.
 +# */
 +# 
 +# Manage a zookeeper service
 +#
 +
 +usage="Usage: singa-cleanup.sh"
 +
 +#if [ $# -le 0 ]; then
 +#  echo $usage
 +#  exit 1
 +#fi
-   
- bin=`dirname "${BASH_SOURCE-$0}"`
- bin=`cd "$bin">/dev/null; pwd`
 +
- $bin/zk-service.sh stop
++BIN=`dirname "${BASH_SOURCE-$0}"`
++BIN=`cd "$BIN">/dev/null; pwd`
++BASE=`cd "$BIN/..">/dev/null; pwd`
++
++$BIN/zk-service.sh stop

http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/3921c293/bin/singa-run.sh
----------------------------------------------------------------------
diff --cc bin/singa-run.sh
index e71af2f,0000000..2e8d340
mode 100755,000000..100755
--- a/bin/singa-run.sh
+++ b/bin/singa-run.sh
@@@ -1,56 -1,0 +1,54 @@@
 +#!/usr/bin/env bash
 +#
 +#/**
 +# * Copyright 2015 The Apache Software Foundation
 +# *
 +# * Licensed to the Apache Software Foundation (ASF) under one
 +# * or more contributor license agreements.  See the NOTICE file
 +# * distributed with this work for additional information
 +# * regarding copyright ownership.  The ASF licenses this file
 +# * to you under the Apache License, Version 2.0 (the
 +# * "License"); you may not use this file except in compliance
 +# * with the License.  You may obtain a copy of the License at
 +# *
 +# *     http://www.apache.org/licenses/LICENSE-2.0
 +# *
 +# * Unless required by applicable law or agreed to in writing, software
 +# * distributed under the License is distributed on an "AS IS" BASIS,
 +# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 +# * See the License for the specific language governing permissions and
 +# * limitations under the License.
 +# */
 +# 
 +# Run a Singa job
 +#
 +
 +usage="Usage: singa-run.sh"
 +
 +#if [ $# -le 0 ]; then
 +#  echo $usage
 +#  exit 1
 +#fi
 +  
- bin=`dirname "${BASH_SOURCE-$0}"`
- bin=`cd "$bin">/dev/null; pwd`
++BIN=`dirname "${BASH_SOURCE-$0}"`
++BIN=`cd "$BIN">/dev/null; pwd`
++BASE=`cd "$BIN/..">/dev/null; pwd`
 +
 +#get argument
 +cmd=$1
 +
- #$bin/singa-cleanup.sh
++cd $BASE
 +
- cd $bin
- $bin/zk-service.sh start
++$BIN/zk-service.sh start
 +
 +#wait for zk service to be up
 +sleep 3
 +
 +echo starting singa ...
 +
 +#echo $@
- cd $bin/..
 +./singa $@
 +
 +echo stopping singa ...
 +
- cd $bin
- $bin/zk-service.sh stop
++$BIN/zk-service.sh stop

http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/3921c293/bin/zk-service.sh
----------------------------------------------------------------------
diff --cc bin/zk-service.sh
index 8c7f10c,0000000..fc2c99c
mode 100755,000000..100755
--- a/bin/zk-service.sh
+++ b/bin/zk-service.sh
@@@ -1,72 -1,0 +1,82 @@@
 +#!/usr/bin/env bash
 +#
 +#/**
 +# * Copyright 2015 The Apache Software Foundation
 +# *
 +# * Licensed to the Apache Software Foundation (ASF) under one
 +# * or more contributor license agreements.  See the NOTICE file
 +# * distributed with this work for additional information
 +# * regarding copyright ownership.  The ASF licenses this file
 +# * to you under the Apache License, Version 2.0 (the
 +# * "License"); you may not use this file except in compliance
 +# * with the License.  You may obtain a copy of the License at
 +# *
 +# *     http://www.apache.org/licenses/LICENSE-2.0
 +# *
 +# * Unless required by applicable law or agreed to in writing, software
 +# * distributed under the License is distributed on an "AS IS" BASIS,
 +# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 +# * See the License for the specific language governing permissions and
 +# * limitations under the License.
 +# */
 +# 
 +# Manage a zookeeper service
 +#
 +
 +usage="Usage: zk-service.sh (start|stop)"
 +
 +if [ $# -le 0 ]; then
 +  echo $usage
 +  exit 1
 +fi
-   
- bin=`dirname "${BASH_SOURCE-$0}"`
- bin=`cd "$bin">/dev/null; pwd`
- zkbin=$bin/../thirdparty/zookeeper-3.4.6/bin
 +
- #echo $zkbin
++BIN=`dirname "${BASH_SOURCE-$0}"`
++BIN=`cd "$BIN">/dev/null; pwd`
++BASE=`cd "$BIN/..">/dev/null; pwd`
++ZKBASE=$BASE/thirdparty/zookeeper-3.4.6
++
++#echo $ZKBASE
 +
 +if [ "$SINGA_MANAGES_ZK" = "" ]; then
 +  SINGA_MANAGES_ZK=true
 +fi
 +
 +#echo 'SINGA_MANAGES_ZK='$SINGA_MANAGES_ZK
 +
++if [ "$SINGA_MANAGES_ZK" = "true" ]; then
++  #check zookeeper installation
++  if [ ! -d $ZKBASE ]; then
++    echo "zookeeper not found, please install zookeeper first:"
++    echo "$./SINGA_BASE/thirdparty/install.sh zookeeper"
++    exit 1
++  fi
++fi
++
 +#get argument
 +cmd=$1
 +
 +case $cmd in
 +
 +(start)
 +  #start zk service
 +  if [ "$SINGA_MANAGES_ZK" = "true" ]; then
 +    #check zoo,cfg
-     if [ ! -f $zkbin/../conf/zoo.cfg ]; then
-       echo 'zoo.cfg not found, create from sample.cfg'
-       cp $zkbin/../conf/zoo_sample.cfg $zkbin/../conf/zoo.cfg
++    if [ ! -f $ZKBASE/conf/zoo.cfg ]; then
++      echo "zoo.cfg not found, create from sample.cfg"
++      cp $ZKBASE/conf/zoo_sample.cfg $ZKBASE/conf/zoo.cfg
 +    fi
 +    #echo 'starting zookeeper service...'
-     $zkbin/zkServer.sh start
++    $ZKBASE/bin/zkServer.sh start
 +  fi
 +  ;;
 +
 +(stop)
 +  #stop zk service
 +  if [ "$SINGA_MANAGES_ZK" = "true" ]; then
 +    #echo 'stopping zookeeper service...'
-     $zkbin/zkServer.sh stop
++    $ZKBASE/bin/zkServer.sh stop
 +  fi
 +  ;;
 +
 +esac
 +

http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/3921c293/examples/cifar10/model.conf
----------------------------------------------------------------------
diff --cc examples/cifar10/model.conf
index cbed20b,76ce8db..2b17569
--- a/examples/cifar10/model.conf
+++ b/examples/cifar10/model.conf
@@@ -1,8 -1,8 +1,8 @@@
  name: "cifar10-convnet"
- train_steps: 5
- test_steps:5
 -train_steps: 70000
 -test_steps:100
 -test_frequency:1000
 -display_frequency:30
++train_steps: 2
++test_steps:2
 +test_frequency:3
 +display_frequency:2
  updater{
    momentum:0.9
    weight_decay:0.004

http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/3921c293/include/trainer/worker.h
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/3921c293/thirdparty/install.sh
----------------------------------------------------------------------
diff --cc thirdparty/install.sh
index 0000000,0892ab7..4dcd506
mode 000000,100755..100755
--- a/thirdparty/install.sh
+++ b/thirdparty/install.sh
@@@ -1,0 -1,700 +1,706 @@@
+ #!/bin/bash
+ 
+ function install_cmake()
+ {
+ 	if [ ! -e "cmake-3.2.1.tar.gz" ]
+ 	then
+ 		wget http://www.comp.nus.edu.sg/~dbsystem/singa/assets/file/thirdparty/cmake-3.2.1.tar.gz;
+ 	fi
+ 
+ 	rm -rf cmake-3.2.1;
+ 	tar zxvf cmake-3.2.1.tar.gz && cd cmake-3.2.1;
+ 
+ 	if [ $# == 1 ]
+ 		then
+ 			echo "install cmake in $1";
+ 			./configure --prefix=$1;
+ 		elif [ $# == 0 ]
+ 		then
+ 			echo "install cmake in default path";
+ 			./configure;
+ 		else
+ 			echo "wrong commands";
+ 	fi
+ 
+ 	make && make install
+ 	if [ $? -ne 0 ]
+ 	then
+ 		cd ..;
+ 		return -1;
+ 	fi
+ 
+ 	PATH=$1/bin:$PATH;
+ 	echo $PATH;
+ 	export PATH=$1/bin:$PATH;
+ 	cd ..;
+ 	return 0;
+ }
+ 
+ function install_czmq()
+ {
+ 	if [ ! -e "czmq-3.0.0-rc1.tar.gz" ]
+ 	then
+ 		wget http://www.comp.nus.edu.sg/~dbsystem/singa/assets/file/thirdparty/czmq-3.0.0-rc1.tar.gz;
+ 	fi
+ 	rm -rf czmq-3.0.0;
+ 	tar zxvf czmq-3.0.0-rc1.tar.gz && cd czmq-3.0.0;
+ 	
+ 	if [ $# == 2 ]
+ 		then
+ 			echo "install czmq in $1 and libzmq path is $2";
+ 			./configure --prefix=$1 --with-libzmq=$2;
+ 		elif [ $# == 1 ]
+ 		then
+ 			echo "install czmq in $1 and libzmq path is default";
+ 			./configure --prefix=$1;
+ 		elif [ $# == 0 ]
+ 		then
+ 			echo "install czmq in default path";
+ 			./configure;
+ 		else
+ 			echo "wrong commands";
+ 	fi
+ 
+ 	make && make install;
+ 	if [ $? -ne 0 ]
+ 	then
+ 		cd ..;
+ 		return -1;
+ 	fi
+ 	cd ..;
+ 	return 0;
+ }
+ 
+ function install_gflags()
+ {
+ 	if [ ! -e "gflags-2.1.1.tar.gz" ]
+ 	then
+ 		wget http://www.comp.nus.edu.sg/~dbsystem/singa/assets/file/thirdparty/gflags-2.1.1.tar.gz;
+ 	fi
+ 	rm -rf gflags-2.1.1;
+ 	tar zxvf gflags-2.1.1.tar.gz && cd gflags-2.1.1;
+ 	mkdir build && cd build;
+ 
+ 	if [ $# == 1 ]
+ 		then
+ 			echo "install gflags in $1"
+ 			cmake .. -DCMAKE_INSTALL_PREFIX=$1;
+ 		elif [ $# == 0 ]
+ 		then 
+ 			echo "install gflags in default path";
+ 			cmake ..;
+ 		else
+ 			echo "gflags is done";
+ 	fi
+ 	
+ 	make && make install;
+ 	if [ $? -ne 0 ]
+ 	then
+ 		cd ../..;
+ 		return -1;
+ 	fi
+ 	
+ 	cd ../..;
+ 	return 0;
+ }
+ 
+ function install_glog()
+ {
+ 	if [ ! -e "glog-0.3.3.tar.gz" ]
+ 	then
+ 		wget http://www.comp.nus.edu.sg/~dbsystem/singa/assets/file/thirdparty/glog-0.3.3.tar.gz;
+ 	fi
+ 	
+ 	rm -rf glog-0.3.3;
+ 	tar zxvf glog-0.3.3.tar.gz && cd glog-0.3.3;
+ 
+ 	if [ $# == 1 ]
+ 		then
+ 			echo "install glog in $1";
+ 			./configure --prefix=$1;
+ 		elif [ $# == 0 ]
+ 		then
+ 			echo "install glog in default path";
+ 			./configure;
+ 		else
+ 			echo "wrong commands";
+ 	fi
+ 
+ 	make && make install;
+ 	if [ $? -ne 0 ]
+ 	then
+ 		cd ..;
+ 		return -1;
+ 	fi
+ 	cd ..;
+ 	return 0;
+ }
+ 
+ function install_lmdb()
+ {
+ 	if [ ! -e "lmdb-0.9.10.tar.gz" ]
+ 	then
+ 		wget http://www.comp.nus.edu.sg/~dbsystem/singa/assets/file/thirdparty/lmdb-0.9.10.tar.gz;
+ 	fi
+ 
+ 	rm -rf mdb-mdb;
+ 	tar zxvf lmdb-0.9.10.tar.gz && cd mdb-mdb/libraries/liblmdb;
+ 
+ 	if [ $# == 1 ]
+ 		then
+ 			echo "install lmdb in $1";
+ 			sed -i "26s#^.*#prefix=$1#g" Makefile;
+ 		elif [ $# == 0 ]
+ 		then
+ 			echo "install lmdb in default path";
+ 		else
+ 			echo "wrong commands";
+ 	fi
+ 
+ 	make && make install;
+ 	if [ $? -ne 0 ]
+ 	then
+ 		cd ../../..;
+ 		return -1;
+ 	fi
+ 	cd ../../..;
+ 	return 0;
+ }
+ 
+ function install_openblas()
+ {
+ 	if [ ! -e "OpenBLAS.zip" ]
+ 	then
+ 		wget http://www.comp.nus.edu.sg/~dbsystem/singa/assets/file/thirdparty/OpenBLAS.zip;
+ 	fi
+ 
+ 	rm -rf OpenBLAS-develop;
+ 	unzip OpenBLAS.zip && cd OpenBLAS-develop;
+ 
+ 	make;
+ 	if [ $? -ne 0 ]
+ 	then
+ 		cd ..;
+ 		return -1;
+ 	fi
+ 	if [ $# == 1 ]
+ 		then
+ 			echo "install OpenBLAS in $1";
+ 			make PREFIX=$1 install;
+ 			if [ $? -ne 0 ]
+ 			then
+ 				cd ..;
+ 				return -1;
+ 			fi
+ 		elif [ $# == 0 ]
+ 		then
+ 			echo "install cmake in default path";
+ 			make install;
+ 			if [ $? -ne 0 ]
+ 			then
+ 				cd ..;
+ 				return -1;
+ 			fi
+ 		else
+ 			echo "wrong commands";
+ 	fi
+ 	cd ..;
+ 
+ 	return 0;
+ }
+ 
+ function install_opencv()
+ {
+ 	if [ ! -e "opencv-2.4.10.zip" ]
+ 	then
+ 		wget http://www.comp.nus.edu.sg/~dbsystem/singa/assets/file/thirdparty/opencv-2.4.10.zip;
+ 	fi
+ 
+ 	rm -rf opencv-2.4.10;
+ 	unzip opencv-2.4.10.zip && cd opencv-2.4.10;
+ 	
+ 	if [ $# == 1 ]
+ 		then
+ 			echo "install opencv in $1";
+ 			cmake -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_INSTALL_PREFIX=$1;
+ 		elif [ $# == 0 ]
+ 		then
+ 			echo "install opencv in default path";
+ 			cmake -DCMAKE_BUILD_TYPE=RELEASE;
+ 		else
+ 			echo "wrong commands";
+ 	fi
+ 
+ 	make && make install;
+ 	if [ $? -ne 0 ]
+ 	then
+ 		cd ..;
+ 		return -1;
+ 	fi
+ 	cd ..;	
+ 	return 0;
+ }
+ 
+ function install_protobuf()
+ {
+ 	if [ ! -e "protobuf-2.6.0.tar.gz" ]
+ 	then
+ 		wget http://www.comp.nus.edu.sg/~dbsystem/singa/assets/file/thirdparty/protobuf-2.6.0.tar.gz;
+ 	fi
+ 
+ 	rm -rf protobuf-2.6.0;
+ 	tar zxvf protobuf-2.6.0.tar.gz && cd protobuf-2.6.0;
+ 
+ 	if [ $# == 1 ]
+ 		then
+ 			echo "install protobuf in $1";
+ 			./configure --prefix=$1;
+ 		elif [ $# == 0 ]
+ 		then
+ 			echo "install protobuf in default path";
+ 			./configure;
+ 		else
+ 			echo "wrong commands";
+ 	fi
+ 
+ 	make && make install;
+ 	if [ $? -ne 0 ]
+ 	then
+ 		cd ..;
+ 		return -1;
+ 	fi
+ 	cd ..;
+ 	return 0;
+ }
+ 
+ function install_zeromq()
+ {
+ 	if [ ! -e "zeromq-3.2.2.tar.gz" ]
+ 	then
+ 		wget http://www.comp.nus.edu.sg/~dbsystem/singa/assets/file/thirdparty/zeromq-3.2.2.tar.gz;
+ 	fi
+ 
+ 	rm -rf zeromq-3.2.2;
+ 	tar zxvf zeromq-3.2.2.tar.gz && cd zeromq-3.2.2;
+ 
+ 	if [ $# == 1 ]
+ 		then
+ 			echo "install zeromq in $1";
+ 			./configure --prefix=$1;
+ 		elif [ $# == 0 ]
+ 		then
+ 			echo "install zeromq in default path";
+ 			./configure;
+ 		else
+ 			echo "wrong commands";
+ 	fi
+ 	
+ 	make && make install;
+ 	if [ $? -ne 0 ]
+ 	then
+ 		cd ..;
+ 		return -1;
+ 	fi
+ 	cd ..;
+ 	return 0;
+ }
+ 
+ function install_zookeeper()
+ {
+ 	if [ ! -e "zookeeper-3.4.6.tar.gz" ]
+ 	then
+ 		wget http://www.comp.nus.edu.sg/~dbsystem/singa/assets/file/thirdparty/zookeeper-3.4.6.tar.gz;
+ 	fi
+ 
+ 	rm -rf zookeeper-3.4.6;
+ 	tar zxvf zookeeper-3.4.6.tar.gz;
+ 	cd zookeeper-3.4.6/src/c;
+ 
+ 	if [ $# == 1 ]
+ 		then
+ 			echo "install zookeeper in $1";
+ 			./configure --prefix=$1;
+ 		elif [ $# == 0 ]
+ 		then
+ 			echo "install zookeeper in default path";
+ 			./configure;
+ 		else 
+ 			echo "wrong commands";
+ 	fi
+ 
+ 	make && make install;
+ 	if [ $? -ne 0 ]
+ 	then
+ 		cd ../../..;
+ 		return -1;
+ 	fi
+ 
+ 	cd ../../..;
+ 	return 0;
+ }
+ 
++BIN=`dirname "${BASH_SOURCE-$0}"`
++BIN=`cd "$BIN">/dev/null; pwd`
++BASE=`cd "$BIN/..">/dev/null; pwd`
++
++cd $BIN
++
+ while [ $# != 0 ]
+ do
+ 	case $1 in
+ 	"cmake")
+ 		echo "install cmake";
+ 		if [[ $2 == */* ]];then
+ 			install_cmake $2;
+ 		    if [ $? -ne 0 ] 
+ 		    then
+ 		        echo "ERROR during cmake installation" ;
+ 		        exit;
+ 		    fi  
+ 			shift
+ 			shift
+ 		else
+ 			install_cmake;
+ 		    if [ $? -ne 0 ] 
+ 		    then
+ 		        echo "ERROR during cmake installation" ;
+ 		        exit;
+ 		    fi  
+ 			shift
+ 		fi
+ 		;;
+ 	"czmq")
+ 		echo "install czmq";
+ 		if [[ $2 == */* ]];then
+ 			if [[ $3 == */* ]];then
+ 				install_czmq $2 $3;
+ 				if [ $? -ne 0 ] 
+ 				then
+ 					echo "ERROR during czmq installation" ;
+ 					exit;
+ 				fi  
+ 				shift
+ 				shift
+ 				shift
+ 			else
+ 				install_czmq $2;
+ 				if [ $? -ne 0 ] 
+ 				then
+ 				    echo "ERROR during czmq installation" ;
+ 				    exit;
+ 				fi  
+ 				shift
+ 				shift
+ 			fi
+ 		else
+ 			install_czmq;
+ 		    if [ $? -ne 0 ] 
+ 		    then
+ 		        echo "ERROR during czmq installation" ;
+ 		        exit;
+ 		    fi  
+ 			shift
+ 		fi
+ 		;;
+ 	"gflags")
+ 		echo "install gflags";
+ 		if [[ $2 == */* ]];then
+ 			install_gflags $2;
+ 		    if [ $? -ne 0 ] 
+ 		    then
+ 		        echo "ERROR during gflags installation" ;
+ 		        exit;
+ 		    fi  
+ 			shift
+ 			shift
+ 		else
+ 			install_gflags;
+ 		    if [ $? -ne 0 ] 
+ 		    then
+ 		        echo "ERROR during gflags installation" ;
+ 		        exit;
+ 		    fi  
+ 			shift
+ 		fi
+ 		;;
+ 	"glog")
+ 		echo "install glog";
+ 		if [[ $2 == */* ]];then
+ 			install_glog $2;
+ 		    if [ $? -ne 0 ] 
+ 		    then
+ 		        echo "ERROR during glog installation" ;
+ 		        exit;
+ 		    fi  
+ 			shift
+ 			shift
+ 		else
+ 			install_glog;
+ 		    if [ $? -ne 0 ] 
+ 		    then
+ 		        echo "ERROR during glog installation" ;
+ 		        exit;
+ 		    fi  
+ 			shift
+ 		fi
+ 		;;
+ 	"lmdb")
+ 		echo "install lmdb";
+ 		if [[ $2 == */* ]];then
+ 			install_lmdb $2;
+ 		    if [ $? -ne 0 ] 
+ 		    then
+ 		        echo "ERROR during lmdb installation" ;
+ 		        exit;
+ 		    fi  
+ 			shift
+ 			shift
+ 		else
+ 			install_lmdb;
+ 		    if [ $? -ne 0 ] 
+ 		    then
+ 		        echo "ERROR during lmdb installation" ;
+ 		        exit;
+ 		    fi  
+ 			shift
+ 		fi
+ 		;;
+ 	"OpenBLAS")
+ 		echo "install OpenBLAS";
+ 		if [[ $2 == */* ]];then
+ 			install_openblas $2;
+ 		    if [ $? -ne 0 ] 
+ 		    then
+ 		        echo "ERROR during openblas installation" ;
+ 		        exit;
+ 		    fi  
+ 			shift
+ 			shift
+ 		else
+ 			install_openblas;
+ 		    if [ $? -ne 0 ] 
+ 		    then
+ 		        echo "ERROR during openblas installation" ;
+ 		        exit;
+ 		    fi  
+ 			shift
+ 		fi
+ 		;;
+ 	"opencv")
+ 		echo "install opencv";
+ 		if [[ $2 == */* ]];then
+ 			install_opencv $2;
+ 		    if [ $? -ne 0 ] 
+ 		    then
+ 		        echo "ERROR during opencv installation" ;
+ 		        exit;
+ 		    fi  
+ 			shift
+ 			shift
+ 		else
+ 			install_opencv;
+ 		    if [ $? -ne 0 ] 
+ 		    then
+ 		        echo "ERROR during opencv installation" ;
+ 		        exit;
+ 		    fi  
+ 			shift
+ 		fi
+ 		;;
+ 	 "protobuf")
+ 		echo "install protobuf";
+ 		if [[ $2 == */* ]];then
+ 			install_protobuf $2;
+ 		    if [ $? -ne 0 ] 
+ 		    then
+ 		        echo "ERROR during protobuf installation" ;
+ 		        exit;
+ 		    fi  
+ 			shift
+ 			shift
+ 		else
+ 			install_protobuf;
+ 		    if [ $? -ne 0 ] 
+ 		    then
+ 		        echo "ERROR during protobuf installation" ;
+ 		        exit;
+ 		    fi  
+ 			shift
+ 		fi
+ 		;;
+ 	"zeromq")
+ 		echo "install zeromq";
+ 		if [[ $2 == */* ]];then
+ 			install_zeromq $2;
+ 		    if [ $? -ne 0 ] 
+ 		    then
+ 		        echo "ERROR during zeromq installation" ;
+ 		        exit;
+ 		    fi  
+ 			shift
+ 			shift
+ 		else
+ 			install_zeromq;
+ 		    if [ $? -ne 0 ] 
+ 		    then
+ 		        echo "ERROR during zeromq installation" ;
+ 		        exit;
+ 		    fi  
+ 			shift
+ 		fi
+ 		;;
+ 	"zookeeper")
+ 		echo "install zookeeper";
+ 		if [[ $2 == */* ]];then
+ 			install_zookeeper $2;
+ 		    if [ $? -ne 0 ] 
+ 		    then
+ 		        echo "ERROR during zookeeper installation" ;
+ 		        exit;
+ 		    fi  
+ 			shift
+ 			shift
+ 		else
+ 			install_zookeeper;
+ 		    if [ $? -ne 0 ] 
+ 		    then
+ 		        echo "ERROR during zookeeper installation" ;
+ 		        exit;
+ 		    fi  
+ 			shift
+ 		fi
+ 		;;
+ 	"all")
+ 		echo "install all dependencies";
+ 		if [[ $2 == */* ]];then
+ 			install_cmake $2;
+ 		    if [ $? -ne 0 ] 
+ 		    then
+ 		        echo "ERROR during cmake installation" ;
+ 		        exit;
+ 		    fi  
+ 			install_zeromq $2;
+ 		    if [ $? -ne 0 ] 
+ 		    then
+ 		        echo "ERROR during zeromq installation" ;
+ 		        exit;
+ 		    fi  
+ 			install_czmq $2 $2;
+ 		    if [ $? -ne 0 ] 
+ 		    then
+ 		        echo "ERROR during czmq installation" ;
+ 		        exit;
+ 		    fi  
+ 			install_gflags $2;
+ 		    if [ $? -ne 0 ] 
+ 		    then
+ 		        echo "ERROR during gflags installation" ;
+ 		        exit;
+ 		    fi  
+ 			install_glog $2;
+ 		    if [ $? -ne 0 ] 
+ 		    then
+ 		        echo "ERROR during glog installation" ;
+ 		        exit;
+ 		    fi  
+ 			install_lmdb $2;
+ 		    if [ $? -ne 0 ] 
+ 		    then
+ 		        echo "ERROR during lmdb installation" ;
+ 		        exit;
+ 		    fi  
+ 			install_openblas $2;
+ 		    if [ $? -ne 0 ] 
+ 		    then
+ 		        echo "ERROR during openblas installation" ;
+ 		        exit;
+ 		    fi  
+ 			install_opencv $2;
+ 		    if [ $? -ne 0 ] 
+ 		    then
+ 		        echo "ERROR during opencv installation" ;
+ 		        exit;
+ 		    fi  
+ 			install_protobuf $2;
+ 		    if [ $? -ne 0 ] 
+ 		    then
+ 		        echo "ERROR during protobuf installation" ;
+ 		        exit;
+ 		    fi  
+ 			install_zookeeper $2;
+ 			if [ $? -ne 0 ]
+ 			then
+ 				echo "ERROR during zookeeper installation" ;
+ 				exit;
+ 			fi
+ 			shift
+ 			shift
+ 		else
+ 			install_cmake;
+ 		    if [ $? -ne 0 ] 
+ 		    then
+ 		        echo "ERROR during cmake installation" ;
+ 		        exit;
+ 		    fi  
+ 			install_zeromq;
+ 		    if [ $? -ne 0 ] 
+ 		    then
+ 		        echo "ERROR during zeromq installation" ;
+ 		        exit;
+ 		    fi  
+ 			install_czmq;
+ 		    if [ $? -ne 0 ] 
+ 		    then
+ 		        echo "ERROR during czmq installation" ;
+ 		        exit;
+ 		    fi  
+ 			install_gflags;
+ 		    if [ $? -ne 0 ] 
+ 		    then
+ 		        echo "ERROR during gflags installation" ;
+ 		        exit;
+ 		    fi  
+ 			install_glog;
+ 		    if [ $? -ne 0 ] 
+ 		    then
+ 		        echo "ERROR during glog installation" ;
+ 		        exit;
+ 		    fi  
+ 			install_lmdb;
+ 		    if [ $? -ne 0 ] 
+ 		    then
+ 		        echo "ERROR during lmdb installation" ;
+ 		        exit;
+ 		    fi  
+ 			install_openblas;
+ 		    if [ $? -ne 0 ] 
+ 		    then
+ 		        echo "ERROR during openblas installation" ;
+ 		        exit;
+ 		    fi  
+ 			install_opencv;
+ 		    if [ $? -ne 0 ] 
+ 		    then
+ 		        echo "ERROR during opencv installation" ;
+ 		        exit;
+ 		    fi  
+ 			install_protobuf;
+ 		    if [ $? -ne 0 ] 
+ 		    then
+ 		        echo "ERROR during protobuf installation" ;
+ 		        exit;
+ 		    fi  
+ 			install_zookeeper;
+ 			if [ $? -ne 0 ]
+ 			then
+ 				echo "ERROR during zookeeper installation" ;
+ 				exit;
+ 			fi
+ 			shift
+ 		fi
+ 		;;
+ 	*)
+ 		echo "INVALID ARGUMENTS";
+ 		exit;
+ 	esac	
+ done