Skip to content

Building the prerequisites on MacOS X

Vedran Novakovic edited this page Sep 2, 2016 · 14 revisions

Homebrew

Homebrew can install the most of the required general-purpose development tools, e.g.,

  • autoconf
  • automake
  • libtool
  • cmake
  • ...

If some tool or library is obsolete or missing on the system, trying to get it installed by Homebrew may be the fastest option.

Be aware that, for proper functioning, brew tool may require setting the correct proxies in your shell (Terminal), via http_proxy and https_proxy variables. Please consult man brew for more information.

GCC

To install GNU C, C++, and Fortran compilers and libraries, Homebrew may be used:

brew install gcc

Alternatively, see Installing GCC page how to install GCC from the source distribution. I have used the latest development sources from the SVN (trunk) to successfully bootstrap the compilers. In essence, the procedure is to:

  1. Checkout the SVN sources.
  2. Download the missing prerequisites (if not already installed on the system), by invoking ./contrib/download_prerequisites from the top-level directory of a working copy created in step 1.
  3. Configure the build. To avoid any clashes with the system's gcc driver, or with a possible Homebrew GCC installation, etc., saying ./configure --prefix=$GCC_HOME, where GCC_HOME is set to a sub-directory of the user's $HOME, may be a reasonable choice.
  4. Say make bootstrap and then make install-strip.
  5. Be sure to prepend $GCC_HOME/bin to PATH, $GCC_HOME/lib to DYLD_LIBRARY_PATH, and (optionally) $GCC_HOME/share/man to MANPATH, in order to use the newly built compilers, instead of those already present on the system.

CUDA

Downloading and installing CUDA Toolkit should be straightforward. Afterwards:

  1. Please make sure that you export a variable CUDADIR with the contents /Developer/NVIDIA/CUDA-X.Y, where X=8 and Y=0 in the case of 8.0 (Release Candidate), or X=7 and Y=5 in the case of 7.5 (Release) CUDA versions.
  2. With such a definition, add $CUDADIR/bin to PATH, $CUDADIR/lib to DYLD_LIBRARY_PATH, and (optionally) $CUDADIR/doc/man to MANPATH.

TBD