Skip to content

Instantly share code, notes, and snippets.

@tnarihi
Last active September 29, 2015 00:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tnarihi/cf9154357500de8b051b to your computer and use it in GitHub Desktop.
Save tnarihi/cf9154357500de8b051b to your computer and use it in GitHub Desktop.
Batch Python installation script for dependencies of tnarihi Caffe .

Batch Python installation script for dependencies of tnarihi Caffe

This will install the Anaconda distribution of Python and enable opencv2 features and some CUDA wrappers. This script is tested on my Ubuntu 14.04.

This script is not well-designed and has no error handling, so I recommend you to run the commands in the script step-by-step.

#! /bin/bash
BASE_DIR=`pwd`
# Install Anaconda and Caffe dependencies
wget http://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O miniconda.sh
chmod +x miniconda.sh
./miniconda.sh -b
export PATH=$HOME/miniconda/bin:$PATH
conda update --yes conda
conda install --yes numpy scipy matplotlib scikit-image pip
conda install protobuf --yes
# Install OpenCV 2.4.10 from source. After installing, you should set some environment variables such as PATH, PYTHONPATH and LD_LIBRARY_PATH.
wget http://downloads.sourceforge.net/project/opencvlibrary/opencv-unix/2.4.10/opencv-2.4.10.zip
unzip opencv-2.4.10.zip
cd opencv-2.4.10
mkdir build
cd build
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=$HOME/software/opencv24 ..
make && make install
cd $BASE_DIR
# Install CUDA utilities
wget https://pypi.python.org/packages/source/p/pycuda/pycuda-2014.1.tar.gz
tar xvf pycuda-2014.1.tar.gz
cd pycuda-2014.1
./configure.py --cuda-root=/usr/local/cuda --cudadrv-lib-dir=/usr/lib/x86_64-linux-gnu --boost-inc-dir=/usr/include --boost-lib-dir=/usr/lib --boost-python-libname=boost_python --boost-thread-libname=boost_thread --no-use-shipped-boost
make -j 4
python setup.py install
conda install six --yes
pip install scikits.cuda
pip install Mako
# Templating prototxt
conda install --yes jinja2
# Concurrent execution
conda install --yes futures
# iPython >= 3.0.0 (optional)
conda install ipython --yes
conda update ipython --yes
conda install jsonschema --yes
conda install pyzmq --yes
conda install --yes tornado
# Drawing nets (optional)
conda install --yes pydot
# Pillow
conda install --yes pillow
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment