Problem with Qt qmake installing MRtrix

Hi all,

I’m trying to install MRtrix on Ubuntu 14.04. I’ve downloaded all the dependencies, but when I run /.configure it gives me this:

Detecting OS: linux
Checking for C++11 compliant compiler [g++]: 4.8 - tested ok
Detecting pointer size: 64 bit
Detecting byte order: little-endian
Checking for variable-length array support: yes
Checking for non-POD variable-length array support: yes
Checking for zlib compression library: 1.2.8
Checking for GNU Scientific Library: 1.16
Checking whether GSL compiles with -DHAVE_INLINE: yes
Checking shared library generation: yes
Checking for Qt moc: moc (version 5.2.1)
Checking for Qt qmake:
ERROR: Qt qmake not found!

Use the QMAKE environment variable to specify the Qt qmake executable,
or set PATH to include its location

To see whether Qt qmake is installed or not, I ran “which qmake” and here’s the output:


Then I tried “gedit .bashrc” and added “export PATH=/opt/sge/bin/lx-amd64/qmake:$PATH” at the end, but still getting the same error.

I’ll be thankful with any help.


I suppose that the problem is, that your “which qmake” is pointing to completely another qmake binary, not related to Qt, but to Grid Engine: . This is collision of names. To make it working, you should change precedence of the paths in PATH variable: first to point to your Qt qmake binary, then to sge binary.

Edit: didn’t see @Antonin_Skoch’s reply.

Hello Amir,

I guess you don’t have qmake installed. You can check via:
dpkg -s libqt4-opengl-dev

If you do have it installed, you could set QMAKE to point to the correct qmake path:
export QMAKE=<path/to/qmake>; ./configure

You can check whether you have the QMAKE environment variable set correctly via:
python -c "import os; print (os.environ['QMAKE'])"

Also, I would add the directory containing qmake (not the executable) to PATH:
export PATH=<directory/containing/qmake>:$PATH; ./configure


Given the above, it sounds to me like you want to avoid having /opt/sge/bin/lx-amd64/ in your PATH when you invoke ./configure - assuming you’ve got all the Qt dependencies installed properly. On Ubuntu, the Qt qmake should be in /usr/bin, so I recommend you try:

$ echo $PATH

then copy those parts of the output that aren’t /opt/sge/bin/lx-amd64/, and paste them into:

$ export PATH=<paste here>

and try ./configure again. Realistically, all you should need for ./configure to work on a standard 14.04 install is a very minimal PATH. You only need python, g++ and qmake and the other associated Qt executables (rcc and moc). All of these should be in /usr/bin already. You might find that:

$ export PATH=/usr/bin

is sufficient to run ./configure correctly…