Build fails on Mac

Pim, are you sure you didn’t do EIGEN_CFLAGS="-isystem /where/you/extracted/eigen/Eigen" ./configure ? I think Donald was on to something…

I tried to clarify some of the OS X installation instructions here: https://github.com/MRtrix3/mrtrix3/pull/471. I only use homebrew, against which I have tested it. So let me know or feel free to change it if any of the other ways don’t work.

@bjeurissen: Fine with me too, as long as it’s properly documented. Maybe just add the command of your last post to the docs?

On a more general note, I am wondering if we could automate the Eigen install altogether (ideally for all systems)? I assume the licence doesn’t allow to simply ship Eigen with MRtrix. However, if configure doesn’t detect an existing installation, it could clone the latest version into, say, mrtrix3/Eigen and proceed from there. Main issue is that Eigen uses Mercurial instead of git, which is not installed by default. Thoughts?

Very nice Max. I like how you separate 3 main options, and then advise to install both Eigen and Qt in that same way.

Pretty sure I was… :wink:

In the code, we’d include the Eigen headers as #include <Eigen/Array>, etc. The correct path to add to the CFLAGS is therefore that enclosing the main Eigen folder, not the Eigen folder itself. There shouldn’t have been a conflict using the correct path.

As to how to fix the instructions, I think providing clear instructions for the 3 different approaches is probably the best, with a solid default recommendation. @maxpietsch tells me you can install all the dependencies including Qt5 via homebrew, so this seems like the simplest and least likely to trip up users. No idea whether Qt5 can be installed via macports, but assuming it can’t, the requirement to also install the massive Qt5 installer (and remember where it was installed) makes the overall installation process more complex, and hence more error-prone. So that would argue for macports not being the default option. But given that many people will swear by macports, we need to provide instructions for it. The direct download route should probably be the last resort…

Hi Donald,

Been following this thread pretty loosely, so apologies if I’m repeating information. Just wanted to say you can install Qt5 via MacPorts, it’s documented here.

Disclaimer: I haven’t actually used this, I did my installation with homebrew which worked a charm : )

Qt5 via MacPorts is just a matter of port install qt5, so it is equally well supported…

OK, I guess that answers that question then… I think we should move the conversation over to the relevant GitHub issue - I can’t keep track of the discussion on two fronts at once…

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.
Thanks,
Mike

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,
Mike

$ sudo port install eigen3
$ sudo port install qt5
$ export PATH=/opt/local/libexec/qt5/bin:$PATH
$ git clone https://github.com/MRtrix3/mrtrix3.git
$ 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

Cheers,
Mike

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???

Sorry

Mike

Hi Mike,

Go into the mrtrix3 directory
cd mrtrix3
and use

instead of

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

Cheers,
Max

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:

Cheers,
Thijs