Friday, February 21, 2014

Compiling MTR on Mavericks

MTR is a really cool tool for viewing where in a series of network hops you might be having problems. Here is how you can get it on OS X.

mkdir ~/src
cd ~/src

curl -OL http://ftpmirror.gnu.org/autoconf/autoconf-latest.tar.gz
tar xf autoconf-latest.tar.gz
cd autoconf-2.69
./configure --prefix=/usr/local

NOTE: you may get a pop-up at this point asking you to 'Get Xcode' or 'Install'. Clicking the Install button will download from Apple the software you need to compile source from the command line without waiting for all of Xcode. Once the installation is complete run configure again.
make
sudo make install
cd ..

curl -OL http://ftpmirror.gnu.org/automake/automake-1.14.1.tar.xz
tar xf automake-1.14.1.tar.xz
cd automake-1.14.1
./configure --prefix=/usr/local
make
sudo make install
cd ..

git clone https://github.com/traviscross/mtr.git
cd mtr
./bootstrap.sh
./configure --without-gtk
make
sudo make install



EDIT 2014-04-29: removed z from tar options. Fixed directory name for automake. Added note for Xcode pop-up.

5 comments:

  1. $ tar xzf automake-1.14.1.tar.xz

    gzip: stdin: not in gzip format
    tar: Child returned status 1
    tar: Error is not recoverable: exiting now


    worked fine up until that point.

    ReplyDelete
    Replies
    1. I think you have gotten a bad file.

      I just tried it on a freshly internet recovered MacBook Air thinking that I might have had something extra from 'The Unarchiver', 7zip, or some other third-party tool that gave me support for a different compression algorithm but the process above worked fine after the first configure prompted me to install Xcode or the cli tools.

      Then I looked in the man page and found this for '-z':

      "In extract or list modes, this option is ignored."

      tar xf automake-1.14.1.tar.xz

      also worked as expected.

      Delete
  2. Thanks for instructions.

    Just to let you know, that for now there is no autoconf-latest.tar.gz file, but if you point directly to autoconf-2.69.tar.gz it works without problem.

    Regards
    zgibek

    ReplyDelete
  3. Ryan - you are my hero tonight! Thank you so much for this excellently written walkthrough. It works perfectly on OS X 10.9.4 / Xcode 5.1.1 compiling MTR version 0.85+git

    Thanks again,
    Israel Torres

    ReplyDelete
  4. how do you run an mtr after you've compiled?

    ReplyDelete