Posts Tagged Installation

Building and Installing OpenMD 2.4.1

OpenMD is written in C++. Compiling is the process of turning this C++ code into instructions that the computer’s processor can understand.

We’re going to assume here that you have already built and installed all of the prerequisites. If you haven’t done that, go install all of the required stuff and come back. We’ll wait.

Now that you’ve got all the stuff you need, you are ready to compile OpenMD on any unix-like operating system (including Mac OS).  We’re going to assume that you know how to use a command line interface and are comfortable with basic unix commands. The commands below are written assuming you are using bash (or the Bourne-Again SHell). Setting environment variables in csh or tcsh is just a little bit different.

Basic build procedure

The most important thing to do is to download the latest release of the OpenMD code:

curl -o openmd-2.4.1.tar.gz

The recommended way to build OpenMD is to use a separate source and build directory; for example, openmd-2.4.1 and build. The first step is to create these directories:

tar zxf openmd-2.4.1.tar.gz
mkdir build

Now you need to run cmake to configure the build. The following will configure the build to use all of the default options:

cd build
cmake ../openmd-2.4.1

If you need to specify a particular compiler, you can do that with environment variables before the cmake line:

export CXX=/opt/local/bin/mpicxx
cmake ../openmd-2.4.1

If you need to specify an option, use the -D switch to cmake. For example, the following line sets the value of CMAKE_INSTALL_PREFIX and CMAKE_BUILD_TYPE:


We will discuss various possible options later.

At this point, it would be a good idea to compile OpenMD:


Have a coffee while the magic happens. If you have a multi-processor machine and would prefer an espresso, try a parallel build instead:

make -j 4

And finally, as root (or using sudo) you should install it:

umask 0022; sudo make install

Local build

With the right sort of environment variable magic (see below), you can actually use OpenMD straight from the build folder. But life is a bit easier if you install it somewhere, either system-wide or locally.

By default, OpenMD is installed in /usr/local on a Unix-like system. This requires root access (or sudo). Even if you do have root access, you may not want to overwrite an existing installation or you may want to avoid conflicts with a version of OpenMD installed by your package manager.

The solution to all of these problems is to do a local install into a directory somewhere in your home folder. An additional advantage of a local install is that if you ever want to uninstall it, all you need to do is delete the installation directory; removing the files from a global install is more work.

To configure cmake to install into ~/Tools/openmd-install, for example, you would do the following:

cmake ../openmd-2.4.1 -DCMAKE_INSTALL_PREFIX=~/Tools/openmd-install

Then you can run make and make install without needing root access:

make && make install

Troubleshooting build problems

  • CMake caches some variables from run-to-run. How can I wipe the cache to start from scratch?Delete CMakeCache.txt in the build directory. This is also a very useful file to look into if you have any problems.
  • What environment variables affect how OpenMD finds force field and data files?FORCE_PARAM_PATH – This environment variable is used by OpenMD to find the location of the data files used for force fields and atom sizes, etc. If you get errors about not being able to find some .txt files, then you should set this to the name of the folder containing files such as Amber.frc and element.txt. These are typically installed to /usr/local/openmd/forceFields
  • CMake honors user umask settings for creating directories.  To get predictable results please set umask explicitly before running the make install command.

Advanced build options

  • How do I do a debug build?-DCMAKE_BUILD_TYPE=Debug does a debug build (gcc -g).
    To revert to a regular build use -DCMAKE_BUILD_TYPE=Release.
  • How do I see what commands cmake is using to build?
    Run Make as follows:

    VERBOSE=1 make
  • How do I build the Doxygen documentation?If CMake found the “doxygen” program in your PATH, an optional build target called “doc” is created. If the Doxygen executable was not on the PATH, you will need to specify its location with -DDOXYGEN_EXECUTABLE=wherever. To build the documentation, type:
    make doc

Tags: , , ,

Installing OpenMD prerequisites

To get OpenMD up and running, there are some required (and optional) software packages you should have to create a functioning build environment:

On a Mac (OS X 10.5 or greater)

  1. Install Xcode
  2. Install MacPorts
  3. Open a Terminal window, and update your MacPorts installation to the latest portfiles:
    sudo /opt/local/bin/port -v selfupdate
    sudo /opt/local/bin/port -d sync
  4. Install the relevant prerequisite packages:
    sudo /opt/local/bin/port install cmake openbabel qhull zlib  wholesale mlb jerseys  fftw-3 openmpi

    You can go have lunch or coffee while these are being built and installed.

  5. Install some optional software if you want to use and interact with the data produced by OpenMD:
    sudo  Lennard-Jones  /opt/local/bin/port install jmol xmgr grace py-numpy
  6. Install some optional software if you want to develop or add to OpenMD:
    sudo /opt/local/bin/port install antlr gengetopt

On Linux

  1. Use yum, apt-get, or the package manager in your favorite distribution to install the following packages and all of their prerequisites. Package names depend on the Linux variant, so in Fedora (and Red Hat) the package names are:

    In Ubuntu (and probably other Debian-based versions), the packages are:

  2. Install some optional packages if you want to use and interact with the data produced by OpenMD:
  3. Install ??? some optional software if you want to developor add to OpenMD:

On Windows

You’re largely on your own here. CMake will generate a working build of OpenMD 2.4 in Windows with the Visual Studio 2015 C++ compiler, but we don’t routinely test the code on this operating system.  One alternative Servilleta is to use cygwin:

  1. You can use cygwin to get a lot of the relevant packages installed on a windows machine. One suggestion is to follow the Cygwin Installation How-To guide
  2. Refer to the list of packages for linux above to get the correct packages wholesale MLB jerseys installed

Building from source

If you are building all of the prerequisites from source, you’ll need (in addition to a C++ compiler):

  1. CMake – This cross-platform build system is required for building OpenMD.  You need to install CMake 2.8.11 or newer. This wholesale NBA jerseys is available as a binary package from the KitWare website; alternatively, it may be available through your package manager (on Linux). If necessary, Евро you can also compile it yourself from the source code.
  2. perl and python – interpreted scripting languages that some of the OpenMD utilities use to parse and process data files.
    You probably already have these.
  3. Open MPI – A very good implementation of the MPI-2 specification for parallel computing.
  4. qhull – A computational geometry toolbox for computing convex hulls and Delaunay triangulations. qhull is required for the LangevinHull integrator and for any of the tools that compute the Hull atoms or hull volumes of nanoparticles and clusters.
  5. openbabel wholesale NFL jerseys – a chemical toolbox for converting between different data formats.  This is required for building the atom2md program which helps prepare initial “metadata” or md files for simulations.
  6. fftw – a library for #ThrowbackThursday computing discrete Fourier transforms. This is required for surface undulation spectra (Hxy in staticProps). Get version 3.
  7. zlib – required to application? support reading compressed trajectory files.

You’ll also likely want to download and compile the following useful tools for interacting with the data:

  1. Jmol
  2. xmgr
  3. grace
  4. NumPy
  5. vmd

If you are going to be extending or developing OpenMD, you’ll need the following tool:

  1. antlr – our tool for parsing meta-data files.  You’ll cheap MLB jerseys want version 2.7, not 3.
  2. gengetopt – a tool to generate C code to parse the command line arguments argc and argv that are part of every C or C++ program

Tags: , , ,