MRtrix build error - MacOS Big Sur

Dear forum,

I’ve encountered problems with the MRtrix 3 build. I have followed the instructions page using homebrew to install the dependencies. The MRtrix ./configure looks ok, but when I ./build the following issue repeatedly shows (I have tried to reinstall qt5 and eigen, but this did not resolve the issue). In the terminal the following is stated:

ERROR: ( 9/546) [CC] tmp/core/file/dicom/tree.o

clang++ -c -std=c++11 -DMRTRIX_BUILD_TYPE=“release version” -DMRTRIX_MACOSX -fPIC -mmacosx-version-min=11.5 -DMRTRIX_WORD64 -DMRTRIX_HAVE_EIGEN_UNSUPPORTED_SPECIAL_FUNCTIONS -DMRTRIX_TIFF_SUPPORT -idirafter /usr/local/Cellar/libtiff/4.3.0/include -DMRTRIX_PNG_SUPPORT -idirafter /usr/local/Cellar/libpng/1.6.37/include/libpng16 -DEIGEN_FFTW_DEFAULT -idirafter /usr/local/Cellar/fftw/3.3.9_1/include -Wall -O3 -DNDEBUG -Isrc -I./core -Icmd -idirafter /usr/local/Cellar/eigen/3.4.0/include/eigen3 -DEIGEN_DONT_PARALLELIZE core/file/dicom/tree.cpp -o tmp/core/file/dicom/tree.o

failed with output

In file included from core/file/dicom/tree.cpp:17:

In file included from ./core/file/path.h:30:

In file included from ./core/exception.h:24:

./core/types.h:326:9: error: redefinition of ‘Vector3’ as different kind of symbol

using Vector3 = Matrix<MR::default_type, 3, 1>;


/usr/local/Cellar/eigen/3.4.0/include/eigen3/Eigen/src/Core/Matrix.h:541:1: note: previous definition is here


I hope someone has an idea how to resolve this problem so I can get MRtrix 3 up and running.


There are currently issues related to eigen 3.4. I think the fix is pretty much ready but if you do not want to wait for the merge, you can downgrade eigen in homebrew to 3.3.7 with the below commands, then repeat configure and build:

brew unlink eigen
brew tap-new core/eigen
brew extract eigen --version 3.3.7 core/eigen
brew install core/eigen/eigen@3.3.7

Thanks a lot! This solved the problem!