Failure to install mrdegibbs3D

Hi MRtrix3 community,

Hope this is the right forum to post to ask for some help with installing mrdegibbs3D.

I’ve successfully installed MRtrix3 (building it from source) and git cloned the mrdegibbs3D repo, however I’m running into some issues when trying to compile it which I’m not sure how to fix.

Here's the message that I get:1/7) [CC] tmp/cmd/filter_kspace.o
(2/7) [CC] tmp/src/project_version.o
(4/7) [CC] tmp/cmd/deGibbs3D.o
(3/7) [CC] tmp/cmd/add_gibbs.o
(5/7) [LB] bin/add_gibbs

ERROR: (5/7) [LB] bin/add_gibbs

/usr/bin/g++ ../tmp/src/exec_version.o tmp/cmd/add_gibbs.o tmp/src/project_version.o -lmrtrix -mmacosx-version-min=10.14 -lz -L/usr/local/Cellar/libtiff/4.3.0/lib -ltiff -L/usr/local/Cellar/libpng/1.6.37/lib -lpng16 -lz -Wl,-rpath,@loader_path/../../lib -L../lib -o bin/add_gibbs

failed with output

Undefined symbols for architecture x86_64:
  "_fftw_execute", referenced from:
      void MR::Math::FFT<MR::Image<std::__1::complex<double> >, MR::Image<std::__1::complex<double> > >(MR::Image<std::__1::complex<double> >&, MR::Image<std::__1::complex<double> >&, unsigned long, int)::FFTFunctor::operator()(MR::Iterator const&) in add_gibbs.o
      void MR::Math::FFT<MR::Image<std::__1::complex<double> > >(MR::Image<std::__1::complex<double> >&, unsigned long, int)::FFTFunctor::operator()(MR::Iterator const&) in add_gibbs.o
  "_fftw_plan_dft_1d", referenced from:
      MR::Math::FFT1D::FFT1D(MR::Math::FFT1D const&) in add_gibbs.o
      MR::Math::FFT1D::FFT1D(unsigned long, int) in add_gibbs.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Would anyone be able to advise me regarding what’s going wrong?

Many thanks,
Cristiana Tisca

If you’re trying to compile the mrdegibbs3D code, you’ll need to make sure the main MRtrix core is itself configured and compiled with FFTW support. If you look at your config file in the core repo folder, you should see the line where is checks for FFTW support. If that’s not enabled, you’ll need to install the FFTW package via homebrew (which I’m assuming is what you’re using here). Then re-run ./configure and ./build to make sure it’s actually using the FFTW library.

Thanks a lot for the speedy reply! It turned out that there were quite a lot of dependencies not really working well on my Mac, so I ended up updating mac os to Big Sur and reinstalling a few things. I had an issue with the eigen library and needed an older version to be able to run build for MRtrix again but then everything else worked well.

3D Gibbs ringing correction seems to be looking great and we are now considering using this tool instead of 2D Gibbs ringing correction for our postprocessing. Many thanks for sharing this tool!