Skip to content
Justus Calvin edited this page Jul 29, 2014 · 6 revisions

Madness on a Mac Build MADNESS on Mac OS X

Table of Contents

Software

Required

  • Apple Xcode 3.2 or later
  • MPI-2
  • BLAS and LAPACK (Accelerate included with OS X)
  • GNU Autotools
    • autoconf 2.59 or later
    • automake 1.11 or later
  • git

Recommended

  • Package management software
    • MacPorts
    • Homebrew

Optional

  • Eigen 3
  • libxc
  • MADxc
  • TBB
  • Elemental
  • Gperftools (not recommended)
  • Google Test
  • Doxygen
  • pkg-config
If you have all of the above software installed, you can skip ahead to the “MADNESS installation” section.

Installing Xcode

Mavericks and later

  1. Open Mac App Store
  2. Search for and “Buy” Xcode (it is free). Wait for Xcode to finish the download and installation.
  3. In Terminal run:
$ xcode-select --install

Lion and Mountain Lion

  1. Open Mac App Store
  2. Search for and “Buy” Xcode (it is free). Xcode will automatically start downloading and install itself.
  3. Open Xcode
  4. Go to Xcode->Preferences...
  5. Select the Downloads and then the components tab
  6. Click “Install” next to “Command Line Tools”
  7. Check the “Check for and install updates automatically” box
Note: Command-line tools are automatically installed with Xcode 4.2.x and earlier.

Xcode Alternative for Lion and later

If you do not want to install Xcode, you may install just Apple's Command-Line Tools package (the same package you would install in Xcode 4.3.x or later). You can download it from the Apple Developer website. The only disadvantage to this method is that you must update this software manually.

Snow Leopard and earlier

  1. Download Xcode 3.2.6 for Snow Leopard or 3.1.4 for Leopard from Apple’s Developer website. You will need to log in with your Apple ID.
  2. Open the .dmg file
  3. Double click install package
  4. Follow the prompts

MacPorts

MacPorts is a command-line tool that automates the process of downloading, configuring, installing, and updating open-source software in OS X. Most of the software required by MADNESS is available through MacPorts. To install MacPorts:

  1. Download the install package from: http://www.macports.org/
  2. Open the downloaded .dmg file.
  3. Double click the install package
  4. Follow the prompts
  5. Once MacPorts is installed, in terminal run:
$ sudo port selfupdate

Note: If you are behind a firewall or proxy and having trouble syncing portfiles, you can use the alternate download method described here https://trac.macports.org/wiki/howto/PortTreeTarball.

You can install the remaining software need by MADNESS with MacPorts.

$ sudo port install autoconf automake libtool pkgconfig git eigen3 doxygen mpich-default
  • Note:* Older versions of Xcode included autoconf and automake, but they are very old and do not work correctly with MADNESS.
  • Note:* Gperftools 2.0 does not work correctly on OS X. If you want/need Google Perftools, 1.7 is partially functional. You will need to build it from source. Unless you intend to use the it for profiling purposes, you should not install or use Google Perftools.

MADNESS Installation

Download

In Terminal:

$ mkdir madness
$ cd madness
$ git clone https://github.com/m-a-d-n-e-s-s/madness.git src
$ cd src
$ ./autogen.sh
$ cd ..

Configure

$ mkdir build
$ cd build

The configure commands below assume that Google Perftools and Google Test were installed in /opt/local with MacPorts. You need to change the paths for `--with-google-test` to the install paths for these packages. If you did not install one or both of these packages, you need to remove the corresponding options.

Lion and later

$ ../src/configure \
--enable-debugging \
--disable-optimization \
--enable-warning \
--disable-optimal \
--with-google-test=/opt/local \
CC="/usr/bin/clang" \
CXX="/usr/bin/clang++" \
CPPFLAGS="-ansi" \
LDFLAGS="-framework Accelerate -Wl,-no_pie"

Snow Leopard and earlier

$ ../src/configure \
--enable-debugging \
--disable-optimization \
--enable-warning \
--disable-optimal \
--with-google-test=/opt/local \
CC="/usr/bin/gcc" \
CXX="/usr/bin/g++" \
CPPFLAGS="-ansi" \
LDFLAGS="-framework Accelerate"

Build

$ make -j

Information about Compiler

The following compiles have been tested with MADNESS on OS X and are known to work.

  • Apple's Clang 2.0 (svn 2.9) and later -- Preferred
  • Apple's LLVM GCC 4.2.1 -- deprecated in OS X 10.8, discontinued in OS X 10.9
  • Apple's GCC 4.2.1 -- deprecated in OS X 10.7, discontinued in OS X 10.9
  • LLVM Clang 2.9 and later (same as Apple's version)
  • Intel 11.x and later
WARNING: Do not use GNU GCC compilers that you build yourself or those provided by MacPorts. They have significant compatibility issues on Macs and may result in strange runtime behavior.
Clone this wiki locally