Skip to content
LoicCadour edited this page Aug 28, 2017 · 34 revisions

Pre-requisites

Windows

If you want a 64bit compilation, you will need to compile Qt since there is no installer for Qt4-64bit. You will need 64bit version of OpenSSL as well. Just follow this instructons :

  • Set up the 64 bit environment for Visual Studio by executing: Path_to_visual_studio_2010\VC\bin\amd64\vcvars64.bat
  • Get and install Win64 openSSL from here : http://slproweb.com/products/Win32OpenSSL.html
  • Get qt-everywhere-opensource-src from here http://download.qt-project.org/official_releases/qt/4.8
  • Go to the source directory of Qt using the Visual studio Win64 command prompt and configure it with the win64 version of openSSL : configure -plugin-sql-sqlite -no-qt3support -nomake examples -nomake demos
    -openssl -I path_to_OpenSSL-Win64\include -L path_to_OpenSSL-Win64
  • Compile and install Qt (very long, it will take a couple of hours) : nmake INSTALL

macOS

Download Xcode on the AppStore. In the meantime download CMake 3+.

Create a ssh key: https://help.github.com/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent/

And add it to your Github account.

Install Homebrew using this website: https://brew.sh

Then in the Terminal: brew install boost

To install Qt 4.8.7

Download the tar.gz package from here: https://download.qt.io/official_releases/qt/4.8/4.8.7/

Then follow this: http://doc.qt.io/qt-4.8/install-mac.html

Notes:

-bash: ./configure: /bin/sh^M: bad interpreter: No such file or directory

open configure with vi, then press Esc and type :set fileformat=unix, save with :x!.

  • After creating .profile in your home directory, restart your computer
  • Check that qt is well installed: qmake --version

Linux

You'll need to install the appropriate packages that provide the following software :

  • GCC and G++
  • Git
  • Subversion
  • CMake 2.8.10+
  • Qt4 developpement tools and headers

On Deb based distributions (Debian, Ubuntu, Mint...) :

aptitude install gcc g++ git subversion cmake qt4-dev-tools libxt-dev libzip-dev boost-dev

On RPM based distributions (Fedora, Red-Hat, OpenSUSE...) :

yum install gcc gcc-g++ gcc-c++ git subversion cmake qt-devel libXt-devel boost-devel qtwebkit-devel

These need to be run as the root user, or using sudo.

Make sure your version of cmake is 3.0 or higher :

cmake --version

If not, you will need to install the latest version from http://www.cmake.org/cmake/resources/software.html

Compiling medInria in 5 steps

  1. Get the superproject's sources

    git clone https://github.com/medInria/medinria-superproject.git

  2. Go into medinria-superproject, and create a build directory

    cd medinria-superproject && mkdir build

  3. Enter the build directory :

    cd build

  4. Configure

    cmake ..

    You may want to run cmake-gui or ccmake instead if you need to fill in variables, such as the path to qmake on Windows.

  5. Compile

    cmake --build . --config RelWithDebInfo

It will take a while. When it's done, you can run it using :

Linux & Mac : ./medInria.sh
Windows : medInria.bat RelWithDebInfo or to open in Visual Studio : medInria-dev.bat

NB: if you already have your own VTK5.10, be sure it's compiled:

  • with VTK_USE_QT set to ON
  • (on Linux, with CMAKE_CXX_FLAGS and CMAKE_C_FLAGS set to -fPIC)