Configure and build fails on Windows install



Hi all,

I just wanted to let you know we’ve solved an issue with installation that may help others having issues with the ./configure and ./build scripts.

After running this error (as others have before me):

checking for Eigen 3 library:
ERROR: compiler error!

Use the EIGEN_CFLAGS environment variable to set the path to
the Eigen3 include files and to set any required flags
For example:
EIGEN_CFLAGS="-isystem /usr/include/eigen3" ./configure

we had to explicitly set the path to:

EIGEN_CFLAGS="-isystem c:/msys64/usr/include/eigen3"

The ./configure script then worked with no errors.

Also for both scripts we had to we had to change #!/usr/bin/env python to #!/usr/bin/env python3

Hope this helps.


Thanks for the feedback. We’ve indeed been struggling a bit with Windows installs of late, due to some quirks in the MSYS2 tools, which we rely on for Windows - see recent discussions on GitHub if you’re interested. We’re going to update the installation instructions for Windows installation based on this, although what I’m worried about is that these may change again as the MSYS2 maintainers clean up and unify their package management (this is the main source of problems at the moment). There is also an issue that will occur when users perform an update of MSYS2, documented here, which may trip up users too.

In a nutshell, the main changes to allow a smooth Windows installation using a recent version of MSYS2 are simply to add the packages python and pkg-config to the pacman -S command, invoked as part of the Install MRtrix3 dependencies section. At this point, ./configure should just run clean…


Hello Mrtrix experts,

I am writing to report that to install Mrtrix on Windows 7 - 64 bit I had to integrate the instructions I have found on your website.

Here is what I had to do:

  • I installed the dependencies, following the instructions;

  • I ran the ./build command, but I received an error on the Eigen3 section
    — I first tried to explicitly define the variable EIGEN_CFLAGS pointing it to minigw filesystem structure (as suggested by the script itself). However, this did not work;
    — I then found this thread (thanks phmag!) and inserted the explicit path of the library (sth like C:/path/to/minigw64/include/eigen3). This did not work either;
    — I have downloaded the latest version of eigen library from the project’s website (at 2017-10-05, 3.3.4). Turns out that this library does not really need specific tweaks: it works as it is.
    I extracted the files on a specific directory within minigw environment and tried to define the EIGEN_CFLAGS variable by using the minigw filesystem structure, but this did not work.
    — (Finally) I defined the EIGEN_CFLAGS variable by using the explicit path of the library (sth like C:/path/to/minigw64/home/ and it worked. (Yay!)

  • In addition to this: after configure and build, I wanted to use set_path script, but it did not work.
    — I somehow followed an updated version of the instructions included in another thread;
    — I ended up with appending to my .bashrc file the following line:
    export PATH=~/mrtrix3/bin:~/mrtrix3/lib:$PATH

and it worked.
Thanks again for maintaining this software and its discussion board.


Thanks for the feedback - hopefully this’ll be useful for others too.

This prompted me to look into the problem again, since the last time I checked, things worked out of the box with our instructions. But indeed, there is still an issue, which is due to the way MSYS2 has decided to package up various dependencies (see discussion here if you’re really interested). This must have been a relatively recent change, and is unfortunately one we don’t have a permanent fix for yet.

In the meantime, assuming that:

then this should work:

$ /usr/bin/python ./configure
$ /usr/bin/python ./build

The trick here is avoid using the default version of python (which is supplied as part of the MinGW project and dragged in as a dependency of Qt5), and use the MSYS-supplied version instead… As you can see, it’s a bit messy - we’ll try to come up with a better solution soon.

ERROR: error compiling Eigen3 application!
Error relating to C++ compiler when running ./configure on Windows

Just for the sake of having a more coherent system, I deleted mrtrix version I compiled using the latest eigen3 library and I re-compiled specifying python executable files as you suggested in the previous post, and it worked.