Amber masthead
Filler image AmberTools24 Amber24 Manuals Tutorials Force Fields Contacts History
Filler image

Useful links:

Amber Home
Download Amber
Installation
Amber Citations
GPU Support
Updates
Mailing Lists
For Educators
File Formats
Contributors
Workshops

Installing Amber on macOS

General instructions

Amber supports Apple's macOS. Because Apple does not supply some key components, especially a Fortran compiler, we recommed using the Homebrew package manager (https://brew.sh). These instructions should(!) work for both Intel and Apple Silicon machines, running MacOS 14 or higher.

Install XCode:

XCode contains Apple's development tools. To check whether you have it, run the following command in a terminal:

xcode-select -v

If you do not get a response containing the word "version" then install XCode. You can download it from the Mac App Store (just search for "xcode"). After installing XCode, you may need to agree to the license. So run the following command in a terminal:

sudo xcodebuild -license

Then, read through the license (or type q to skip through it), and enter "agree" when prompted. The command above may emit this error:

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

First, try ignoring the error by going to the next step (if that doesn't work then we foresee web searching in your future ;-) or else contact the Amber reflector for advice). After licensing, you need to install the command-line tools. Running the following command in the terminal installs the command-line tools:

xcode-select --install

Optionally Install XQuartz:

Starting with OS X 10.8, Apple stopped including X11 with their OS. Instead, you have to get the XQuartz program. To check whether you already have it, look in the Utilities folder in Applications. You can download it here. Note: you only need to do this if you wish to use the xleap program, which many users do not need.

Install some key utilities:

Install HomeBrew following the instructions at https://brew.sh. Follow their instructions to get /opt/homebrew/bin into your PATH. Then do this:

brew install gcc@11 cmake boost gpatch open-mpi mpi4py cd /opt/homebrew/bin ln -s gpatch patch

Note: Installing gcc@11 is currently needed since a few pieces of AmberTools fail when compiled with version 14. You should inspect your homebrew/bin folder to make sure that gfortran is a symbolic link to gfortran-11. You may need to reset that link after compiling Amber if you want more recent gfortran versions for other codes.

Install Amber:

Now you are ready to proceed with the installation instructions in the Amber manual. Briefly, un-tar your source tar.bz2 file(s), then:

cd amber24_src ./update_amber --update cd build

Now edit and run the run_cmake script. A suggested revision to run_cmake is here:

# For macOS: if [ -x /opt/homebrew/bin/cmake ]; then cmake=/opt/homebrew/bin/cmake else cmake=cmake fi $cmake $AMBER_PREFIX/amber24_src \ -DCMAKE_INSTALL_PREFIX=$AMBER_PREFIX/amber24_install \ -DCOMPILER=CLANG -DBLA_VENDOR=Apple \ -DDISABLE_TOOLS="moft" \ -DMPI=FALSE -DCUDA=FALSE -DINSTALL_TESTS=TRUE \ -DDOWNLOAD_MINICONDA=TRUE \ -DTRUST_SYSTEM_LIBS=TRUE \ 2>&1 | tee cmake.log

After correcting any errors that might arise from the run_cmake step:

make install

Run the test suite:

You can follow this by going to the installation directory chosen in the run_cmake script, sourcing the amber.sh script, and typing make test.serial. There may be a few errors that all look innocuous. The test suite may claim that pysander is not working, but check this yourself: for me (DAC) using python to import sander worked fine in spite of the warning in the test suite .

If you set -DMPI=TRUE in your cmake script, you can test this way:

export DO_PARALLEL='mpirun -np 4' make test.parallel

"How's that for maxed out?"

Last modified: Feb 13, 2025