2.1. Installation
There are multiple ways to download RPMDrate to your computer:
- Download and compile a stable release package as a tar gzipped file directly from the Computer Physics Communications Program Library (http://cpc.cs.qub.ac.uk).
- Clone our git repository from
https://github.com/YurySuleymanov/RPMDrate_v2.0.git
and easily follow along with the bleeding-edge development as it happens.
2.2. Dependencies
RPMDrate depends on several other packages in order to provide its full functional capabilities. The following dependencies are required to compile and run RPMDrate:
- Python (version 2.6.x or later, including any version of Python 3, is recommended)
- NumPy (version 1.5.0 or later is recommended)
- FFTW (version 3.3 or later is recommended)
- A standard Fortran 90/95 compiler (e.g.
gfortran
,g95
,ifort
, etc.)
2.3. Compilation
Once you have obtained a copy of RPMDrate, either from a released package or from cloning the git repository, RPMDrate can be installed by invoking the setup.py
script as usual:
$ python setup.py install
This will compile the Fortran source and Python wrapper code, which may take some time. Note that you may need administrator privileges to install RPMDrate.
If you wish to use RPMDrate without installing, simply add the folder containing this file to your PYTHONPATH
environment variable and compile the source code in-place using the command
$ python setup.py build_ext --inplace
A Makefile that wraps these commands has been provided. The Makefile also provides a clean target for deleting all files created during compilation.
RPMDrate uses the f2py
tool (bundled with NumPy) to expose its Fortran code to Python. The default compiling option for the FFTW library (which is required to link against when building Fortran extension modules using f2py
) is “-lfftw3”. These options can be modified at the end of the setup.py
file as the libraries
options of the rpmdrate._main
Fortran extension module. The libraries are assumed to be located in the standard library search path on target systems. If you need to link with these libraries in a non-standard location, you’ll have to specify the directories to search for those libraries. The library_dirs
option is a list of directories to search for libraries at link-time, and the runtime_library_dirs
option – for shared (dynamically loaded) libraries at run-time. (More information is available at http://docs.python.org/distutils.)
2.4. Local installation of Python
Below is the procedure to install Python 2.7
to your local account. This will place Python 2.7
in $HOME/local directory
(e.g. /home/username/local). The whole procedure should not take more than 10-15 minutes.
- Install
Python 2.7
$ mkdir $HOME/local
$ wget http://python.org/ftp/python/2.7.3/Python-2.7.3.tar.bz2
$ tar -xjvf Python-2.7.3.tar.bz2
$ cd Python-2.7.3
$ ./configure --prefix=$HOME/local
$ make
$ make install
- Edit
.bash_profile
to add these lines
$ export PATH=$HOME/local/bin:$PATH
$ export LD_LIBRARY_PATH=$HOME/local/lib:$LD_LIBRARY_PATH
- Log out and in again so modified
.bash_profile
takes effect - Run
Python
once to ensure default is 2.7 3. Installsetuptools
$ wget http://pypi.python.org/packages/source/s/setuptools/setuptools-0.6c11.tar.gz
$ tar -xzvf setuptools-0.6c11.tar.gz
$ cd setuptools-0.6c11
$ python setup.py install
- Install
pip
$ wget http://pypi.python.org/packages/source/p/pip/pip-1.1.tar.gz
$ tar -xzvf pip-1.1.tar.gz
$ cd pip-1.1
$ python setup.py install
- Install
numpy
(andf2py
)
$ pip install numpy
2.4.1. Developing for RPMDrate
If you would like to follow along with the bleeding-edge development of RPMDrate, the best way to do so is to clone the repository using our version control system, git:
$ git clone git://github.com/YurySuleymanov/RPMDrate_v2.0.git
This enables you to easy update your local copy with the latest changes. If you intend to contribute to RPMDrate – and you are welcome to do so! – you should fork the project on GitHub first, and clone from your fork.
Once you have cloned the repository, follow the compilation instructions for building RPMDrate in-place. You may also wish to add the folder containing the RPMDrate repository to your PYTHONPATH
environment variable.