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 and 16.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 available, 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
    

    Some may need to install libqt5opengl5-dev (Thank you Steven Baete for the Feedback!)

    sudo apt-get install libqt5opengl5-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 “frankyeh-TIPL-xxxxxx(revision number).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
    xdg-open https://github.com/frankyeh/TIPL/zipball/master
    unzip frankyeh-TIPL-xxxxxxx.zip
    mv frankyeh-TIPL-xxxxxxx 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.

12 thoughts on “How-to build DSI Studio for Ubuntu 14.04 or later

  1. Hello,

    I have a new problem now. When I type ./dsistudio in the build directory. It shows up an Error window [Failed to load template file at]. Do you know how to solve this error message?

    • Dear Po-yu,

      Did you download windows version of DSI-Studio? Template files should be in there.

  2. Dear Frank and Kiyotoka,

    I am trying to compile DSI studio in my Ubuntu 16.04 but I encounter a problem on step 7 “qmake ../src”

    ~/dsistudio/build$ qmake ../src
    Could not find qmake configuration file linux-g++.
    Error processing project file: ../src/dsi_studio.pro

    I tried to find the answers on the Internet but these answers do not work for me.

    Please guide me to install your software.

    Thanks,
    Po-Yu

    • Dear Po-Yu,

      The error message indicates that you have problems with qmake.

      Could you tell me the result of the following command?

      $ qmake –version

      Best regards,

      Kiyotaka

      • pkao@Formosa:~$ qmake -version
        QMake version 3.0
        Using Qt version 5.6.2 in /home/pkao/anaconda2/bin/lib

        • Dear Po-Yu,

          In my circumstance,

          $ qmake –version
          QMake version 3.0
          Using Qt version 5.5.1 in /usr/lib/x86_64-linux-gnu

          In your circumstance, qmake in anaconda2 will be used, which causes problems.

          So easiest workaround might be to use the full path for qmake

          $ /usr/bin/qmake ../src

          If it doesn’t go well, please show me the result of followoing command

          $ which qmake

          Then I will be able to show you how to switch the different version of qmake in your circumstance.

          • Hi Kiyotaka,

            It works for me now. Thanks for your helping.

            Best,
            Po-Yu

          • Dear Po-Yu,

            Glad to know that the workaround works for you.

            Best regards,
            Kiyotaka

  3. Dear Frank and Kiyotoka,

    Thank you again Frank for the wonderful software, and thank you Kiyotoka for the installation instructions. I just compiled dsi_studio on my new Linux Mint 18.2 installation.
    The instructions were quite complete, except that I also needed to install the package libqt5opengl5-dev (error message: “qtOpenGL/QGLWidget: No such file or directory”).

    I thought I’d post this here to help the next person,

    Best regards,

    Steven

    • Dear Steven,

      Thank you for the feedback! I updated the article according to your suggestion.

      Best regards,
      Kiyotaka

  4. This is the developer of DSI Studio. Could I include you instruction on the DSI Studio website? I will acknowledge the source here. Thank you!

    • Dear Frank,

      Of course Yes! Thank you very much for developing such a wonderful software.
      I always build DSI-studio as I wrote in my post, so I hope it might help those who struggle building DSI studio for Ubuntu.

      Best regards,
      Kiyotaka

コメントを残す