nipy / mindboggle

Automated anatomical brain label/shape analysis software (+ website)
http://mindboggle.info
Other
145 stars 54 forks source link

Mindboggle installation file #50

Closed binarybottle closed 9 years ago

binarybottle commented 9 years ago

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.

binarybottle commented 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 " on the mindboggle AMI I've been experimenting with; this verifies that everything should (hopefully) be installed correctly. So as of now, it looks like the AMI is up and good to go. * One note, is that any users who use the AMI will need to upload their own Freesurfer .license file to the freesurfer directory (/home/ubuntu/local/freesurfer), in order for those tools to be used. * Also, I have included the "bert" subject's antsCorticalThickness.sh outputs as part of the AMI, so users can run mindboggle with --ants out of the box."

"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 " - a nice feature in this script is that all of the mindboggle environment variables are controlled globally in an isolated file in /etc/profile.d/mb_env.sh. That way, multiple users don't have to mess with their .bashrc, everything just works. This script is more for your information and if you'd like to use it, feel free to have it (and modify)!"

"Finally, I ran a memory profiler on the "mindboggle bert --ants </path/to/segments_folder> -p " command, just to get an idea of the memory requirements of mindboggle (this is a nice reference to have overall, but we actually did it so we can run ABIDE through mindboggle on our cluster, knowing how much memory we need to allocate). I have attached a plot of mindboggle's (and all of it's child processes) memory usage across the duration of the run. You can see it takes, at most, ~1.75GB."

2/13/2015: "I had a shell script with: mindboggle $SUBJECT --ants $ANTS_DIR --all -p $NUM_CORES in it. I then used mprof & to kick off the memory profiler. As this was run on an AMI, I believe this was done using 4-cores. You should note that mindboggle almost certainly is faster than the plot indicates; the mprof command is continuously polling the system memory usage, which takes up computation cycles."

mindboggle_memory

binarybottle commented 9 years ago

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
binarybottle commented 9 years ago

I am overwriting the setup_mindboggle.sh script with Daniel's and will further test it...

binarybottle commented 9 years ago

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

figure_1