Installing AmberTools17 (amber16) on Mac OS X 10.13.3 using MacPorts

This will be a quick and unpolished walkthrough of how you get a version of AmberTools17 and in the same manner Amber16 (if you have a licence) installed using the package manager MacPorts. I will supply a walkthrough using Homebrew at a later point in time and try to polish this post up to a more thorough appealing guide, maybe including pictures.

I switched computer at work a little while ago just running on routine I installed MacPorts as the package manager and started to fill the blanks. During this process though, I kept coming back to the fact that I found a lot of information comparing MacPorts and Homebrew where there is either a small amount of “true believers” or a growing majority of users that recommends Homebrew over MacPorts for various resons. I will not get into the details here though I will make an effort of presenting the details regarding my experience of switching package manager.

As stated in the heading, I am using a relatively new Mac running 10.13.3 at work, though the process should be the same for most OS X versions. I have semi-confirmed this by repeating the process on a 2009 year model MacBook Pro running 10.11 as well.

You have to be an administrator/have administrative rights on the computer you are attempting to install amber on, regardless of which method you choose later on since both MacPorts and Homebrew both requires an administrator password at some point during the installation process.

To install using MacPorts, do the following

  1. Install Xcode from AppStore
  2. Open a new terminal session (cmd+space, write and search for terminal and open the Terminal.app) and run the following commands to install additional components and approve the license agreement.
    xcode-select --install
    xcodebuild -license
  3. Launch Xcode and install any updates
  4. Go to MacPorts hemsida, download and install according to instructions
  5. Go to XQuartz hemsida in order to download and install XQuartz (the replacement for Apples X11 that is no longer available)
  6. Start a new terminal session
  7. Run the following commands
    sudo port selfupdate
    sudo port upgrade outdated
    sudo port install gcc6
    sudo port install mpich-gcc6
    sudo port select --set gcc mp-gcc6
    sudo port select --set mpi mpich-gcc6-fortran
    exit
  8. Register and download AmberTools/Amber from the download site
  9. You’ll receive a file/archive with a name similar to AmberToolsXX.tar.bz2, find this in Finder (likely in your downloads folder), don’t forget to replace XX to the numbers your file actually has. Place this file/archive in a folder where you have read/write permission and where you want to install the package. I will create a folder in my “Home” folder that is called “Software” where I will install AmberTools so this is where I’ll place my downloaded archive file. You can do this in finder using your keyboard and mouse or in the Terminal.app running commands similar to this:
    mkdir ~/Software/
    mv ~/Downloads/AmberToolsXX.tar.bz2 ~/Software/
    cd ~/Software/
  10. If you know how to use the terminal, just “cd” into the directory with the archive file, alternatively if you used the keyboard and mouse/trackpad combo, open a new terminal session, type “cd ” at the $ prompt, don’t forget to ad a trailing space and then “drag-and-drop” the folder icon containing the archive in “Finder”, drag it to the Terminal window and drop it there. This should print out the path to that folder so then just press “enter”/”return” on your keyboard.
  11. When placed in the correct directory in the terminal, run this command
    tar xvf AmberToolsXX.tar.bz2
    to extract the archive.
  12. Then run this command
    export AMBERHOME=~/Software/amberXX/
    (again, replace XX to the correct numbers)
  13. Then run this command to place yourself in the correct subdirectory
    cd $AMBERHOME
  14. and run this command
    ./configure -macAccelerate gnu
    Then compile the serial version first
    make install
  15. Once this process has finished, you’ll be presented with some info and be prompted to perform some actions. This can be performed as following, open a new terminal window (do not close the install terminal yet!) and do the following
    vi ~/.profile
    Press “i” on your keyboard to activate “edit” mode, in the “install terminal” highlight and copy the line reading something similar to below and paste this in the “.profile” terminal in a new line
    test -f ~/Software/amberXX//amber.sh && source ~/Software/amberXX//amber.sh
    Press the “esc” key, hold down “shift” and press the “z” key twice (shift+z+z) to save and exit the editor. In both terminals, type
    exit
  16. Close both terminal windows, quit out of Terminal.app and then start a brand new terminal session. Then runt the following
    cd $AMBERHOME
    make test
  17. If the tests looks OK you now have a working serial installation of Amber/AmberTools. What remains is the parallell version, if inclined then run the following
    cd $AMBERHOME
    ./configure -macAccelerate -mpi gnu
    make install
    export DO_PARALLEL='mpirun -np 2'
    make test.parallel
    export DO-PARALLEL='mpirun -np 4'
    make test.parallel
  18. If the tests work and no large issues are encountered the complete installation is now finished.

This post looks kind of awful, I’ll try to work in some CSS modifications at some point in time.

Leave a Reply

Your email address will not be published. Required fields are marked *