| 67 |
|
Basic build procedure |
| 68 |
|
|
| 69 |
|
The recommended way to build OpenMD is to use a separate source and |
| 70 |
< |
build directory; for example, openmd-2.0 and build. The first step |
| 70 |
> |
build directory; for example, openmd-2.1 and build. The first step |
| 71 |
|
is to create these directories: |
| 72 |
|
|
| 73 |
< |
$ tar zxf openmd-2.0.tar.gz # (this creates openmd-2.0) |
| 73 |
> |
$ tar zxf openmd-2.1.tar.gz # (this creates openmd-2.1) |
| 74 |
|
$ mkdir build |
| 75 |
|
|
| 76 |
|
Now you need to run cmake to configure the build. The following will |
| 77 |
|
configure the build to use all of the default options: |
| 78 |
|
|
| 79 |
|
$ cd build |
| 80 |
< |
$ cmake ../openmd-2.0 |
| 80 |
> |
$ cmake ../openmd-2.1 |
| 81 |
|
|
| 82 |
|
If you need to specify a particular compiler, you can do that with |
| 83 |
|
environment variables before the cmake line |
| 84 |
|
|
| 85 |
|
$ export CC=/opt/local/lib/openmpi/bin/mpicc |
| 86 |
|
$ export CXX=/opt/local/lib/openmpi/bin/mpic++ |
| 87 |
< |
$ cmake ../openmd-2.0 |
| 87 |
> |
$ cmake ../openmd-2.1 |
| 88 |
|
|
| 89 |
|
If you need to specify an option, use the -D switch to cmake. For |
| 90 |
|
example, the following line sets the value of CMAKE_INSTALL_PREFIX |
| 91 |
|
and CMAKE_BUILD_TYPE: |
| 92 |
|
|
| 93 |
< |
$ cmake ../openmd-2.0 -DCMAKE_INSTALL_PREFIX=~/Tools -DCMAKE_BUILD_TYPE=DEBUG |
| 93 |
> |
$ cmake ../openmd-2.1 -DCMAKE_INSTALL_PREFIX=~/Tools -DCMAKE_BUILD_TYPE=DEBUG |
| 94 |
|
|
| 95 |
|
We will discuss various possible options later. |
| 96 |
|
|
| 130 |
|
To configure cmake to install into ~/Tools/openmd-install, for |
| 131 |
|
example, you would do the following: |
| 132 |
|
|
| 133 |
< |
$ cmake ../openmd-2.0 -DCMAKE_INSTALL_PREFIX=~/Tools/openmd-install |
| 133 |
> |
$ cmake ../openmd-2.1 -DCMAKE_INSTALL_PREFIX=~/Tools/openmd-install |
| 134 |
|
|
| 135 |
|
Then you can run make and make install without needing root access: |
| 136 |
|
|