How-to build DSI Studio for Ubuntu 14.04 or later

DSI Studio is an open-source diffusion MRI analysis tool. We need to compile the software for Linux.
Note for Compile is found here, but it is a liitle bit out-of-date.

I could successfully finish compile the DSI Studio for Ubuntu 14.04. Below is what I did.

  1. Install gcc-5 and g++-5 (for Ubuntu 14.04)
  2. DSI Studio needs gcc-5 and g++-5 for compile. We can install them via PPA.

    sudo add-apt-repository ppa:ubuntu-toolchain-r/test
    sudo apt-get update
    sudo apt-get install g++-5
    
  3. Link gcc and g++ to gcc-5 and g++-5 (for Ubuntu 14.04)
  4. Just installing gcc-5 and g++-5 won’t have any effects on the machine.
    You can check the version of gcc and g++ by typing gcc –version and g++ –version

    gcc --version
        gcc (Ubuntu 4.8.4-2ubuntu1~14.04.3) 4.8.4
    
    g++ --version
        g++ (Ubuntu 4.8.4-2ubuntu1~14.04.3) 4.8.4
    

    In order to make gcc-5 and g++-5, we need to do the following;

    sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 10
    sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-5 10
    

    You should see something like;

    update-alternatives: using /usr/bin/g++-5 to provide /usr/bin/g++ (g++) in auto mode
    
  5. Install necessary files for compile
  6. We also need to install the following;

    sudo apt-get install qt5-qmake qt5-default
    sudo apt-get install git libboost-all-dev zlib1g zlib1g-dev
    
  7. Prepare a working directory
  8. Prepare a working directory. We save files in this directory.

    mkdir dsistudio
    
  9. Get the Windows version of DSI Studio
  10. Download the Windows version of DSI Studio from this link and save it under working directory (dsistudio).
    Filename should be “dsi_studio_64.zip.”

  11. Get the source code from GitHub
  12. Now we get the source code of DSI Studio from Github. We also need “master.zip” to be downloaded. After unzipping, rename the folder as image, and move under src.

    cd dsistudio
    git clone -b master git://github.com/frankyeh/DSI-Studio.git src
    wget https://github.com/frankyeh/TIPL/archive/master.zip
    unzip master.zip
    mv TIPL-master image
    mv image src
    
  13. Compile
  14. Prepare a directory for build and compile.

    mkdir build
    cd build
    qmake ../src
    make
    

    If it goes well, you should find dsi_studio under build directory.
    You may remove unnecessary files with make clean

    make clean
    
  15. Packaging
  16. Windows version zip file has atlas and other files included. We make use of it.
    DLL files are for Windows, so we delete all of them.

    cd .. # Now you should be in the "dsistudio" directory
    unzip dsi_studio_64.zip
    cd dsi_studio_64
    find . -name '*.dll' -exec rm {} \;
    rmdir iconengines imageformats platforms printsupport
    rm dsi_studio.exe
    cp ../build/dsi_studio .
    
  17. Run DSI Studio
  18. Now you can run DSI Studio from the terminal.

    ./dsi_studio
    

    If everything works, the command brings up DSI Studio.

コメントを残す