Build process failure - RuntimeError: command line tools failure


#1

Hello all,

I am new to installing MRtrix3 and I followed the instructions on this page here (https://mrtrix.readthedocs.io/en/latest/installation/mac_install.html). I used homebrew to install everything (running 10.11 El Capitan) . However, I’m getting the below error. I cannot figure out a way past this as I have Xcode installed (also tried it with xcode command lines tools installed but got the same error) so I’m not sure why it’s failing. Any ideas to resolve this error would be greatly appreciated.

NT-MBP:~ NT$ brew instal mrtrix3

==> **Installing mrtrix3 from mrtrix3/mrtrix3**

==> **Cloning https://github.com/MRtrix3/mrtrix3.git**

Updating /Users/NT/Library/Caches/Homebrew/mrtrix3--git

==> **Checking out branch master**

Already on 'master'

Your branch is up to date with 'origin/master'.

HEAD is now at d2cd716 Merge pull request #1451 from MRtrix3/amp2response_speedup_bugfix_to_master

Entering 'testing/data'

/Users/NT/Library/Caches/Homebrew/mrtrix3--git/testing/data

PATH:

/usr/local/Homebrew/Library/Homebrew/shims/mac/super:/usr/local/opt/gdbm/bin:/usr/local/opt/openssl/bin:/usr/local/opt/sqlite/bin:/usr/local/opt/xz/bin:/usr/local/opt/python/bin:/usr/local/opt/gcc/bin:/usr/local/opt/fftw/bin:/usr/local/opt/jpeg/bin:/usr/local/opt/libtiff/bin:/usr/local/opt/pkg-config/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/opt/qt5/bin

xcodebuild failed with the error message:

xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance

If the command line tools were installed before Xcode, you can fix this with:

sudo xcode-select -s /Applications/Xcode.app/Contents/Developer

/usr/local/Homebrew/Library/Homebrew/utils/fork.rb:49:in `write': Broken pipe (Errno::EPIPE)

from /usr/local/Homebrew/Library/Homebrew/utils/fork.rb:49:in `puts'

from /usr/local/Homebrew/Library/Homebrew/utils/fork.rb:49:in `rescue in block (3 levels) in safe_fork'

from /usr/local/Homebrew/Library/Homebrew/utils/fork.rb:31:in `block (3 levels) in safe_fork'

from /usr/local/Homebrew/Library/Homebrew/utils/fork.rb:30:in `fork'

from /usr/local/Homebrew/Library/Homebrew/utils/fork.rb:30:in `block (2 levels) in safe_fork'

from /usr/local/Homebrew/Library/Homebrew/utils/fork.rb:27:in `open'

from /usr/local/Homebrew/Library/Homebrew/utils/fork.rb:27:in `block in safe_fork'

from /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.7/lib/ruby/2.3.0/tmpdir.rb:89:in `mktmpdir'

from /usr/local/Homebrew/Library/Homebrew/utils/fork.rb:26:in `safe_fork'

from /usr/local/Homebrew/Library/Homebrew/formula_installer.rb:719:in `build'

from /usr/local/Homebrew/Library/Homebrew/formula_installer.rb:311:in `install'

from /usr/local/Homebrew/Library/Homebrew/cmd/install.rb:321:in `install_formula'

from /usr/local/Homebrew/Library/Homebrew/cmd/install.rb:253:in `block in install'

from /usr/local/Homebrew/Library/Homebrew/cmd/install.rb:251:in `each'

from /usr/local/Homebrew/Library/Homebrew/cmd/install.rb:251:in `install'

from /usr/local/Homebrew/Library/Homebrew/brew.rb:89:in `<main>'

Error: An exception occured within a build process:

RuntimeError: command line tools failure

#2

The problem (and potential solution) seems to be embedded in your error log:

Have you tried running the command suggested here?


#3

Yes, thank you. The embedded command worked. I also ran sudo xcodebuild -license accept along with the above mentioned command and was able to install it successfully.