Skip to content

Tips for MacOS users

Antonio Augusto Alves Junior edited this page Feb 28, 2018 · 4 revisions

Basic install (by Henry Schreiner, in 08/02/2018)

To install in a default macOS system:

  • Make sure you have XCode (Mac App Store)
  • Make sure you have the command line tools, like git and make (xcode-select --install)

Those steps are needed for any development on a mac, so unless you just bought it, you probably already have done those two things.

  • Get KitWare's CMake. You can follow the instructions there, or use brew, which is a clean, fast, and modern package manager for macOS: brew install cmake.

If you want to build and run the examples:

  • Get ROOT. There are installers provided for macOS. Source the file in /Applications/root_*/bin/thisroot.sh to set up your environment for ROOT.
  • Get TCLAP.

Optional:

  • Get TBB. brew install tbb is one good way to get it.

Now, build and install Hydra just like any Linux user. From inside your checkout of Hydra:

mkdir build
cd build
cmake ..
make

LLVM (OpenMP) install (by Henry Schreiner, in 08/02/2018)

If you want to use the OpenMP version, you'll need to have a non-Apple LLVM complier. You can get one with brew install llvm. Then, you'll need to set up your path with something like:

export PATH="/usr/local/opt/llvm/bin:$PATH"
export LDFLAGS="-L/usr/local/opt/llvm/lib -Wl,-rpath,/usr/local/opt/llvm/lib"
export CPPFLAGS="-I/usr/local/opt/llvm/include"
export C_INCLUDE_PATH="/usr/local/opt/llvm/include"
export CC="/usr/local/opt/llvm/bin/clang"
export CXX="/usr/local/opt/llvm/bin/clang++"

You can put this in a file and source it. You cannot change compilers for a specific build directory after you've run CMake, and the build takes time, so feel free to use a different build directory, such as build-llvm.