Skip to content
Snippets Groups Projects
from-scratch.sh 3.15 KiB
#!/usr/bin/env bash
# Wed 17 Aug 2016 13:50:29 CEST

set -e

if [ "${#}" != 3 ]; then
  echo "usage: `basename $0` <basedir> <name> <python-version>"
  echo "example: `basename $0` /opt/conda bob-devel-py34 3.4"
  exit 1
fi

BASEDIR=$1
NAME=$2
PYTHON_VERSION=$3
CONDA=${BASEDIR}/bin/conda

if [ ! -d ${BASEDIR}/envs/${NAME} ]; then
  echo "[>>] Creating environment ${NAME} for python ${PYTHON_VERSION}..."
  if [[ "$PYTHON_VERSION" == "2.7" ]]; then
    ${CONDA} create --yes -n ${NAME} --override-channels --channel defaults python=2.7.12=1
  fi
  if [[ "$PYTHON_VERSION" == "3.4" ]]; then
    ${CONDA} create --yes -n ${NAME} --override-channels --channel defaults python=3.4.5=0
  fi
  if [[ "$PYTHON_VERSION" == "3.5" ]]; then
    ${CONDA} create --yes -n ${NAME} --override-channels --channel defaults python=3.5.2=0
  fi
fi

# For a complete list of dependencies, please read:
# https://gitlab.idiap.ch/bob/bob/wikis/Dependencies
echo "[>>] Installing Bob dependencies on ${NAME}..."
if [[ "$PYTHON_VERSION" == "2.7" ]]; then
  ${CONDA} install --yes -n ${NAME} --override-channels -c defaults \
    nomkl \
    cmake \
    pip=8.1.2=py27_0 \
    coverage=4.2 \
    sphinx=1.4.6=py27_0 \
    sphinx_rtd_theme=0.1.9=py27_0 \
    cython=0.24=py27_0 \
    docopt \
    ipython=4.2.0=py27_0 \
    matplotlib=1.5.1=np111py27_0\
    nose=1.3.7=py27_1 \
    numexpr=2.6.0 \
    numpy=1.11.1 \
    pillow=3.2.0=py27_1 \
    pkg-config \
    psutil=4.3.0=py27_0 \
    scikit-learn=0.17.1 \
    scipy=0.17.1 \
    sqlalchemy=1.0.13=py27_0 \
    dask=0.10.0=py27_0 \
    scikit-image=0.12.3=np111py27_1
fi
if [[ "$PYTHON_VERSION" == "3.4" ]]; then
  ${CONDA} install --yes -n ${NAME} --override-channels -c defaults \
    nomkl \
    cmake \
    pip=8.1.2=py34_0 \
    coverage=4.2 \
    sphinx=1.4.6=py34_0 \
    sphinx_rtd_theme=0.1.9=py34_0 \
    cython=0.24=py34_0 \
    docopt \
    ipython=4.2.0=py34_0 \
    matplotlib=1.5.1=np111py34_0\
    nose=1.3.7=py34_1 \
    numexpr=2.6.0 \
    numpy=1.11.1 \
    pillow=3.2.0=py34_1 \
    pkg-config \
    psutil=4.3.0=py34_0 \
    scikit-learn=0.17.1 \
    scipy=0.17.1 \
    sqlalchemy=1.0.13=py34_0 \
    dask=0.10.0=py34_0 \
    scikit-image=0.12.3=np111py34_1
fi
if [[ "$PYTHON_VERSION" == "3.5" ]]; then
  ${CONDA} install --yes -n ${NAME} --override-channels -c defaults \
    nomkl \
    cmake \
    pip=8.1.2=py35_0 \
    coverage=4.2 \
    sphinx=1.4.6=py35_0 \
    sphinx_rtd_theme=0.1.9=py35_0 \
    cython=0.24=py35_0 \
    docopt \
    ipython=4.2.0=py35_0 \
    matplotlib=1.5.1=np111py35_0\
    nose=1.3.7=py35_1 \
    numexpr=2.6.0 \
    numpy=1.11.1 \
    pillow=3.2.0=py35_1 \
    pkg-config \
    psutil=4.3.0=py35_0 \
    scikit-learn=0.17.1 \
    scipy=0.17.1 \
    sqlalchemy=1.0.13=py35_0 \
    dask=0.10.0=py35_0 \
    scikit-image=0.12.3=np111py35_1
fi

${CONDA} install --yes -n ${NAME} --override-channels -c defaults \
    hdf5=1.8.17=1 \
    jpeg=8d=2 \
    libpng=1.6.22=0 \
    libtiff=4.0.6=2

${CONDA} install --yes -n ${NAME} --override-channels -c defaults -c conda-forge \
  boost=1.61.0 \
  ffmpeg=2.8.6 \
  giflib=5.1.4 \
  ipdb \
  libblitz=0.10 \
  libmatio=1.5.6 \
  libsvm=3.21 \
  sox=14.4.2 \
  vlfeat=0.9.20

echo "[>>] Bye!"
exit 0