sfof
Installation on Mac OSX

Author: Samuel Farrens

Year: 2016

Compiler

At the time of writing this the current default c/c++ compiler on OSX is clang. To install this code it is highly recommended to instead use GNU GCC. This can be installed directly from the source, or using packages like MacPorts or Homebrew.

Boost

If GCC is used then the Boost libraries also need to be built with GCC. This can be done (tested for boost v1.58.0) as follows:

  • Download the Boost source.
  • Unzip and untar the downloaded file.

>> tar -xzvf SOURCE

e.g. >> tar -xzvf boost_1_58_0.tar.gz

  • Inside the boost directory run the bootstrap.sh script specifying a path to where the libraries are to be installed as follows:

>> ./bootstrap.sh –prefix=<PATH> –with-toolset=gcc

e.g. >> ./bootstrap.sh --prefix=/home/boost --with-toolset=gcc

  • Upon completion a file called project-config.jam will be generated. Edit line 13 (using gcc ;) of this file as follows:

using gcc : <VERSION> : <PATH>g++-<VERSION> : <linker-type>darwin ;

e.g. using gcc : 4.9.0 : /usr/bin/g++-4.9.0 : <linker-type>darwin ;

  • Run the b2 script as follows:

>> ./b2 install

NOTE: From OSX 10.10 and onwards it may be necessary to add the following option:

>> ./b2 cxxflags="-stdlib=libstdc++" install

Installing fof_cluster_finder

After building the Boost libraries simply run cmake specifying the use of GCC and the path to Boost as follows:

>> cmake -DBOOST_ROOT=<PATH>

e.g. >> CC=/usr/bin/gcc-4.9.0 CXX=/usr/bin/g++-4.9.0 cmake -DBOOST_ROOT=/home/boost