Closed binarybottle closed 9 years ago
Daniel Clark (Child Mind Institute) wrote a new bash script that successfully installed mindboggle as a clean Amazon Web Services instance. He wrote:
"I successfully (no crashes!) ran "mindboggle bert --ants </path/to/segments_folder> -p
"Attached is an install script I developed to get all of the dependencies (using conda) installed on a fresh ubuntu 14.04 machine. I actually used this script, verbatim, to set up the AMI. It works by: "sudo ./install_mindboggle
"Finally, I ran a memory profiler on the "mindboggle bert --ants </path/to/segments_folder> -p
2/13/2015:
"I had a shell script with: mindboggle $SUBJECT --ants $ANTS_DIR --all -p $NUM_CORES in it. I then used mprof
Here is Daniel Clark's script:
#!/bin/bash
#
# Author: Daniel Clark, 2014
#
# Usage:
# ./install_mindboggle <download_dir> <install_dir>
# Note: <download_dir> must exist already and <install_dir> must not exist
# Take in download and install path arguments
DL_PREFIX=$1
INSTALL_PREFIX=$2
# Create global environment sourcing script
MB_ENV=/etc/profile.d/mb_env.sh
touch $MB_ENV
# --- Update and install system-wide dependencies ---
apt-get update
apt-get install -y g++ git make xorg
# --- Python/binary local dependencies ---
# Install miniconda for local installs management
CONDA_DL=${DL_PREFIX}/Miniconda-3.7.0-Linux-x86_64.sh
wget http://repo.continuum.io/miniconda/Miniconda-3.7.0-Linux-x86_64.sh -P $DL_PREFIX
chmod +x $CONDA_DL
$CONDA_DL -b -p $INSTALL_PREFIX
# Setup PATH
export PATH=${INSTALL_PREFIX}/bin:$PATH
# Install binaries for installing mindboggle
conda install --yes cmake pip
# Install python packages
conda install --yes numpy scipy matplotlib nose networkx traits vtk ipython
pip install nibabel nipype
VTK_DIR=${INSTALL_PREFIX}/lib/vtk-5.10
# --- Freesurfer ---
FS_DL=${DL_PREFIX}/freesurfer-Linux-centos4_x86_64-stable-pub-v5.3.0.tar.gz
wget -c ftp://surfer.nmr.mgh.harvard.edu/pub/dist/freesurfer/5.3.0/freesurfer-Linux-centos4_x86_64-stable-pub-v5.3.0.tar.gz -P $DL_PREFIX
tar -xvzf $FS_DL -C ${INSTALL_PREFIX}
# --- ANTs ---
ANTS_DL=${DL_PREFIX}/ants
git clone https://github.com/stnava/ANTs.git $ANTS_DL
cd $ANTS_DL
git checkout tags/v2.1.0rc2
mkdir ${INSTALL_PREFIX}/ants
cd ${INSTALL_PREFIX}/ants
cmake $ANTS_DL -DVTK_DIR:STRING=${VTK_DIR}
make
cp -r ${ANTS_DL}/Scripts/* ${INSTALL_PREFIX}/ants/bin
# --- Mindboggle ---
MB_DL=${DL_PREFIX}/mindboggle
git clone https://github.com/binarybottle/mindboggle.git $MB_DL
cd $MB_DL
python setup.py install --prefix=${INSTALL_PREFIX}
cd ${MB_DL}/mindboggle_tools/bin
cmake ../ -DVTK_DIR:STRING=${VTK_DIR}
make
cd $DL_PREFIX
cp -r ${MB_DL}/mindboggle_tools ${INSTALL_PREFIX}
# Remove downloads directory
rm ${DL_PREFIX}/* -rf
# --- Write to global mindboggle environment source-er ---
# Local install
echo "# Local install prefix" >> $MB_ENV
echo "export PATH=${INSTALL_PREFIX}/bin:\$PATH" >> $MB_ENV
# ANTs
echo "# ANTs" >> $MB_ENV
echo "export ANTSPATH=${INSTALL_PREFIX}/ants/bin" >> $MB_ENV
echo "export PATH=\$ANTSPATH:\$PATH" >> $MB_ENV
# Freesurfer
echo "# Freesurfer" >> $MB_ENV
echo "export FREESURFER_HOME=${INSTALL_PREFIX}/freesurfer" >> $MB_ENV
echo "source \${FREESURFER_HOME}/SetUpFreeSurfer.sh" >> $MB_ENV
echo "export PATH=\${FREESURFER_HOME}/bin:\$PATH" >> $MB_ENV
# Mindboggle
echo "# Mindboggle" >> $MB_ENV
echo "export MINDBOGGLE_TOOLS=${INSTALL_PREFIX}/mindboggle_tools/bin" >> $MB_ENV
echo "export PATH=\$MINDBOGGLE_TOOLS:\$PATH" >> $MB_ENV
I am overwriting the setup_mindboggle.sh script with Daniel's and will further test it...
Daniel Clark:
"I added some lines to the install script to include the scikit-learn/nilearn modules as part of the installation. I used this script to set up Mindboggle (without freesurfer dependencies) on a new lightweight AMI... Attached are the install script and memory profile (ran on a 2-core, 4GB RAM instance)."
I have modified the relevant lines to the setup_mindboggle.sh script https://github.com/binarybottle/mindboggle/blob/master/setup_mindboggle.sh
The setup_mindboggle.sh bash script sometimes works and sometimes does not because one or another thing would not install unless I rerun those particular lines of the script.