Skip to content

Instantly share code, notes, and snippets.

@shotastage
Created June 16, 2017 03:00
Show Gist options
  • Save shotastage/7fa4174e9d367d0b5c659aa4d6094dc3 to your computer and use it in GitHub Desktop.
Save shotastage/7fa4174e9d367d0b5c659aa4d6094dc3 to your computer and use it in GitHub Desktop.
Create TensorFlow environment on SFC CCX server.
#!/usr/bin/env bash
echo "This script is EXPERIMENTAL version!!"
# Move home dir
cd
# Check existence
if [ -e ./anaconda3/ ]; then
echo "Anaconda and Python environment is already installed!"
exit 1
fi
# Prepare tmp dir and move into this dir
if [ -e ./ccx_setup_tmp ]; then
echo "CCX Installer Temporary Files already exists."
echo "If you have no issue, please remove this directory before run this script."
exit 1
else
mkdir ccx_setup_tmp
cd ./ccx_setup_tmp
fi
# Download Anaconda Installer
curl -O https://repo.continuum.io/archive/Anaconda3-4.4.0-Linux-x86_64.sh
# Check result and install anaconda
if [ -e Anaconda3-4.4.0-Linux-x86_64.sh ]; then
bash Anaconda3-4.4.0-Linux-x86_64.sh
else
echo "Failed to download installer."
exit
fi
# Download GCC source
curl -O http://ftp.tsukuba.wide.ad.jp/software/gcc/releases/gcc-7.1.0/gcc-7.1.0.tar.gz
if [ -e gcc-7.1.0.tar.gz ]; then
tar zxf gcc-7.1.0.tar.gz
else
echo "Failed to download GCC."
exot 1
fi
# Build and install GCC
cd ./gcc-7.1.0
./contrib/download_prerequisites
mkdir build
./configure --enable-languages=c,c++ --prefix=$HOME/local --disable-bootstrap --disable-multilib
cd build
make
make install
# Back
cd ..
cd ..
## Create Example TensorFlow Environmet
cd
conda create -n tensorflow_example python=3.6 tensorflow
source activate tensorflow_example
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment