<commit_before>.. _install:

Install
=======

Requirements
------------

To compile RMPCDMD, the following software is required

  - A Fortran 2003 compiler (e.g. `gfortran <https://gcc.gnu.org/wiki/GFortran>`_ ≥ 4.7 with
    support for `OpenMP <https://gcc.gnu.org/wiki/openmp>`_ ≥ 3.1)
  - A Fortran enabled `HDF5 <https://www.hdfgroup.org/HDF5/>`_ installation
  - `CMake <http://cmake.org/>`_
  - `GNU Make <https://www.gnu.org/software/make/>`_
  - `git <http://git-scm.com/>`_

Other utilities, mostly Fortran code, will be downloaded automatically as part of the
installation process.

RMPCDMD has been developed on Linux, using both the GFortran and Intel Fortran
compilers. Compilation under OS X has been successfully achieved by users of RMPCMD. The
Windows platform is currently not tested.

If you encounter a configuration issue, it is often useful to remove all CMake data by
executing::

    rm -r CMake*

in the build directory (*not in the source directory*).

Installation on Linux
---------------------

On a Debian distribution (or derivative, e.g. Ubuntu), as root::

    apt-get install gfortran libhdf5 cmake git

will install the dependencies. (See `install_hdf5`_ for Ubuntu 14.04 or problematic HDF5
installs).

At the command line, execute the following::

    git clone https://github.com/pdebuyl-lab/RMPCDMD
    cd RMPCDMD
    git submodule init
    git submodule update
    mkdir build
    cd build
    cmake ..
    make VERBOSE=1

This will first fetch RMPCDMD, then the related modules `ParseText`, `fortran_tester`,
`fortran_h5md` and `random_module`. The compilation is prepared by the ``cmake`` command and
executed by the ``make`` command.

If your HDF5 installation is properly setup, CMake should find it automatically. If this is
not the case, you may define the environment variable ``HDF5_ROOT=/path/to/hdf5`` before
invoking cmake (see the OS X installation notes for an example).

Installation on OS X
--------------------

The first step is to install a development environment, and thus the
`XCode <https://developer.apple.com/xcode/>`_ software from Apple.

We have tested the build by relying on `MacPorts <https://www.macports.org/>`_ for gcc, git,
cmake and make. Install MacPorts and then the dependencies::

    sudo port install gcc-5 cmake git

The rest is similar to Linux except that the name of the compiler has to be specified
manuall at the command-line to prevent the automatic selection of Apple's provided
compiler. Also, HDF5 is built locally::
<commit_msg>specify xcode version, fix typos, minor edit<commit_after>.. _install:

Install
=======

Requirements
------------

To compile RMPCDMD, the following software is required

  - A Fortran 2003 compiler (e.g. `gfortran <https://gcc.gnu.org/wiki/GFortran>`_ ≥ 4.7 with
    support for `OpenMP <https://gcc.gnu.org/wiki/openmp>`_ ≥ 3.1)
  - A Fortran enabled `HDF5 <https://www.hdfgroup.org/HDF5/>`_ installation
  - `CMake <http://cmake.org/>`_
  - `GNU Make <https://www.gnu.org/software/make/>`_
  - `git <http://git-scm.com/>`_

Other utilities, mostly Fortran code, will be downloaded automatically as part of the
installation process.

RMPCDMD has been developed on Linux, using both the GFortran and Intel Fortran
compilers. Compilation under OS X has been successfully achieved by users of RMPCMD. The
Windows platform is currently not tested.

If you encounter a configuration issue, it is often useful to remove all CMake data by
executing::

    rm -r CMake*

in the build directory (*not in the source directory*).

Installation on Linux
---------------------

On a Debian distribution (or derivative, e.g. Ubuntu), as root::

    apt-get install gfortran libhdf5 cmake git

will install the dependencies. (See `install_hdf5`_ for Ubuntu 14.04 or problematic HDF5
installs).

At the command line, execute the following::

    git clone https://github.com/pdebuyl-lab/RMPCDMD
    cd RMPCDMD
    git submodule init
    git submodule update
    mkdir build
    cd build
    cmake ..
    make VERBOSE=1

This will first fetch RMPCDMD, then the related modules `ParseText`, `fortran_tester`,
`fortran_h5md` and `random_module`. The compilation is prepared by the ``cmake`` command and
executed by the ``make`` command.

If your HDF5 installation is properly setup, CMake should find it automatically. If this is
not the case, you may define the environment variable ``HDF5_ROOT=/path/to/hdf5`` before
invoking cmake (see the OS X installation notes for an example).

Installation on OS X
--------------------

The first step is to install a development environment, and thus the `XCode
<https://developer.apple.com/xcode/>`_ software from Apple (we have tested RMPCDMD with
XCode 7.3.1 on OS X El Capitan).

We used `MacPorts <https://www.macports.org/>`_ for gcc, git, cmake and make. Install
MacPorts (a GUI installer is available at https://www.macports.org/install.php) and then
the dependencies::

    sudo port install gcc-5 cmake git

The rest is similar to Linux except that the name of the compiler has to be specified
manually at the command-line to prevent the automatic selection of Apple's provided
compiler. Also, HDF5 is built locally::

{'fraction_non_alphanumeric': 0.10338164251207729, 'fraction_numerical': 0.009855072463768115, 'mean_word_length': 3.5483304042179262, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, 'https://': 15, 'lorem ipsum': 0, 'www.': 7, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '755058', 'n_tokens_mistral': 1595, 'n_tokens_neox': 1510, 'n_words': 667}