Skip to content

Install

Mathieu Fourment edited this page Sep 21, 2016 · 2 revisions

physher supports vectorisation (SSE) and multithreading (Pthreads and OpenMP) depending on the computer and compiler. For bootstrapping, discrete and local clock algorithms it is strongly advised to use one of the 2 threaded versions. SSE and Pthreads are enabled by default in the CMake file.

Compile source code

Source

Download the latest release: Source code

or clone the repository:

git clone https://github.com/4ment/physher.git

Requirements

  • C compiler: only GCC and Clang are supported
  • CMake

Optional

  • OpenMP library: for multithreading or
  • Pthreads library: for multithreading.

As far as I know GCC supports OpenMP since version 4.4. The current version of LLVM/clang does not support OpenMP but a newer version can be downloaded (see below).

Note for Mac users

There are at least 3 ways to get a compiler on a Mac:

  • GCC is usually installed with Xcode. Unfortunately, the default compiler, LLVM (clang) compiler version 5.0 does not support OpenMP. However, with this compiler one can compile a newer version of GCC or clang that supports OpenMP but other libraries need to be compiled before compiling it.

  • Package managers like HomeBrew and MacPorts can be used to install GCC and probably other compilers.

  • Download a precompiled compiler from a website like HPC Mac OSX. That's probably the easiest way.

Installation

Once CMake and a compiler are installed, download the source code

  • Linux and Mac users:
tar -zxvf physher-src.tar.gz
cd physher-src
mkdir Release
cd Release
cmake ..
make -j5
sudo make install

The last step is optional. It simply installs physher, simultron, bootstrap... in /usr/local/bin

cmake can take arguments in order to enable/disable vectorisation and parallelisation. Some computers are not able to use SSE, Pthreads, and/or OpenMP

To use SSE and Pthreads together (DEFAULT and RECOMMENDED)

cmake -DUSE_PTHREAD_SUPPORT=1 -DUSE_SSE_SUPPORT=1 ..

To use SSE and OpenMP together (MIGHT NOT WORK ON MAC)

cmake -DUSE_OPENMP_SUPPORT=1 -DUSE_SSE_SUPPORT=1 -DUSE_PTHREAD_SUPPORT=0 ..

To use a different compiler use something like

cmake -DCMAKE_C_COMPILER=gcc4.8 ..

IMPORTANT NOTE: physher is written in C and for some reason cmake can complain about not finding OpenMP even though it is present. Before giving up on OpenMP uncomment ENABLE_LANGUAGE(CXX) in the CMakeLists.txt file.

Alternatively there are makefiles in the source directory. The following snippet will compile physher with SSE enabled and binaries will be installed in the bin directory:

tar -zxvf physher-src.tar.gz
cd physher-src
make -f makefile.sse
  • Windows users:

I have not tried to compile on Windows but it should be doable with Cygwin.

Clone this wiki locally