Okay I think it might be fixed. When I open .bash_profile there is only one line:
export PATH=/applications/mrtrix3/bin:/applications/mrtrix3/scripts:/Applications/mrtrix
Also, when I do cat ~/.bash_profile in terminal I get:
export PATH=/applications/mrtrix3/bin:/applications/mrtrix3/scripts:/Applications/mrtrix
Same thing - which I think is a good thing?
But with echo $PATH I get:
/Applications/mrtrix-0.2.12/bin:/applications/mrtrix3/bin:/usr/local/fsl/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin
Is this where the set_path comes in? Should it say “export” in my bash_profile?
Last thing, when I try to do set_path from instructions I still get the error:
ERROR: MRtrix3 executables not found in expected location.
This script needs to be run from within the MRtrix3 toplevel directory, AND
after the build script has successfully completed. In addition, the set_path
script should NOT be moved from its original location in the MRtrix3 toplevel
directory.
OK, there’s quite a few things that look a bit unusual here:
as Max says, there’s something odd with the path, in that some parts mention /applications, others /Applications. This is case-sensitive on MacOSX, one of these is wrong.
the last bit of the path that is being set in your ~/.bash_profile is redundant: you don’t need that last /Applications/mrtrix in there.
regardless, it looks like this file is being ignored. The path you get in the shell (with echo $PATH) clearly doesn’t include the bits you’d set in the ~/.bash_profile. Maybe this isn’t the right file to use… I’m pretty sure that set_path would get this right, we did a bit of testing to confirm at the time.
you have the set_path script in the installation, yet the executables seems to be in bin/ rather than release/bin. This can only make sense if you updated the code (git pull) without actually compiling it (./build). So I wonder if you think you have up to date code, because it doesn’t look like your actual executables haven’t been updated.
I assume that the /Applications folder is a system folder, which would require administrator privileges to make any modifications. This might prove tricky or at least annoying in the long run. I’d typically recommend installing within your own folder, or using @maxpietsch’s new homebrew recipe.
So given all of these slightly odd issues, I think the safest thing to do here is a full clear out and update to the latest version - assuming you don’t need stick to the old one. I assume the simplest thing would be just remove the /Applications/mrtrix3 folder, and then follow the instructions for installation on MacOSX. Maybe @maxpietsch can comment on this, but your current installation just doesn’t seem quite right to me…
I hate to throw something else into the mix but now that the ~/.bash_profile is changed when I open a new terminal window it says bash command not found. Any idea what went wrong or how I did this?
Once I fix this I will re-install mrtrix3 like you suggest!
open a new terminal and execute: ls
you should get a list of files but not the bash command not found error. Otherwise, execute the following (one line, make sure to copy all of it):
/bin/mv ~/.bash_history ~/.bash_history_bak; for f in ~/.bash*; do /bin/echo "$f"; ls -la "$f"; /bin/cat "$f"; echo "----"; done | /usr/bin/tee fixme.txt; /bin/mv ~/.bash_history_bak ~/.bash_history
and upload the file fixme.txt which is in your user directory here or send it to me: maximilian.pietsch@kcl.ac.uk.
Here is the output from the last command you had me do:
yoda:~ jacquiehodge$ brew install mrtrix3 -verbose
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/universal-darwin15/rbconfig.rb:213: warning: Insecure world writable dir /opt/X11/bin in PATH, mode 040777
==> Installing mrtrix3 from mrtrix3/mrtrix3
==> Cloning https://github.com/MRtrix3/mrtrix3.git
Updating /Users/jacquiehodge/Library/Caches/Homebrew/mrtrix3--git
git config remote.origin.url https://github.com/MRtrix3/mrtrix3.git
git config remote.origin.fetch +refs/heads/master:refs/remotes/origin/master
git fetch origin
==> Checking out branch master
git checkout -f master --
Already on 'master'
Your branch is up-to-date with 'origin/master'.
git reset --hard origin/master
HEAD is now at 7d55993 Merge pull request #812 from MRtrix3/fix_average_response
git submodule foreach --recursive git submodule sync
Entering 'testing/data'
git submodule update --init --recursive
==> mkdir /usr/local/Cellar/mrtrix3/0.3.15-315-g18462ac/lib
==> mkdir /usr/local/Cellar/mrtrix3/0.3.15-315-g18462ac/release
==> ln -s /usr/local/Cellar/mrtrix3/0.3.15-315-g18462ac/bin /usr/local/Cellar/mrtrix3/0.3.15-315-g18462ac/release/bin
==> mkdir /usr/local/Cellar/mrtrix3/0.3.15-315-g18462ac/matlab
==> python matlab_add.py
added mrtrix path to /Applications/MATLAB_R2010b.app/toolbox/local/startup.m
added mrtrix path to /Applications/MATLAB_R2014a.app/toolbox/local/startup.m
added mrtrix path to /Applications/MATLAB_R2015b.app/toolbox/local/startup.m
==> mkdir /usr/local/Cellar/mrtrix3/0.3.15-315-g18462ac/icons
==> git log -1
commit 7d559932f617aac078ad05d1ff2a4595e27a5723
Author: maxpietsch <maxpietsch@users.noreply.github.com>
Date: Fri Nov 4 11:43:42 2016 +0000
Merge pull request #812 from MRtrix3/fix_average_response
average_response is now python 2 and 3 compatible
MRtrix build type requested: release
Detecting OS: darwin
OS X deployment target: 10.11
Checking for C++11 compliant compiler [clang++]: 4.2.1 - tested ok
Detecting pointer size:
ERROR: unable to determine pointer size!
See the file 'configure.log' for details. If this doesn't help and you need
further assistance, please post on the MRtrix3 community forum
(http://community.mrtrix.org/), and make sure to include the full contents of
the 'configure.log' file.
no configuration file found for target build "release"!
please run "./configure" prior to invoking this script
Warning: tried to install empty array to /usr/local/Cellar/mrtrix3/0.3.15-315-g18462ac/bin
Error: unknown file type: release/lib/.
That is really weird… The fact that this line of the configure script completes OK:
Checking for C++11 compliant compiler [clang++]: 4.2.1 - tested ok
Means that the script was able to compile and run:
struct Base {
Base (int);
};
struct Derived : Base {
using Base::Base;
};
int main() {
Derived D (int); // check for contructor inheritance
return (0);
}
But fails on the next test, which involves compiling and running the following with exactly the same settings:
@Jhodge, does running it again magically work as suggested by @rsmith? If it does, I’ll have to put it down to one of these funny quirks that we’ll never get to the bottom of because we can’t reproduce the problem. If it’s consistently failing, then it’ll need some investigation…
As far as I can tell, the only difference between this test and the one before it (assuming the compiler works OK) is the casting of the return string to int(), and the only reason I can realistically think of as to why that might fail is some issue with the text encoding, which can get particularly thorny and often causes problems that I simply haven’t ever managed to understand. There are also differences in how Python v3 handles bytes vs strings, which can equally cause trouble.
So assuming running it again doesn’t fix it, and assuming this is running on an up to date MacOSX system (Yosemite, El Capitan, or Sierra), all I can suggest is to figure out whether any older versions of Python are installed on the system, e.g. by running this in the same terminal as you’re about to run the MRtrix3 install:
python --version
Anything older than v2.6 will definitely fail. As far as I know, only v2.7 onwards get tested with any regularity.
If that’s not the issue, then you could maybe looking into what character encoding your system is set to. What does the output of this look like:
@maxpietsch Hey Max before I continue with
brew update
brew uninstall python
sudo xcode-select --install
brew reinstall python
brew link python
brew install mrtrix3
Let me first tell you that when I run “brew uninstall mrtrix3” I get the following error:
Error: No such keg: /usr/local/Cellar/mrtrix3
Back to this error:
yoda:~ jacquiehodge$ brew install mrtrix3
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/universal-darwin15/rbconfig.rb:213: warning: Insecure world writable dir /opt/X11/bin in PATH, mode 040777
==> Installing mrtrix3 from mrtrix3/mrtrix3
mrtrix3: Homebrew was unable to find an installation of Qt 5. You can install it for instance via homebrew:
brew update
brew install qt5
Error: An unsatisfied requirement failed this build.
Shall I go ahead with
brew update
brew uninstall python
sudo xcode-select --install
brew reinstall python
brew link python
brew install mrtrix3
I get this error:
bash-3.2$ brew reinstall python
==> Reinstalling python
==> Installing dependencies for python: readline, sqlite, gdbm, openssl
==> Installing python dependency: readline
==> Downloading https://homebrew.bintray.com/bottles/readline-7.0.el_capitan.bot
######################################################################## 100.0%
==> Pouring readline-7.0.el_capitan.bottle.tar.gz
==> Caveats
This formula is keg-only, which means it was not symlinked into /usr/local.
macOS provides the BSD libedit library, which shadows libreadline.
In order to prevent conflicts when programs look for libreadline we are
defaulting this GNU Readline installation to keg-only.
Generally there are no consequences of this for you. If you build your
own software and it requires this formula, you’ll need to add to your
build variables:
==> Summary /usr/local/Cellar/readline/7.0: 45 files, 2M
==> Installing python dependency: sqlite
==> Downloading https://homebrew.bintray.com/bottles/sqlite-3.15.1.el_capitan.bo
######################################################################## 100.0%
==> Pouring sqlite-3.15.1.el_capitan.bottle.tar.gz
==> Caveats
This formula is keg-only, which means it was not symlinked into /usr/local.
macOS provides an older sqlite3.
Generally there are no consequences of this for you. If you build your
own software and it requires this formula, you’ll need to add to your
build variables:
==> Summary /usr/local/Cellar/sqlite/3.15.1: 11 files, 2.9M
==> Installing python dependency: gdbm
==> Downloading https://homebrew.bintray.com/bottles/gdbm-1.12.el_capitan.bottle
######################################################################## 100.0%
==> Pouring gdbm-1.12.el_capitan.bottle.tar.gz
Error: The brew link step did not complete successfully
The formula built, but is not symlinked into /usr/local
Could not symlink bin/gdbm_dump
Target /usr/local/bin/gdbm_dump
is a symlink belonging to gdbm. You can unlink it:
brew unlink gdbm
To force the link and overwrite all conflicting files:
brew link --overwrite gdbm
To list all files that would be deleted:
brew link --overwrite --dry-run gdbm
I believe I’ve fixed it. I followed these last instructions from you but also had to do:
then
sudo xcode-select --install
then
I got some warnings from this but no errors.
then in order to actually open the gui using command mrview I had to
Mrtrix3 now opens and is functional!! YAY! And the couple of updated commands and scripts I’ve tested also work!