Installing Amber on macOS
Amber supports Apple's macOS. The instructions below are for installing Amber's
prerequisites natively, i.e., without using a package management system. These
systems (such as HomeBrew or MacPorts) can simplify the installation of the
prerequisites but must be installed themselves.
Install XCode: Xcode contains Apple's development tools.
To check whether you have it, run the following command in a terminal:
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 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 type "agree"
when prompted. After this, you need to install the command-line tools.
Running the following command in the terminal installs the command-line tools:
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 to this if you wish to use the xleap
program, which many users do no need.
Install gfortran: You will need a Fortran compiler.
Apple doesn't supply one, but
to check whether you have gfortran, run the following command in a terminal:
If you do not get a response containing the word "version" then install gfortran.
Get it for your macOS version
Note: gfortran 11.2.0 was used to beta test Amber 22, but using
gfortran-12 from HomeBrew (see below) also seems to work.
Update for OSX 13 (Ventura): So far, there are not any Ventura
compilers at the site above for Intel CPUs. Try using
HomeBrew to install the GNU compilers with
the command "brew install gcc". Also be sure that your XCode
distribution is up-to-date (.e.g. at Version 14.2 as of December, 2022.)
Install cmake: Amber now builds with the cmake program, which
you can get from
cmake.org/download/. You will
need to put this program in your PATH as well:
To check whether you have it installed and in your PATH,
run the following command in a terminal:
You should get a response containing the word "version".
Install Amber: Now you are ready to proceed with the installation
instructions in the Amber manual. Briefly, go to the
amber22_src/build folder, and edit and run the run_cmake
script. 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 .