Build fails on Mac

Hi Guys,
I seem to be having the same problems as other installing the mrtrix3 on El capitan
Output is as follows despite trying everything I can understand from previous listings.
Did everything to the book but used macports, not home brew.
Did try EIGEN_CFLAGS="-isystem /usr/include/eigen3" ./configure
But no joy…
Hopefully not wasting your time and have missed the solution.

Mikes-MacBook-Pro:mrtrix3 mikebynevelt1$ ./configure

MRtrix build type requested: release

Detecting OS: darwin
Checking for C++11 compliant compiler [clang++]: 4.2.1 - 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: no
Checking for zlib compression library: 1.2.5
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

Mikes-MacBook-Pro:mrtrix3 mikebynevelt1$

Hey Mike!

Yep, we’re about to update the instructions to deal with this. You can be one of the first to try it out…

So first thing:

$ port install pkgconfig

and try again. If that fails, try:

$ EIGEN_CFLAGS="-isystem /opt/local/include/eigen3" ./configure

(Eigen3 installs in a different location from homebrew). If that still fails, you may be running into the same issues as @Adriano_BERNINI in this post. I sincerely hope you’re not, since this will probably take a while to figure out… In any case, if you can’t get it to work, please post the content of your configure.log file (within [code][/code] tags if possible, makes things much easier to read), otherwise we won’t be able to figure out what’s going on…

Hi Donald,
Eureka! we are now on the build! … that seemed to work through to the end!
Can’t get the mrview to work but I think the last script below is incorrect due to my incompetence lol … suggestions would be appreciated. Was in the mrtrix3 directory.
I’ve listed the scripts used as the terminal was a little messy … needed to delete the mrtrix3 :-
Nearly there.
Cheers and thanks,

$ sudo port install eigen3
$ sudo port install qt5
$ export PATH=/opt/local/libexec/qt5/bin:$PATH
$ git clone
$ cd mrtrix3
$ sudo port install pkgconfig
$ ./configure
$ ./build
$ echo PATH=$mrtrix3/release/bin:$mrtrix3/scripts:$PATH >> ~/.bashrc

Cool. If that runs through, but you can’t start MRView or any other commands, try changing that last command so that .bashrc becomes .bash_profile. i.e.:

$ echo PATH=$mrtrix3/release/bin:$mrtrix3/scripts:\$PATH >> ~/.bash_profile

and start a new terminal.

Arrggghh … so close
don’t have lift off yet, still can’t find command

ran the script as above … was in the mrtrix3 directory
Closed it
opened a new shell and entered mrview …

Mikes-MacBook-Pro:~ Mike_Bynevelt$ mrview
-bash: mrview: command not found

Tried also in mrtrix3 directory …same result


Can you check that $mrtrix3 is defined? This should print the mrtrix3 directory:
echo $mrtrix3

@maxpietsch: good get, hadn’t spotted that…

@Mike_Bynevelt: this is what’s currently in the docs:

$ echo PATH=$(pwd)/release/bin:$(pwd)/scripts:\$PATH >> ~/.bashrc  

What I was suggesting is to replace this with:

$ echo PATH=$(pwd)/release/bin:$(pwd)/scripts:\$PATH >> ~/.bash_profile  

Remember that the above must be issued from your mrtrix3 install folder, otherwise that $(pwd) bit will pick up the wrong folder…

so I ran

$ echo PATH=$mrtrix3/release/bin:$mrtrix3/scripts:$PATH >> ~/.bash_profile
whilst in the MRtrix3 directory,

closed the shell, opened another and entered

$ mrview

and still got

-bash: mrview: command not found

whether in Mrtrix3 or one directory higher

Not too sure what Max is meaning???



Hi Mike,

Go into the mrtrix3 directory
cd mrtrix3
and use

instead of

Then open a new terminal and it should find the binaries.


Jeez, by now your .bashrc and .bash_profile files are probably full of rubbish… If you double-check their contents to make sure there’s nothing in there other than what you’ve been adding to them (type cat ~/.bashrc and cat ~/.bash_profile to confirm), I’d delete them both and re-generate them again…

To do this, copy and paste the following lines into the terminal, without modifying them (this assumes you installed MRtrix3 in the ~/mrtrix3 folder):

rm ~/.bashrc ~/.bash_profile
cd ~/mrtrix3
echo PATH=$(pwd)/release/bin:$(pwd)/scripts:\$PATH >> ~/.bash_profile

Then as @maxpietsch says, open a new terminal and try launching mrview again.

We have lift off!!!
We have mrview!

Many thanks for all your help

Will get some data and start having some fun

Cheers and thanks again

Mike :grin:

Hi @Mike_Bynevelt,

Good to see you made it onto the community forum, and more importantly, that the help paid off! :smile: