-
Notifications
You must be signed in to change notification settings - Fork 61
Build on OS X
Madness on a Mac Build MADNESS on Mac OS X
- Apple Xcode 3.2 or later
- MPI-2
- BLAS and LAPACK (vecLib included with OS X), or Eigen 3
- GNU Autotools
- autoconf 2.59 or later
- automake 1.11 or later
- Subversion
- MacPorts
- Gperftools (formally Google Perftools)
- Google Test
- Doxygen
- Open Mac App Store
- Search for and “Buy” Xcode (it is free). Xcode will automatically start downloading and install itself.
- Open Xcode
- Go to Xcode->Preferences...
- Select the Downloads and then the components tab
- Click “Install” next to “Command Line Tools”
- Check the “Check for and install updates automatically” box
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). You can download it from the Apple Developer website. The only disadvantage to this method is you must update this software manually.
- 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.
- Open the .dmg file
- Double click install package
- Follow the prompts
Add the following lines to .profile in your home directory using vi.
$ vi ~/.profile
- Xcode 4.1 for Lion, and later
export MACOSX_DEPLOYMENT_TARGET=10.7 export CC=/usr/bin/clang export CXX=/usr/bin/clang++
- Xcode 3.x, 4.0, and 4.1 for Snow Leopard
export MACOSX_DEPLOYMENT_TARGET=10.6 export CC=/usr/bin/gcc-4.2 export CXX=/usr/bin/g++-4.2
Note: You will need to restart terminal for the change to take effect.
You may choose either MPICH2 or OpenMPI, both will work equally well on your Mac. You do *NOT* need to install both.
Note: Older versions of Xcode included OpenMPI, but it does not work correctly with MADNESS.
Note: In the following instructions you may need to modify the paths and file names to reference the latest version.
$ cd /tmp $ mkdir mpich2 $ cd mpich2 $ mkdir build $ curl -C - -O http://www.mcs.anl.gov/research/projects/mpich2/downloads/tarballs/1.4.1p1/mpich2-1.4.1p1.tar.gz $ tar -xf ./mpich2-1.4.1p1.tar.gz $ cd build
unset F90 unset F90FLAGS
$ ../mpich2-1.4.1p1/configure \ --prefix=/opt/mpich2 \ --with-thread-package=posix \ --enable-timer-type=mach_absolute_time \ --enable-cxx \ --disable-f77 \ --disable-fc \ --with-mpe \ --with-device=ch3:nemesis \ --with-pm=hydra \ --enable-shared \ --enable-cache \ --enable-smpcoll \ --enable-base-cache $ make -j $ sudo make install
Add the following lines to your ~/.profile
export PATH="$PATH:/opt/mpich2/bin" export MANPATH="$MANPATH:/opt/mpich2/share/man" export MPICC=/opt/mpich2/bin/mpicc export MPICXX=/opt/mpich2/bin/mpicxx export MPICH_CC="$CC" export MPICH_CXX="$CXX"
$ cd /tmp $ mkdir openmpi $ cd openmpi $ mkdir build $ curl -C - -O http://www.open-mpi.org/software/ompi/v1.5/downloads/openmpi-1.5.5.tar.bz2 $ tar -xf ./openmpi-1.5.5.tar.bz2 $ cd build
$ ../openmpi-1.5.5/configure \ --prefix=/opt/openmpi \ --enable-silent-rules \ --enable-mpi-thread-multiple \ --disable-mpi-f77 \ --disable-mpi-f90 $ make -j $ sudo make install
Add the following lines to your ~/.profile file:
export PATH="$PATH:/opt/openmpi/bin" export MANPATH="$MANPATH:/opt/openmpi/share/man" export MPICC=/opt/openmpi/bin/mpicc export MPICXX=/opt/openmpi/bin/mpicxx export OMPI_CC="$CC" export OMPI_CXX="$CXX"
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:
- Download the install package from: http://www.macports.org/
- Open the downloaded .dmg file.
- Double click the install package
- Follow the prompts
- 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 google-test subversion eigen3 doxygen
- 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.
In Terminal:
$ mkdir madness $ cd madness $ svn checkout https://m-a-d-n-e-s-s.googlecode.com/svn/local/trunk src $ cd src $ aclocal $ autoconf $ autoheader $ automake $ cd ..
$ 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.
$ ../src/configure \ --enable-debugging \ --disable-optimization \ --enable-warning \ --disable-optimal \ --with-google-test=/opt/local \ CPPFLAGS="-ansi" \ LDFLAGS="-framework Accelerate -Wl,-no_pie"
$ ../src/configure \ --enable-debugging \ --disable-optimization \ --enable-warning \ --disable-optimal \ --with-google-test=/opt/local \ CPPFLAGS="-ansi" \ LDFLAGS="-framework Accelerate"
$ make -j
The following compiles have been tested with MADNESS on OS X and are known to work.
- Apple's GCC 4.2.1
- Apple's LLVM GCC 4.2.1
- Apple's Clang 2.0 (svn 2.9) and later -- Preferred
- LLVM Clang 2.9 and later (same as Apple's version)
- Intel 11.x and 12.x