Bumped version to prepare for next patch release
[alexxy/gromacs.git] / docs / install-guide / index.rst
1 .. _install guide:
2
3 ******************
4 Installation guide
5 ******************
6
7 .. highlight:: bash
8
9 Introduction to building |Gromacs|
10 ==================================
11
12 These instructions pertain to building |Gromacs|
13 |version|. You might also want to check the `up-to-date installation instructions`_.
14
15 Quick and dirty installation
16 ----------------------------
17 1. Get the latest version of your C and C++ compilers.
18 2. Check that you have CMake version |GMX_CMAKE_MINIMUM_REQUIRED_VERSION| or later.
19 3. Get and unpack the latest version of the |Gromacs| tarball.
20 4. Make a separate build directory and change to it. 
21 5. Run ``cmake`` with the path to the source as an argument
22 6. Run ``make``, ``make check``, and ``make install``
23 7. Source ``GMXRC`` to get access to |Gromacs|
24
25 Or, as a sequence of commands to execute:
26
27 .. parsed-literal::
28
29     tar xfz gromacs-|version|.tar.gz
30     cd gromacs-|version|
31     mkdir build
32     cd build
33     cmake .. -DGMX_BUILD_OWN_FFTW=ON -DREGRESSIONTEST_DOWNLOAD=ON
34     make
35     make check
36     sudo make install
37     source /usr/local/gromacs/bin/GMXRC
38
39 This will download and build first the prerequisite FFT library
40 followed by |Gromacs|. If you already have FFTW installed, you can
41 remove that argument to ``cmake``. Overall, this build of |Gromacs|
42 will be correct and reasonably fast on the machine upon which
43 ``cmake`` ran. On another machine, it may not run, or may not run
44 fast. If you want to get the maximum value for your hardware with
45 |Gromacs|, you will have to read further. Sadly, the interactions of
46 hardware, libraries, and compilers are only going to continue to get
47 more complex.
48
49 Quick and dirty cluster installation
50 ------------------------------------
51
52 On a cluster where users are expected to be running across multiple
53 nodes using MPI, make one installation similar to the above, and
54 another using an MPI wrapper compiler and which is `building only
55 mdrun`_, because that is the only component of |Gromacs| that uses
56 MPI.
57
58 Typical installation
59 --------------------
60 As above, and with further details below, but you should consider
61 using the following `CMake options`_ with the
62 appropriate value instead of ``xxx`` :
63
64 * ``-DCMAKE_C_COMPILER=xxx`` equal to the name of the C99 `Compiler`_ you wish to use (or the environment variable ``CC``)
65 * ``-DCMAKE_CXX_COMPILER=xxx`` equal to the name of the C++98 `compiler`_ you wish to use (or the environment variable ``CXX``)
66 * ``-DGMX_MPI=on`` to build using `MPI support`_ (generally good to combine with `building only mdrun`_)
67 * ``-DGMX_GPU=on`` to build using nvcc to run using NVIDIA `CUDA GPU acceleration`_ or an OpenCL_ GPU
68 * ``-DGMX_USE_OPENCL=on`` to build with OpenCL_ support enabled. ``GMX_GPU`` must also be set.
69 * ``-DGMX_SIMD=xxx`` to specify the level of `SIMD support`_ of the node on which |Gromacs| will run
70 * ``-DGMX_BUILD_MDRUN_ONLY=on`` for `building only mdrun`_, e.g. for compute cluster back-end nodes
71 * ``-DGMX_DOUBLE=on`` to build |Gromacs| in double precision (slower, and not normally useful)
72 * ``-DCMAKE_PREFIX_PATH=xxx`` to add a non-standard location for CMake to `search for libraries, headers or programs`_
73 * ``-DCMAKE_INSTALL_PREFIX=xxx`` to install |Gromacs| to a `non-standard location`_ (default ``/usr/local/gromacs``)
74 * ``-DBUILD_SHARED_LIBS=off`` to turn off the building of shared libraries to help with `static linking`_
75 * ``-DGMX_FFT_LIBRARY=xxx`` to select whether to use ``fftw``, ``mkl`` or ``fftpack`` libraries for `FFT support`_
76 * ``-DCMAKE_BUILD_TYPE=Debug`` to build |Gromacs| in debug mode
77
78 Building older versions
79 -----------------------
80 Installation instructions for old |Gromacs| versions can be found at
81 the |Gromacs| `documentation page
82 <http://manual.gromacs.org/documentation>`_.
83
84 Prerequisites
85 =============
86 Platform
87 --------
88 |Gromacs| can be compiled for many operating systems and
89 architectures.  These include any distribution of Linux, Mac OS X or
90 Windows, and architectures including x86, AMD64/x86-64, several
91 PowerPC including POWER8, ARM v7, ARM v8, and SPARC VIII.
92
93 Compiler
94 --------
95
96 |Gromacs| can be compiled on any platform with ANSI C99 and C++11
97 compilers, and their respective standard C/C++ libraries. Good
98 performance on an OS and architecture requires choosing a good
99 compiler. We recommend gcc, because it is free, widely available and
100 frequently provides the best performance.
101
102 You should strive to use the most recent version of your
103 compiler. Minimum supported compiler versions are
104
105 * GNU (gcc) 4.6
106 * Intel (icc) 14
107 * LLVM (clang) 3.4
108 * Microsoft (MSVC) 2015
109
110 Other compilers may work (Cray, Pathscale, older clang) but do
111 not offer competitive performance. We recommend against PGI because
112 the performance with C++ is very bad.
113
114 You may also need the most recent version of other compiler toolchain
115 components beside the compiler itself (e.g. assembler or linker);
116 these are often shipped by your OS distribution's binutils package.
117
118 C++11 support requires adequate support in both the compiler and the
119 C++ library. The gcc and MSVC compilers include their own standard
120 libraries and require no further configuration. For configuration of
121 other compilers, read on.
122
123 On Linux, both the Intel and clang compiler use the libstdc++ which
124 comes with gcc as the default C++ library. For |Gromacs|, we require
125 the compiler to support libstc++ version 4.6.1 or higher. To select a
126 particular libstdc++ library, use:
127
128 * For Intel: ``-DGMX_STDLIB_CXX_FLAGS=-gcc-name=/path/to/gcc/binary``
129   or make sure that the correct gcc version is first in path (e.g. by
130   loading the gcc module). It can also be useful to add
131   ``-DCMAKE_CXX_LINK_FLAGS="-Wl,-rpath,/path/to/gcc/lib64
132   -L/path/to/gcc/lib64"`` to ensure linking works correctly.
133 * For clang:
134   ``-DCMAKE_CXX_FLAGS=--gcc-toolchain=/path/to/gcc/folder``. This
135   folder should contain ``include/c++``.
136
137 On Windows with the Intel compiler, the MSVC standard library is used,
138 and at least MSVC 2015 is required. Load the enviroment variables with
139 vcvarsall.bat.
140
141 To build with any compiler and clang's libcxx standard library, use
142 ``-DGMX_STDLIB_CXX_FLAGS=-stdlib=libc++
143 -DGMX_STDLIB_LIBRARIES='-lc++abi -lc++'``.
144
145 If you are running on Mac OS X, the best option is the Intel
146 compiler. Both clang and gcc will work, but they produce lower
147 performance and each have some shortcomings. clang 3.8 now offers
148 support for OpenMP, and so may provide decent performance.
149
150 For all non-x86 platforms, your best option is typically to use gcc or
151 the vendor's default or recommended compiler, and check for
152 specialized information below.
153
154 Compiling with parallelization options
155 --------------------------------------
156
157 For maximum performance you will need to examine how you will use
158 |Gromacs| and what hardware you plan to run on. Often OpenMP_
159 parallelism is an advantage for |Gromacs|, but support for this is
160 generally built into your compiler and detected automatically.
161
162 GPU support
163 ^^^^^^^^^^^
164 |Gromacs| has excellent support for NVIDIA GPUs supported via CUDA.
165 NVIDIA's CUDA_ version |REQUIRED_CUDA_VERSION| software development kit is required,
166 and the latest version is strongly encouraged. NVIDIA GPUs with at
167 least NVIDIA compute capability |REQUIRED_CUDA_COMPUTE_CAPABILITY| are
168 required, e.g. Fermi, Kepler, Maxwell or Pascal cards. You are strongly recommended to
169 get the latest CUDA version and driver supported by your hardware, but
170 beware of possible performance regressions in newer CUDA versions on
171 older hardware. Note that while some CUDA compilers (nvcc) might not
172 officially support recent versions of gcc as the back-end compiler, we
173 still recommend that you at least use a gcc version recent enough to
174 get the best SIMD support for your CPU, since |Gromacs| always runs some
175 code on the CPU. It is most reliable to use the same C++ compiler
176 version for |Gromacs| code as used as the back-end compiler for nvcc,
177 but it could be faster to mix compiler versions to suit particular
178 contexts.
179
180 To make it possible to use other accelerators, |Gromacs| also includes
181 OpenCL_ support. The minimum OpenCL version required is
182 |REQUIRED_OPENCL_MIN_VERSION|. The current version is recommended for
183 use with GCN-based AMD GPUs. It does work with NVIDIA GPUs, but using
184 the latest NVIDIA driver (which includes the NVIDIA OpenCL runtime) is
185 recommended. Additionally, there are known limitations when using
186 recent versions of the AMD APPSDK (details are found in the |Gromacs|
187 user guide). It is not possible to configure both CUDA and OpenCL
188 support in the same version of |Gromacs|.
189
190 Please note that MSVC 2015 is the earliest version of MSVC supported
191 by |Gromacs|, but that requires at least CUDA 8 for an officially
192 supported CUDA build. This will likely not occur before |Gromacs| 2016
193 is released.
194
195 .. _mpi-support:
196
197 MPI support
198 ^^^^^^^^^^^
199
200 |Gromacs| can run in parallel on multiple cores of a single
201 workstation using its built-in thread-MPI. No user action is required
202 in order to enable this.
203
204 If you wish to run in parallel on multiple machines across a network,
205 you will need to have
206
207 * an MPI library installed that supports the MPI 1.3
208   standard, and
209 * wrapper compilers that will compile code using that library.
210
211 The |Gromacs| team recommends OpenMPI_ version
212 1.6 (or higher), MPICH_ version 1.4.1 (or
213 higher), or your hardware vendor's MPI installation. The most recent
214 version of either of these is likely to be the best. More specialized
215 networks might depend on accelerations only available in the vendor's
216 library. LAM-MPI_ might work, but since it has
217 been deprecated for years, it is not supported.
218
219 CMake
220 -----
221
222 |Gromacs| builds with the CMake build system, requiring at least
223 version |GMX_CMAKE_MINIMUM_REQUIRED_VERSION|. You can check whether
224 CMake is installed, and what version it is, with ``cmake
225 --version``. If you need to install CMake, then first check whether
226 your platform's package management system provides a suitable version,
227 or visit the `CMake installation page`_ for pre-compiled binaries,
228 source code and installation instructions. The |Gromacs| team
229 recommends you install the most recent version of CMake you can.
230
231 .. _FFT support:
232
233 Fast Fourier Transform library
234 ------------------------------
235
236 Many simulations in |Gromacs| make extensive use of fast Fourier
237 transforms, and a software library to perform these is always
238 required. We recommend FFTW_ (version 3 or higher only) or Intel
239 MKL_. The choice of library can be set with ``cmake
240 -DGMX_FFT_LIBRARY=<name>``, where ``<name>`` is one of ``fftw``,
241 ``mkl``, or ``fftpack``. FFTPACK is bundled with |Gromacs| as a
242 fallback, and is acceptable if simulation performance is not a
243 priority. When choosing MKL, |Gromacs| will also use MKL for BLAS and
244 LAPACK (see `linear algebra libraries`_). Generally, there is no
245 advantage in using MKL with |Gromacs|, and FFTW is often faster.
246
247 Using FFTW
248 ^^^^^^^^^^
249 FFTW_ is likely to be available for your platform via its package
250 management system, but there can be compatibility and significant
251 performance issues associated with these packages. In particular,
252 |Gromacs| simulations are normally run in "mixed" floating-point
253 precision, which is suited for the use of single precision in
254 FFTW. The default FFTW package is normally in double
255 precision, and good compiler options to use for FFTW when linked to
256 |Gromacs| may not have been used. Accordingly, the |Gromacs| team
257 recommends either
258
259 * that you permit the |Gromacs| installation to download and
260   build FFTW from source automatically for you (use
261   ``cmake -DGMX_BUILD_OWN_FFTW=ON``), or
262 * that you build FFTW from the source code.
263
264 If you build FFTW from source yourself, get the most recent version
265 and follow the `FFTW installation guide`_. Choose the precision for
266 FFTW (i.e. single/float vs. double) to match whether you will later
267 use mixed or double precision for |Gromacs|. There is no need to
268 compile FFTW with threading or MPI support, but it does no harm. On
269 x86 hardware, compile with *both* ``--enable-sse2`` and
270 ``--enable-avx`` for FFTW-3.3.4 and earlier. From FFTW-3.3.5, you
271 should also add ``--enable-avx2`` also. On Intel chipsets supporting
272 512-wide AVX, including KNL, add ``--enable-avx512`` also. FFTW will
273 create a fat library with codelets for all different instruction sets,
274 and pick the fastest supported one at runtime. On IBM Power8, you
275 definitely want FFTW-3.3.5 and to compile it with ``--enable-vsx`` for
276 SIMD support. If you are using a Cray, there is a special modified
277 (commercial) version of FFTs using the FFTW interface which can be
278 slightly faster.
279
280 Using MKL
281 ^^^^^^^^^
282 Use MKL bundled with Intel compilers by setting up the compiler
283 environment, e.g., through ``source /path/to/compilervars.sh intel64``
284 or similar before running CMake including setting
285 ``-DGMX_FFT_LIBRARY=mkl``.
286
287 If you need to customize this further, use
288
289 ::
290     -DGMX_FFT_LIBRARY=mkl
291     -DMKL_LIBRARIES="/full/path/to/libone.so;/full/path/to/libtwo.so"
292     -DMKL_INCLUDE_DIR="/full/path/to/mkl/include"
293
294 The full list and order(!) of libraries you require are found in Intel's MKL documentation for your system.
295
296 Other optional build components
297 -------------------------------
298 * Run-time detection of hardware capabilities can be improved by
299   linking with hwloc, which is automatically enabled if detected.
300 * Hardware-optimized BLAS and LAPACK libraries are useful
301   for a few of the |Gromacs| utilities focused on normal modes and
302   matrix manipulation, but they do not provide any benefits for normal
303   simulations. Configuring these is discussed at
304   `linear algebra libraries`_.
305 * The built-in |Gromacs| trajectory viewer ``gmx view`` requires X11 and
306   Motif/Lesstif libraries and header files. You may prefer to use
307   third-party software for visualization, such as VMD_ or PyMol_.
308 * An external TNG library for trajectory-file handling can be used
309   by setting ``-DGMX_EXTERNAL_TNG=yes``, but TNG
310   |GMX_TNG_MINIMUM_REQUIRED_VERSION| is bundled in the |Gromacs|
311   source already.
312 * An external lmfit library for Levenberg-Marquardt curve fitting
313   can be used by setting ``-DGMX_EXTERNAL_LMFIT=yes``, but lmfit
314   |GMX_LMFIT_MINIMUM_REQUIRED_VERSION| is bundled in the |Gromacs|
315   source already.
316 * zlib is used by TNG for compressing some kinds of trajectory data
317 * Building the |Gromacs| documentation is optional, and requires
318   ImageMagick, pdflatex, bibtex, doxygen, python 2.7, sphinx 1.2.4,
319   and pygments.
320 * The |Gromacs| utility programs often write data files in formats
321   suitable for the Grace plotting tool, but it is straightforward to
322   use these files in other plotting programs, too.
323   
324 Doing a build of |Gromacs|
325 ==========================
326 This section will cover a general build of |Gromacs| with CMake_, but it
327 is not an exhaustive discussion of how to use CMake. There are many
328 resources available on the web, which we suggest you search for when
329 you encounter problems not covered here. The material below applies
330 specifically to builds on Unix-like systems, including Linux, and Mac
331 OS X. For other platforms, see the specialist instructions below.
332
333 Configuring with CMake
334 ----------------------
335 CMake will run many tests on your system and do its best to work out
336 how to build |Gromacs| for you. If your build machine is the same as
337 your target machine, then you can be sure that the defaults and
338 detection will be pretty good. However, if you want to control aspects
339 of the build, or you are compiling on a cluster head node for back-end
340 nodes with a different architecture, there are a few things you
341 should consider specifying.
342
343 The best way to use CMake to configure |Gromacs| is to do an
344 "out-of-source" build, by making another directory from which you will
345 run CMake. This can be outside the source directory, or a subdirectory
346 of it. It also means you can never corrupt your source code by trying
347 to build it! So, the only required argument on the CMake command line
348 is the name of the directory containing the ``CMakeLists.txt`` file of
349 the code you want to build. For example, download the source tarball
350 and use
351
352 .. parsed-literal::
353
354     tar xfz gromacs-|version|.tgz
355     cd gromacs-|version|
356     mkdir build-gromacs
357     cd build-gromacs
358     cmake ..
359
360 You will see ``cmake`` report a sequence of results of tests and
361 detections done by the |Gromacs| build system. These are written to the
362 ``cmake`` cache, kept in ``CMakeCache.txt``. You can edit this file by
363 hand, but this is not recommended because you could make a mistake.
364 You should not attempt to move or copy this file to do another build,
365 because file paths are hard-coded within it. If you mess things up,
366 just delete this file and start again with ``cmake``.
367
368 If there is a serious problem detected at this stage, then you will see
369 a fatal error and some suggestions for how to overcome it. If you are
370 not sure how to deal with that, please start by searching on the web
371 (most computer problems already have known solutions!) and then
372 consult the gmx-users mailing list. There are also informational
373 warnings that you might like to take on board or not. Piping the
374 output of ``cmake`` through ``less`` or ``tee`` can be
375 useful, too.
376
377 Once ``cmake`` returns, you can see all the settings that were chosen
378 and information about them by using e.g. the curses interface
379
380 ::
381
382     ccmake ..
383
384 You can actually use ``ccmake`` (available on most Unix platforms)
385 directly in the first step, but then
386 most of the status messages will merely blink in the lower part
387 of the terminal rather than be written to standard output. Most platforms
388 including Linux, Windows, and Mac OS X even have native graphical user interfaces for
389 ``cmake``, and it can create project files for almost any build environment
390 you want (including Visual Studio or Xcode).
391 Check out `running CMake`_ for
392 general advice on what you are seeing and how to navigate and change
393 things. The settings you might normally want to change are already
394 presented. You may make changes, then re-configure (using ``c``), so that it
395 gets a chance to make changes that depend on yours and perform more
396 checking. It may take several configuration passes to reach the desired
397 configuration, in particular if you need to resolve errors.
398
399 When you have reached the desired configuration with ``ccmake``, the
400 build system can be generated by pressing ``g``.  This requires that the previous
401 configuration pass did not reveal any additional settings (if it did, you need
402 to configure once more with ``c``).  With ``cmake``, the build system is generated
403 after each pass that does not produce errors.
404
405 You cannot attempt to change compilers after the initial run of
406 ``cmake``. If you need to change, clean up, and start again.
407
408 .. _non-standard location:
409
410 Where to install GROMACS
411 ^^^^^^^^^^^^^^^^^^^^^^^^
412
413 |Gromacs| is installed in the directory to which
414 ``CMAKE_INSTALL_PREFIX`` points. It may not be the source directory or
415 the build directory.  You require write permissions to this
416 directory. Thus, without super-user privileges,
417 ``CMAKE_INSTALL_PREFIX`` will have to be within your home directory.
418 Even if you do have super-user privileges, you should use them only
419 for the installation phase, and never for configuring, building, or
420 running |Gromacs|!
421
422 .. _cmake options:
423
424 Using CMake command-line options
425 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
426 Once you become comfortable with setting and changing options, you may
427 know in advance how you will configure |Gromacs|. If so, you can speed
428 things up by invoking ``cmake`` and passing the various options at once
429 on the command line. This can be done by setting cache variable at the
430 cmake invocation using ``-DOPTION=VALUE``. Note that some
431 environment variables are also taken into account, in particular
432 variables like ``CC`` and ``CXX``.
433
434 For example, the following command line
435
436 ::
437
438     cmake .. -DGMX_GPU=ON -DGMX_MPI=ON -DCMAKE_INSTALL_PREFIX=/home/marydoe/programs
439
440 can be used to build with CUDA GPUs, MPI and install in a custom
441 location. You can even save that in a shell script to make it even
442 easier next time. You can also do this kind of thing with ``ccmake``,
443 but you should avoid this, because the options set with ``-D`` will not
444 be able to be changed interactively in that run of ``ccmake``.
445
446 SIMD support
447 ^^^^^^^^^^^^
448 |Gromacs| has extensive support for detecting and using the SIMD
449 capabilities of many modern HPC CPU architectures. If you are building
450 |Gromacs| on the same hardware you will run it on, then you don't need
451 to read more about this, unless you are getting configuration warnings
452 you do not understand. By default, the |Gromacs| build system will
453 detect the SIMD instruction set supported by the CPU architecture (on
454 which the configuring is done), and thus pick the best
455 available SIMD parallelization supported by |Gromacs|. The build system
456 will also check that the compiler and linker used also support the
457 selected SIMD instruction set and issue a fatal error if they
458 do not.
459
460 Valid values are listed below, and the applicable value with the
461 largest number in the list is generally the one you should choose.
462 In most cases, choosing an inappropriate higher number will lead
463 to compiling a binary that will not run.
464
465 1. ``None`` For use only on an architecture either lacking SIMD,
466    or to which |Gromacs| has not yet been ported and none of the
467    options below are applicable.
468 2. ``SSE2`` This SIMD instruction set was introduced in Intel
469    processors in 2001, and AMD in 2003. Essentially all x86
470    machines in existence have this, so it might be a good choice if
471    you need to support dinosaur x86 computers too.
472 3. ``SSE4.1`` Present in all Intel core processors since 2007,
473    but notably not in AMD Magny-Cours. Still, almost all recent
474    processors support this, so this can also be considered a good
475    baseline if you are content with slow simulations and prefer
476    portability between reasonably modern processors.
477 4. ``AVX_128_FMA`` AMD bulldozer processors (2011) have this.
478 5. ``AVX_256`` Intel processors since Sandy Bridge (2011). While this
479    code will work on recent AMD processors, it is significantly less
480    efficient than the ``AVX_128_FMA`` choice above - do not be fooled
481    to assume that 256 is better than 128 in this case.
482 6. ``AVX2_256`` Present on Intel Haswell (and later) processors (2013),
483    and it will also enable Intel 3-way fused multiply-add instructions.
484 7. ``AVX_512`` Skylake-EP Xeon processors (2017)
485 8. ``AVX_512_KNL`` Knights Landing Xeon Phi processors
486 9. ``IBM_QPX`` BlueGene/Q A2 cores have this.
487 10. ``Sparc64_HPC_ACE`` Fujitsu machines like the K computer have this.
488 11. ``IBM_VMX`` Power6 and similar Altivec processors have this.
489 12. ``IBM_VSX`` Power7 and Power8 have this.
490 13. ``ARM_NEON`` 32-bit ARMv7 with NEON support.
491 14. ``ARM_NEON_ASIMD`` 64-bit ARMv8 and later.
492
493 The CMake configure system will check that the compiler you have
494 chosen can target the architecture you have chosen. mdrun will check
495 further at runtime, so if in doubt, choose the lowest number you
496 think might work, and see what mdrun says. The configure system also
497 works around many known issues in many versions of common HPC
498 compilers.
499
500 A further ``GMX_SIMD=Reference`` option exists, which is a special
501 SIMD-like implementation written in plain C that developers can use
502 when developing support in |Gromacs| for new SIMD architectures. It is
503 not designed for use in production simulations, but if you are using
504 an architecture with SIMD support to which |Gromacs| has not yet been
505 ported, you may wish to try this option instead of the default
506 ``GMX_SIMD=None``, as it can often out-perform this when the
507 auto-vectorization in your compiler does a good job. And post on the
508 |Gromacs| mailing lists, because |Gromacs| can probably be ported for new
509 SIMD architectures in a few days.
510
511 CMake advanced options
512 ^^^^^^^^^^^^^^^^^^^^^^
513 The options that are displayed in the default view of ``ccmake`` are
514 ones that we think a reasonable number of users might want to consider
515 changing. There are a lot more options available, which you can see by
516 toggling the advanced mode in ``ccmake`` on and off with ``t``. Even
517 there, most of the variables that you might want to change have a
518 ``CMAKE_`` or ``GMX_`` prefix. There are also some options that will be
519 visible or not according to whether their preconditions are satisfied.
520
521 .. _search for libraries, headers or programs:
522
523 Helping CMake find the right libraries, headers, or programs
524 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
525 If libraries are installed in non-default locations their location can
526 be specified using the following variables:
527
528 * ``CMAKE_INCLUDE_PATH`` for header files
529 * ``CMAKE_LIBRARY_PATH`` for libraries
530 * ``CMAKE_PREFIX_PATH`` for header, libraries and binaries
531   (e.g. ``/usr/local``).
532
533 The respective ``include``, ``lib``, or ``bin`` is
534 appended to the path. For each of these variables, a list of paths can
535 be specified (on Unix, separated with ":"). These can be set as
536 enviroment variables like:
537
538 ::
539
540     CMAKE_PREFIX_PATH=/opt/fftw:/opt/cuda cmake ..
541
542 (assuming ``bash`` shell). Alternatively, these variables are also
543 ``cmake`` options, so they can be set like
544 ``-DCMAKE_PREFIX_PATH=/opt/fftw:/opt/cuda``.
545
546 The ``CC`` and ``CXX`` environment variables are also useful
547 for indicating to ``cmake`` which compilers to use. Similarly,
548 ``CFLAGS``/``CXXFLAGS`` can be used to pass compiler
549 options, but note that these will be appended to those set by
550 |Gromacs| for your build platform and build type. You can customize
551 some of this with advanced CMake options such as ``CMAKE_C_FLAGS``
552 and its relatives.
553
554 See also the page on `CMake environment variables`_.
555
556 .. _CUDA GPU acceleration:
557
558 CUDA GPU acceleration
559 ^^^^^^^^^^^^^^^^^^^^^
560 If you have the CUDA_ Toolkit installed, you can use ``cmake`` with:
561
562 ::
563
564     cmake .. -DGMX_GPU=ON -DCUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda
565
566 (or whichever path has your installation). In some cases, you might
567 need to specify manually which of your C++ compilers should be used,
568 e.g. with the advanced option ``CUDA_HOST_COMPILER``.
569
570 To make it
571 possible to get best performance from NVIDIA Tesla and Quadro GPUs,
572 you should install the `GPU Deployment Kit
573 <https://developer.nvidia.com/gpu-deployment-kit>`_ and configure
574 |Gromacs| to use it by setting the CMake variable
575 ``-DGPU_DEPLOYMENT_KIT_ROOT_DIR=/path/to/your/kit``. The NVML support
576 is most useful if
577 ``nvidia-smi --applications-clocks-permission=UNRESTRICTED`` is run
578 (as root). When application clocks permissions are unrestricted, the
579 GPU clock speed can be increased automatically, which increases the
580 GPU kernel performance roughly proportional to the clock
581 increase. When using |Gromacs| on suitable GPUs under restricted
582 permissions, clocks cannot be changed, and in that case informative
583 log file messages will be produced. Background details can be found at
584 this `NVIDIA blog post
585 <http://devblogs.nvidia.com/parallelforall/increase-performance-gpu-boost-k80-autoboost/>`_.
586 NVML support is only available if detected, and may be disabled by
587 turning off the ``GMX_USE_NVML`` CMake advanced option.
588
589 By default, optimized code will be generated for CUDA architectures
590 supported by the nvcc compiler (and the |Gromacs| build system). 
591 However, it can be beneficial to manually pick the specific CUDA architecture(s)
592 to generate code for either to reduce compilation time (and binary size) or to
593 target a new architecture not yet supported by the |GROMACS| build system.
594 Setting the desired CUDA architecture(s) and virtual architecture(s)
595 can be done using the ``GMX_CUDA_TARGET_SM`` and ``GMX_CUDA_TARGET_COMPUTE``
596 variables, respectively. These take a semicolon delimited string with 
597 the two digit suffixes of CUDA (virtual) architectures names
598 (for details see the "Options for steering GPU code generation" section of the
599 nvcc man / help or Chapter 6. of the nvcc manual).
600
601 The GPU acceleration has been tested on AMD64/x86-64 platforms with
602 Linux, Mac OS X and Windows operating systems, but Linux is the
603 best-tested and supported of these. Linux running on POWER 8, ARM v7 and v8
604 CPUs also works well.
605
606 OpenCL GPU acceleration
607 ^^^^^^^^^^^^^^^^^^^^^^^
608
609 The primary target of the |Gromacs| OpenCL support is accelerating simulations
610 on AMD hardware, both discrete GPUs and APUs (integrated CPU+GPU chips).
611 The |Gromacs| OpenCL on NVIDIA GPUs works, but performance
612 and other limitations make it less practical (for details see the user guide).
613
614 To build |Gromacs| with OpenCL_ support enabled, two components are
615 required: the OpenCL_ headers and the wrapper library that acts
616 as a client driver loader (so-called ICD loader).
617 The additional, runtime-only dependency is the vendor-specific GPU driver
618 for the device targeted. This also contains the OpenCL_ compiler.
619 As the GPU compute kernels are compiled  on-demand at run time,
620 this vendor-specific compiler and driver is not needed for building |Gromacs|.
621 The former, compile-time dependencies are standard components,
622 hence stock versions can be obtained from most Linux distribution
623 repositories (e.g. ``opencl-headers`` and ``ocl-icd-libopencl1`` on Debian/Ubuntu).
624 Only the compatibility with the required OpenCL_ version |REQUIRED_OPENCL_MIN_VERSION|
625 needs to be ensured.
626 Alternatively, the headers and library can also be obtained from vendor SDKs
627 (e.g. `from AMD <http://developer.amd.com/appsdk>`_),
628 which must be installed in a path found in ``CMAKE_PREFIX_PATH`` (or via the environment
629 variables ``AMDAPPSDKROOT`` or ``CUDA_PATH``).
630
631 To trigger an OpenCL_ build the following CMake flags must be set
632
633 ::
634
635     cmake .. -DGMX_GPU=ON -DGMX_USE_OPENCL=ON
636
637 On Mac OS, an AMD GPU can be used only with OS version 10.10.4 and
638 higher; earlier OS versions are known to run incorrectly.
639
640 Static linking
641 ^^^^^^^^^^^^^^
642 Dynamic linking of the |Gromacs| executables will lead to a
643 smaller disk footprint when installed, and so is the default on
644 platforms where we believe it has been tested repeatedly and found to work.
645 In general, this includes Linux, Windows, Mac OS X and BSD systems.
646 Static binaries take more space, but on some hardware and/or under
647 some conditions they are necessary, most commonly when you are running a parallel
648 simulation using MPI libraries (e.g. BlueGene, Cray).
649
650 * To link |Gromacs| binaries statically against the internal |Gromacs|
651   libraries, set ``-DBUILD_SHARED_LIBS=OFF``.
652 * To link statically against external (non-system) libraries as well,
653   set ``-DGMX_PREFER_STATIC_LIBS=ON``. Note, that in
654   general ``cmake`` picks up whatever is available, so this option only
655   instructs ``cmake`` to prefer static libraries when both static and
656   shared are available. If no static version of an external library is
657   available, even when the aforementioned option is ``ON``, the shared
658   library will be used. Also note that the resulting binaries will
659   still be dynamically linked against system libraries on platforms
660   where that is the default. To use static system libraries,
661   additional compiler/linker flags are necessary, e.g. ``-static-libgcc
662   -static-libstdc++``.
663 * To attempt to link a fully static binary set
664   ``-DGMX_BUILD_SHARED_EXE=OFF``. This will prevent CMake from explicitly
665   setting any dynamic linking flags. This option also sets
666   ``-DBUILD_SHARED_LIBS=OFF`` and ``-DGMX_PREFER_STATIC_LIBS=ON`` by
667   default, but the above caveats apply. For compilers which don't
668   default to static linking, the required flags have to be specified. On
669   Linux, this is usually ``CFLAGS=-static CXXFLAGS=-static``.
670
671 Portability aspects
672 ^^^^^^^^^^^^^^^^^^^
673 A |Gromacs| build will normally not be portable, not even across
674 hardware with the same base instruction set, like x86. Non-portable
675 hardware-specific optimizations are selected at configure-time, such
676 as the SIMD instruction set used in the compute kernels. This
677 selection will be done by the build system based on the capabilities
678 of the build host machine or otherwise specified to ``cmake`` during
679 configuration.
680
681 Often it is possible to ensure portability by choosing the least
682 common denominator of SIMD support, e.g. SSE2 for x86, and ensuring
683 the you use ``cmake -DGMX_USE_RDTSCP=off`` if any of the target CPU
684 architectures does not support the ``RDTSCP`` instruction.  However, we
685 discourage attempts to use a single |Gromacs| installation when the
686 execution environment is heterogeneous, such as a mix of AVX and
687 earlier hardware, because this will lead to programs (especially
688 mdrun) that run slowly on the new hardware. Building two full
689 installations and locally managing how to call the correct one
690 (e.g. using a module system) is the recommended
691 approach. Alternatively, as at the moment the |Gromacs| tools do not
692 make strong use of SIMD acceleration, it can be convenient to create
693 an installation with tools portable across different x86 machines, but
694 with separate mdrun binaries for each architecture. To achieve this,
695 one can first build a full installation with the
696 least-common-denominator SIMD instruction set, e.g. ``-DGMX_SIMD=SSE2``,
697 then build separate mdrun binaries for each architecture present in
698 the heterogeneous environment. By using custom binary and library
699 suffixes for the mdrun-only builds, these can be installed to the
700 same location as the "generic" tools installation.
701 `Building just the mdrun binary`_ is possible by setting the
702 ``-DGMX_BUILD_MDRUN_ONLY=ON`` option.
703
704 Linear algebra libraries
705 ^^^^^^^^^^^^^^^^^^^^^^^^
706 As mentioned above, sometimes vendor BLAS and LAPACK libraries
707 can provide performance enhancements for |Gromacs| when doing
708 normal-mode analysis or covariance analysis. For simplicity, the text
709 below will refer only to BLAS, but the same options are available
710 for LAPACK. By default, CMake will search for BLAS, use it if it
711 is found, and otherwise fall back on a version of BLAS internal to
712 |Gromacs|. The ``cmake`` option ``-DGMX_EXTERNAL_BLAS=on`` will be set
713 accordingly. The internal versions are fine for normal use. If you
714 need to specify a non-standard path to search, use
715 ``-DCMAKE_PREFIX_PATH=/path/to/search``. If you need to specify a
716 library with a non-standard name (e.g. ESSL on AIX or BlueGene), then
717 set ``-DGMX_BLAS_USER=/path/to/reach/lib/libwhatever.a``.
718
719 If you are using Intel MKL_ for FFT, then the BLAS and
720 LAPACK it provides are used automatically. This could be
721 over-ridden with ``GMX_BLAS_USER``, etc.
722
723 On Apple platforms where the Accelerate Framework is available, these
724 will be automatically used for BLAS and LAPACK. This could be
725 over-ridden with ``GMX_BLAS_USER``, etc.
726
727 Changing the names of |Gromacs| binaries and libraries
728 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
729 It is sometimes convenient to have different versions of the same
730 |Gromacs| programs installed. The most common use cases have been single
731 and double precision, and with and without MPI. This mechanism can
732 also be used to install side-by-side multiple versions of mdrun
733 optimized for different CPU architectures, as mentioned previously.
734
735 By default, |Gromacs| will suffix programs and libraries for such builds
736 with ``_d`` for double precision and/or ``_mpi`` for MPI (and nothing
737 otherwise). This can be controlled manually with ``GMX_DEFAULT_SUFFIX
738 (ON/OFF)``, ``GMX_BINARY_SUFFIX`` (takes a string) and ``GMX_LIBS_SUFFIX``
739 (also takes a string). For instance, to set a custom suffix for
740 programs and libraries, one might specify:
741
742 ::
743
744     cmake .. -DGMX_DEFAULT_SUFFIX=OFF -DGMX_BINARY_SUFFIX=_mod -DGMX_LIBS_SUFFIX=_mod
745
746 Thus the names of all programs and libraries will be appended with
747 ``_mod``.
748
749 Changing installation tree structure
750 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
751 By default, a few different directories under ``CMAKE_INSTALL_PREFIX`` are used
752 when when |Gromacs| is installed. Some of these can be changed, which is mainly
753 useful for packaging |Gromacs| for various distributions. The directories are
754 listed below, with additional notes about some of them. Unless otherwise noted,
755 the directories can be renamed by editing the installation paths in the main
756 CMakeLists.txt.
757
758 ``bin/``
759     The standard location for executables and some scripts.
760     Some of the scripts hardcode the absolute installation prefix, which needs
761     to be changed if the scripts are relocated.
762 ``include/gromacs/``
763     The standard location for installed headers.
764 ``lib/``
765     The standard location for libraries. The default depends on the system, and
766     is determined by CMake.
767     The name of the directory can be changed using ``GMX_LIB_INSTALL_DIR`` CMake
768     variable.
769 ``lib/pkgconfig/``
770     Information about the installed ``libgromacs`` library for ``pkg-config`` is
771     installed here.  The ``lib/`` part adapts to the installation location of the
772     libraries.  The installed files contain the installation prefix as absolute
773     paths.
774 ``share/cmake/``
775     CMake package configuration files are installed here.
776 ``share/gromacs/``
777     Various data files and some documentation go here.
778     The ``gromacs`` part can be changed using ``GMX_DATA_INSTALL_DIR``. Using this
779     CMake variable is the preferred way of changing the installation path for
780     ``share/gromacs/top/``, since the path to this directory is built into
781     ``libgromacs`` as well as some scripts, both as a relative and as an absolute
782     path (the latter as a fallback if everything else fails).
783 ``share/man/``
784     Installed man pages go here.
785
786 Compiling and linking
787 ---------------------
788 Once you have configured with ``cmake``, you can build |Gromacs| with ``make``.
789 It is expected that this will always complete successfully, and
790 give few or no warnings. The CMake-time tests |Gromacs| makes on the settings
791 you choose are pretty extensive, but there are probably a few cases we
792 have not thought of yet. Search the web first for solutions to
793 problems, but if you need help, ask on gmx-users, being sure to
794 provide as much information as possible about what you did, the system
795 you are building on, and what went wrong. This may mean scrolling back
796 a long way through the output of ``make`` to find the first error
797 message!
798
799 If you have a multi-core or multi-CPU machine with ``N``
800 processors, then using
801
802 ::
803
804     make -j N
805
806 will generally speed things up by quite a bit. Other build generator systems
807 supported by ``cmake`` (e.g. ``ninja``) also work well.
808
809 .. _building just the mdrun binary:
810
811 Building only mdrun
812 ^^^^^^^^^^^^^^^^^^^
813
814 This is now supported with the ``cmake`` option
815 ``-DGMX_BUILD_MDRUN_ONLY=ON``, which will build a different version of
816 ``libgromacs`` and the ``mdrun`` program.
817 Naturally, now ``make install`` installs only those
818 products. By default, mdrun-only builds will default to static linking
819 against |Gromacs| libraries, because this is generally a good idea for
820 the targets for which an mdrun-only build is desirable.
821
822 Installing |Gromacs|
823 --------------------
824 Finally, ``make install`` will install |Gromacs| in the
825 directory given in ``CMAKE_INSTALL_PREFIX``. If this is a system
826 directory, then you will need permission to write there, and you
827 should use super-user privileges only for ``make install`` and
828 not the whole procedure.
829
830 .. _getting access to GROMACS:
831
832 Getting access to |Gromacs| after installation
833 ----------------------------------------------
834 |Gromacs| installs the script ``GMXRC`` in the ``bin``
835 subdirectory of the installation directory
836 (e.g. ``/usr/local/gromacs/bin/GMXRC``), which you should source
837 from your shell:
838
839 ::
840
841     source /your/installation/prefix/here/bin/GMXRC
842
843 It will detect what kind of shell you are running and set up your
844 environment for using |Gromacs|. You may wish to arrange for your
845 login scripts to do this automatically; please search the web for
846 instructions on how to do this for your shell. 
847
848 Many of the |Gromacs| programs rely on data installed in the
849 ``share/gromacs`` subdirectory of the installation directory. By
850 default, the programs will use the environment variables set in the
851 ``GMXRC`` script, and if this is not available they will try to guess the
852 path based on their own location.  This usually works well unless you
853 change the names of directories inside the install tree. If you still
854 need to do that, you might want to recompile with the new install
855 location properly set, or edit the ``GMXRC`` script.
856
857 Testing |Gromacs| for correctness
858 ---------------------------------
859 Since 2011, the |Gromacs| development uses an automated system where
860 every new code change is subject to regression testing on a number of
861 platforms and software combinations. While this improves
862 reliability quite a lot, not everything is tested, and since we
863 increasingly rely on cutting edge compiler features there is
864 non-negligible risk that the default compiler on your system could
865 have bugs. We have tried our best to test and refuse to use known bad
866 versions in ``cmake``, but we strongly recommend that you run through
867 the tests yourself. It only takes a few minutes, after which you can
868 trust your build.
869
870 The simplest way to run the checks is to build |Gromacs| with
871 ``-DREGRESSIONTEST_DOWNLOAD``, and run ``make check``.
872 |Gromacs| will automatically download and run the tests for you.
873 Alternatively, you can download and unpack the GROMACS
874 regression test suite |gmx-regressiontests-package| tarball yourself
875 and use the advanced ``cmake`` option ``REGRESSIONTEST_PATH`` to
876 specify the path to the unpacked tarball, which will then be used for
877 testing. If the above does not work, then please read on.
878
879 The regression tests are also available from the download_ section.
880 Once you have downloaded them, unpack the tarball, source
881 ``GMXRC`` as described above, and run ``./gmxtest.pl all``
882 inside the regression tests folder. You can find more options
883 (e.g. adding ``double`` when using double precision, or
884 ``-only expanded`` to run just the tests whose names match
885 "expanded") if you just execute the script without options.
886
887 Hopefully, you will get a report that all tests have passed. If there
888 are individual failed tests it could be a sign of a compiler bug, or
889 that a tolerance is just a tiny bit too tight. Check the output files
890 the script directs you too, and try a different or newer compiler if
891 the errors appear to be real. If you cannot get it to pass the
892 regression tests, you might try dropping a line to the gmx-users
893 mailing list, but then you should include a detailed description of
894 your hardware, and the output of ``gmx mdrun -version`` (which contains
895 valuable diagnostic information in the header).
896
897 A build with ``-DGMX_BUILD_MDRUN_ONLY`` cannot be tested with
898 ``make check`` from the build tree, because most of the tests
899 require a full build to run things like ``grompp``. To test such an
900 mdrun fully requires installing it to the same location as a normal
901 build of |Gromacs|, downloading the regression tests tarball manually
902 as described above, sourcing the correct ``GMXRC`` and running the
903 perl script manually. For example, from your |Gromacs| source
904 directory:
905
906 ::
907
908     mkdir build-normal
909     cd build-normal
910     cmake .. -DCMAKE_INSTALL_PREFIX=/your/installation/prefix/here
911     make -j 4
912     make install
913     cd ..
914     mkdir build-mdrun-only
915     cd build-mdrun-only
916     cmake .. -DGMX_MPI=ON -DGMX_GPU=ON -DGMX_BUILD_MDRUN_ONLY=ON -DCMAKE_INSTALL_PREFIX=/your/installation/prefix/here
917     make -j 4
918     make install
919     cd /to/your/unpacked/regressiontests
920     source /your/installation/prefix/here/bin/GMXRC
921     ./gmxtest.pl all -np 2
922
923 If your mdrun program has been suffixed in a non-standard way, then
924 the ``./gmxtest.pl -mdrun`` option will let you specify that name to the
925 test machinery. You can use ``./gmxtest.pl -double`` to test the
926 double-precision version. You can use ``./gmxtest.pl -crosscompiling``
927 to stop the test harness attempting to check that the programs can
928 be run. You can use ``./gmxtest.pl -mpirun srun`` if your command to
929 run an MPI program is called ``srun``.
930
931 The ``make check`` target also runs integration-style tests that may run
932 with MPI if ``GMX_MPI=ON`` was set. To make these work with various possible
933 MPI libraries, you may need to
934 set the CMake variables ``MPIEXEC``, ``MPIEXEC_NUMPROC_FLAG``,
935 ``MPIEXEC_PREFLAGS`` and ``MPIEXEC_POSTFLAGS`` so that
936 ``mdrun-mpi-test_mpi`` would run on multiple ranks via the shell command
937
938 ::
939
940     ${MPIEXEC} ${MPIEXEC_NUMPROC_FLAG} ${NUMPROC} ${MPIEXEC_PREFLAGS} \
941           mdrun-mpi-test_mpi ${MPIEXEC_POSTFLAGS} -otherflags
942
943 A typical example for SLURM is
944
945 ::
946
947      cmake .. -DGMX_MPI=on -DMPIEXEC=srun -DMPIEXEC_NUMPROC_FLAG=-n -DMPIEXEC_PREFLAGS= -DMPIEXEC_POSTFLAGS=
948
949
950 Testing |Gromacs| for performance
951 ---------------------------------
952 We are still working on a set of benchmark systems for testing
953 the performance of |Gromacs|. Until that is ready, we recommend that
954 you try a few different parallelization options, and experiment with
955 tools such as ``gmx tune_pme``.
956
957 Having difficulty?
958 ------------------
959 You are not alone - this can be a complex task! If you encounter a
960 problem with installing |Gromacs|, then there are a number of
961 locations where you can find assistance. It is recommended that you
962 follow these steps to find the solution:
963
964 1. Read the installation instructions again, taking note that you
965    have followed each and every step correctly.
966
967 2. Search the |Gromacs| webpage_ and users emailing list for information
968    on the error. Adding
969    ``site:https://mailman-1.sys.kth.se/pipermail/gromacs.org_gmx-users``
970    to a Google search may help filter better results.
971
972 3. Search the internet using a search engine such as Google.
973
974 4. Post to the |Gromacs| users emailing list gmx-users for
975    assistance. Be sure to give a full description of what you have
976    done and why you think it did not work. Give details about the
977    system on which you are installing.  Copy and paste your command
978    line and as much of the output as you think might be relevant -
979    certainly from the first indication of a problem. In particular,
980    please try to include at least the header from the mdrun logfile,
981    and preferably the entire file.  People who might volunteer to help
982    you do not have time to ask you interactive detailed follow-up
983    questions, so you will get an answer faster if you provide as much
984    information as you think could possibly help. High quality bug
985    reports tend to receive rapid high quality answers.
986
987 Special instructions for some platforms
988 =======================================
989
990 Building on Windows
991 -------------------
992 Building on Windows using native compilers is rather similar to
993 building on Unix, so please start by reading the above. Then, download
994 and unpack the |Gromacs| source archive. Make a folder in which to do
995 the out-of-source build of |Gromacs|. For example, make it within the
996 folder unpacked from the source archive, and call it ``build-gromacs``.
997
998 For CMake, you can either use the graphical user interface provided on
999 Windows, or you can use a command line shell with instructions similar
1000 to the UNIX ones above. If you open a shell from within your IDE
1001 (e.g. Microsoft Visual Studio), it will configure the environment for
1002 you, but you might need to tweak this in order to get either a 32-bit
1003 or 64-bit build environment. The latter provides the fastest
1004 executable. If you use a normal Windows command shell, then you will
1005 need to either set up the environment to find your compilers and
1006 libraries yourself, or run the ``vcvarsall.bat`` batch script provided
1007 by MSVC (just like sourcing a bash script under Unix).
1008
1009 With the graphical user interface, you will be asked about what
1010 compilers to use at the initial configuration stage, and if you use
1011 the command line they can be set in a similar way as under UNIX.
1012
1013 Unfortunately ``-DGMX_BUILD_OWN_FFTW=ON`` (see `Using FFTW`_) does not
1014 work on Windows, because there is no supported way to build FFTW on
1015 Windows. You can either build FFTW some other way (e.g. MinGW), or
1016 use the built-in fftpack (which may be slow), or `using MKL`_.
1017
1018 For the build, you can either load the generated solutions file into
1019 e.g. Visual Studio, or use the command line with ``cmake --build`` so
1020 the right tools get used.
1021
1022 Building on Cray
1023 ----------------
1024 |Gromacs| builds mostly out of the box on modern Cray machines, but
1025 you may need to specify the use of static binaries with
1026 ``-DGMX_BUILD_SHARED_EXE=off``, and you may need to set the F77
1027 environmental variable to ``ftn`` when compiling FFTW.
1028
1029 Building on BlueGene
1030 --------------------
1031
1032 BlueGene/Q
1033 ^^^^^^^^^^
1034 There is currently native acceleration on this platform for the Verlet
1035 cut-off scheme. There are no plans to provide accelerated kernels for
1036 the group cut-off scheme, but the default plain C kernels will work
1037 (slowly).
1038
1039 Only the bgclang compiler is supported, because it is the only
1040 availble C++11 compiler. Only static linking is supported.
1041
1042 Computation on BlueGene floating-point units is always done in
1043 double-precision. However, mixed-precision builds of |Gromacs| are still
1044 normal and encouraged since they use cache more efficiently.
1045
1046 You need to arrange for FFTW to be installed correctly, following the
1047 above instructions. You may prefer to configure FFTW with
1048 ``--disable-fortran`` to avoid complications.
1049
1050 MPI wrapper compilers should be used for compiling and linking. The
1051 MPI wrapper compilers can make it awkward to
1052 attempt to use IBM's optimized BLAS/LAPACK called ESSL (see the
1053 section on `linear algebra libraries`_. Since mdrun is the only part
1054 of |Gromacs| that should normally run on the compute nodes, and there is
1055 nearly no need for linear algebra support for mdrun, it is recommended
1056 to use the |Gromacs| built-in linear algebra routines - this is never
1057 a problem for normal simulations.
1058
1059 The recommended configuration is to use
1060
1061 ::
1062
1063     cmake .. -DCMAKE_C_COMPILER=mpicc \
1064              -DCMAKE_CXX_COMPILER=mpicxx \
1065              -DCMAKE_TOOLCHAIN_FILE=Platform/BlueGeneQ-static-bgclang-CXX.cmake \
1066              -DCMAKE_PREFIX_PATH=/your/fftw/installation/prefix \
1067              -DGMX_MPI=ON \
1068              -DGMX_BUILD_MDRUN_ONLY=ON
1069     make
1070     make install
1071
1072 which will build a statically-linked MPI-enabled mdrun for the compute
1073 nodes. Otherwise, |Gromacs| default configuration
1074 behaviour applies.
1075
1076 It is possible to configure and make the remaining |Gromacs| tools with
1077 the compute-node toolchain, but as none of those tools are MPI-aware,
1078 this would not normally
1079 be useful. Instead, users should plan to run these on the login node,
1080 and perform a separate |Gromacs| installation for that, using the login
1081 node's toolchain - not the above platform file, or any other
1082 compute-node toolchain. This may require requesting an up-to-date
1083 gcc or clang toolchain for the front end.
1084
1085 Note that only the MPI build is available for the compute-node
1086 toolchains. The |Gromacs| thread-MPI or no-MPI builds are not useful at
1087 all on BlueGene/Q.
1088
1089 BlueGene/P
1090 ^^^^^^^^^^
1091 There is currently no SIMD support on this platform and no plans to
1092 add it. The default plain C kernels will work if there is a C++11
1093 compiler for this platform.
1094
1095 Fujitsu PRIMEHPC
1096 ^^^^^^^^^^^^^^^^
1097 This is the architecture of the K computer, which uses Fujitsu
1098 Sparc64VIIIfx chips. On this platform, |Gromacs| has
1099 accelerated group kernels using the HPC-ACE instructions, no
1100 accelerated Verlet kernels, and a custom build toolchain. Since this
1101 particular chip only does double precision SIMD, the default setup
1102 is to build |Gromacs| in double. Since most users only need single, we have added
1103 an option GMX_RELAXED_DOUBLE_PRECISION to accept single precision square root
1104 accuracy in the group kernels; unless you know that you really need 15 digits
1105 of accuracy in each individual force, we strongly recommend you use this. Note
1106 that all summation and other operations are still done in double.
1107
1108 The recommended configuration is to use
1109
1110 ::
1111
1112     cmake .. -DCMAKE_TOOLCHAIN_FILE=Toolchain-Fujitsu-Sparc64-mpi.cmake \
1113              -DCMAKE_PREFIX_PATH=/your/fftw/installation/prefix \
1114              -DCMAKE_INSTALL_PREFIX=/where/gromacs/should/be/installed \
1115              -DGMX_MPI=ON \
1116              -DGMX_BUILD_MDRUN_ONLY=ON \
1117              -DGMX_RELAXED_DOUBLE_PRECISION=ON
1118     make
1119     make install
1120
1121 Intel Xeon Phi
1122 ^^^^^^^^^^^^^^
1123 |Gromacs| has preliminary support for Intel Xeon Phi. Only symmetric
1124 (aka native) mode is supported on Knights Corner, and it has so far
1125 not been optimized to the same level as other architectures. The
1126 performance depends among other factors on the system size, and for
1127 now the performance might not be faster than CPUs. Building for Xeon
1128 Phi works almost as any other Unix. See the instructions above for
1129 details. The recommended configuration is
1130
1131 ::
1132
1133     cmake .. -DCMAKE_TOOLCHAIN_FILE=Platform/XeonPhi
1134     make
1135     make install
1136
1137 Tested platforms
1138 ================
1139 While it is our best belief that |Gromacs| will build and run pretty
1140 much everywhere, it is important that we tell you where we really know
1141 it works because we have tested it. We do test on Linux, Windows, and
1142 Mac with a range of compilers and libraries for a range of our
1143 configuration options. Every commit in our git source code repository
1144 is currently tested on x86 with gcc versions ranging from 4.6 through
1145 5.2, and versions 16 of the Intel compiler as well as Clang
1146 version 3.4 through 3.8. For this, we use a variety of GNU/Linux
1147 flavors and versions as well as recent versions of Windows. Under
1148 Windows, we test both MSVC 2015 and version 16 of the Intel compiler.
1149 For details, you can
1150 have a look at the `continuous integration server used by GROMACS`_,
1151 which runs Jenkins_.
1152
1153 We test irregularly on ARM v7, ARM v8, BlueGene/Q, Cray, Fujitsu
1154 PRIMEHPC, Power8, Google Native Client and other environments, and
1155 with other compilers and compiler versions, too.