Skip to content

Instantly share code, notes, and snippets.

@yuchsiao
Last active March 11, 2016 19:35

Revisions

  1. yuchsiao revised this gist Mar 11, 2016. 1 changed file with 8 additions and 2 deletions.
    10 changes: 8 additions & 2 deletions rdht67_tensorflow.sh
    Original file line number Diff line number Diff line change
    @@ -73,5 +73,11 @@ sudo chmod 755 /usr/lib64/libstdc++.so.6.0.21
    # Install tensorflow
    ## GPU support
    sudo pip install --upgrade https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.7.1-cp27-none-linux_x86_64.whl
    ## CPU only
    sudo pip install --upgrade https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.7.1-cp27-none-linux_x86_64.whl
    ## CPU only (not working)
    sudo pip install --upgrade https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.7.1-cp27-none-linux_x86_64.whl
    ## CPU conda
    conda install -c https://conda.anaconda.org/jjhelmus tensorflow -7

    # Test tensorflow
    cd miniconda2/lib/python2.7/site-packages/tensorflow/models/image/mnistc
    python convolutional.py
  2. yuchsiao revised this gist Mar 11, 2016. 1 changed file with 2 additions and 3 deletions.
    5 changes: 2 additions & 3 deletions rdht67_tensorflow.sh
    Original file line number Diff line number Diff line change
    @@ -22,7 +22,6 @@ conda install scipy -y
    conda install scikit-learn -y

    # JAVA env
    # Install JDK
    wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/8u72-b15/jdk-8u72-linux-x64.tar.gz"
    tar xzf jdk-8u72-linux-x64.tar.gz
    sudo mv jdk1.8.0_72 /opt
    @@ -43,7 +42,7 @@ sudo yum install gcc -y
    sudo yum install gcc-c++ -y
    sudo yum groupinstall -y "Development tools"

    ## GLIBC
    ## NEW GLIBC
    GLIBC_VERSION=2.20
    wget http://ftp.gnu.org/gnu/glibc/glibc-$GLIBC_VERSION.tar.gz
    tar -xzf glibc-$GLIBC_VERSION.tar.gz
    @@ -54,7 +53,7 @@ cd glibc-build
    make
    sudo make install

    ## GCC and LIBSTDC++
    ## NEW GCC and LIBSTDC++
    wget ftp://ftp.gwdg.de/pub/misc/gcc/releases/gcc-5.3.0/gcc-5.3.0.tar.gz
    tar -xzf gcc-5.3.0.tar.gz
    cd gcc-5.3.0
  3. yuchsiao revised this gist Mar 11, 2016. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions rdht67_tensorflow.sh
    Original file line number Diff line number Diff line change
    @@ -1,12 +1,12 @@
    cd

    # Python env
    CONDA_PATH="miniconda2"

    # Screen env
    wget https://gist.githubusercontent.com/yuchsiao/e2f9c1481976b4d5c524/raw/870969f072c461ad47da76e5822bdd3b807a9829/.screenrc
    sudo yum -y install screen
    screen

    # Python env
    CONDA_PATH="miniconda2"
    wget https://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh
    chmod u+x Miniconda-latest-Linux-x86_64.sh
    ./Miniconda-latest-Linux-x86_64.sh -b -p $CONDA_PATH # -b for batch no prompt
  4. yuchsiao created this gist Mar 11, 2016.
    78 changes: 78 additions & 0 deletions rdht67_tensorflow.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,78 @@
    cd

    # Python env
    CONDA_PATH="miniconda2"

    wget https://gist.githubusercontent.com/yuchsiao/e2f9c1481976b4d5c524/raw/870969f072c461ad47da76e5822bdd3b807a9829/.screenrc
    sudo yum -y install screen
    screen

    wget https://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh
    chmod u+x Miniconda-latest-Linux-x86_64.sh
    ./Miniconda-latest-Linux-x86_64.sh -b -p $CONDA_PATH # -b for batch no prompt

    echo '
    # added by Miniconda2 3.19.0 installer
    export PATH="/home/ec2-user/'$CONDA_PATH'/bin:$PATH"
    ' >> .bashrc
    source .bashrc

    conda install numpy -y
    conda install scipy -y
    conda install scikit-learn -y

    # JAVA env
    # Install JDK
    wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/8u72-b15/jdk-8u72-linux-x64.tar.gz"
    tar xzf jdk-8u72-linux-x64.tar.gz
    sudo mv jdk1.8.0_72 /opt
    sudo alternatives --install /usr/bin/java java /opt/jdk1.8.0_72/bin/java 2
    sudo alternatives --config java
    echo 'export JAVA_HOME=/opt/jdk1.8.0_72
    export JRE_HOME=/opt/jdk1.8.0_72/jre
    export PATH="/opt/jdk1.8.0_72/bin:/opt/jdk1.8.0_72/jre/bin:$PATH"
    ' | tee -a $HOME/.bashrc
    source $HOME/.bashrc
    echo "export JAVA_HOME=/opt/jdk1.8.0_72
    export JRE_HOME=/opt/jdk1.8.0_72/jre
    " | sudo tee -a /etc/environment


    # GCC env
    sudo yum install gcc -y
    sudo yum install gcc-c++ -y
    sudo yum groupinstall -y "Development tools"

    ## GLIBC
    GLIBC_VERSION=2.20
    wget http://ftp.gnu.org/gnu/glibc/glibc-$GLIBC_VERSION.tar.gz
    tar -xzf glibc-$GLIBC_VERSION.tar.gz
    cd glibc-$GLIBC_VERSION
    mkdir glibc-build
    cd glibc-build
    ../configure --prefix='/usr'
    make
    sudo make install

    ## GCC and LIBSTDC++
    wget ftp://ftp.gwdg.de/pub/misc/gcc/releases/gcc-5.3.0/gcc-5.3.0.tar.gz
    tar -xzf gcc-5.3.0.tar.gz
    cd gcc-5.3.0
    ./contrib/download_prerequisites
    mkdir objdir
    cd objdir
    ../configure --prefix=$HOME/gcc-5.3.0 --disable-multilib
    make
    make install
    sudo mv /usr/lib64/libstdc++.so.6 /usr/lib64/libstdc++.so.6.bak
    sudo cp $HOME/gcc-5.3.0/lib64/libstdc++.so.6 /usr/lib64/libstdc++.so.6
    sudo cp $HOME/gcc-5.3.0/lib64/libstdc++.so.6.0.21 /usr/lib64/libstdc++.so.6.0.21
    sudo chmod 755 /usr/lib64/libstdc++.so.6
    sudo chmod 755 /usr/lib64/libstdc++.so.6.0.21


    # Install tensorflow
    ## GPU support
    sudo pip install --upgrade https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.7.1-cp27-none-linux_x86_64.whl
    ## CPU only
    sudo pip install --upgrade https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.7.1-cp27-none-linux_x86_64.whl