Skip to content

Instantly share code, notes, and snippets.

@ravnoor
Last active April 28, 2018 18:07
Show Gist options
  • Save ravnoor/2721da3c62a3df9b445bd444c647a70a to your computer and use it in GitHub Desktop.
Save ravnoor/2721da3c62a3df9b445bd444c647a70a to your computer and use it in GitHub Desktop.
Build MRtrix3 without root
# tested on silius with conda python(2.7) installed
TOOLSDIR=/host/silius/local_raid/ravnoor/00_toolbox
conda install libgcc
######################################################
# build and install gcc > 4.8 (c++ 11 support)
wget http://ca.mirror.babylon.network/gcc/releases/gcc-4.9.4/gcc-4.9.4.tar.gz
tar xzf gcc-4.9.4.tar.gz
cd gcc-4.9.4
./contrib/download_prerequisites
cd ..
mkdir ${TOOLSDIR}/gcc-4.9.4-build/
mkdir objdir
cd objdir
unset LIBRARY_PATH; ../gcc-4.9.4/configure --prefix=${TOOLSDIR}/gcc-4.9.4-build/ --enable-languages=c,c++,fortran,go
make -j4 && make install
######################################################
######################################################
# download and install MRtrix3
git clone https://github.com/MRtrix3/mrtrix3.git
cd mrtrix3
######################################################
######################################################
# update Eigen libraries
wget http://bitbucket.org/eigen/eigen/get/3.3.4.tar.gz
tar xvzf 3.3.4.tar.gz
######################################################
######################################################
# configure and build MRtrix3
PATH=${TOOLSDIR}/anaconda2/bin/:$PATH
CXX=${TOOLSDIR}/gcc-4.9.4-build/bin/g++ \
EIGEN_CFLAGS="-isystem \"$(pwd)/eigen-eigen-5a0156e40feb\"" QMAKE=/usr/bin/qmake ./configure
NUMBER_OF_PROCESSORS=8 ./build
cp ${TOOLSDIR}/anaconda2/lib/libstdc++.so.6 ./release/lib/
./set_path ~/.bash_profile # add to PATH
######################################################
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment