Fix malformed CUDA version macro check

The CUDA_VERSION macro check is incorrect in two places. The first is
harmless as it is related to legacy CUDA 3.2 version's reporting. The
second occurrence affects the check that enables stream priorities and
due to the incorrect check, with CUDA 5.5 priorities have not been used.

Fixes #1594

Change-Id: Icf781d41549c39b6b913c11bb11d4dc4e9f3be9c
Fix shared libs for Mingw

Change-Id: Ib25e6b2a34080632e1d531da3194680cc8c6825b
Add missing quotes

Change-Id: Id7568da106b707365c0b30c58a4b7b321f9181f4
Fix double linkage for tests

cmake automatically adds libraries required by a required library to the
exe linker flags. If the same dependent library is also added for the exe
and it is listed first for the exe, cmake links twice for static libs
(for a cyclic dependency it would be required and cmake can't know).
Under certain conditions (e.g. ICC 15 with static libraries and offload
enabled) this can cause linker errors. We don't have a cyclic dependency
and thus by listing libgromacs after testutils we avoid the potential
problematic double linking. Also fixes that TESTUTILS_LIBS contains
the transitive dependencies, because that is not necessary (they are anyhow
added automatically).

Change-Id: I0327b2dba0538a2c6652c484fd7be7ae4a6cfb5b
Merge branch release-4-6 into release-5-0

Conflicts:
	src/gromacs/mdlib/nbnxn_cuda/nbnxn_cuda_data_mgmt.cu

Change in release-4-6 was in a function already removed in
release-5-0, so omitted.

Change-Id: I58f745308357211d517ffdb58381ce5fb1a5dceb
Fix patterns for .gitattributes

In different contexts, git treats a trailing wildcard pattern
differently, and in .gitattributes it does not apply recursively.
A double star would, but at least the last time I tried, it did not work
with the version of git that runs on Jenkins.

Change-Id: Iac53b755a2931e8cd3ccdb6169346b0631715986
Added a bunch of new and old quotes.

Change-Id: Ife6d142451ca150a24dc4140a1b65740d4051dae
Remove duplication in version info target creation

Now the custom target created for the git version info generation uses
gmx_add_custom_output_target(), removing comments etc. that were
duplicated in both places and clarifying the code.  The custom target
created with gmx_configure_version_file() now also integrates with the
dependency resolution mechanism used by gmx_add_custom_output_target().

Change-Id: I868264498c014041f551df8819fb2b568d85bc30
Skip man/html/completion generation if not needed

Make the man/html/completion targets use a stamp file to mark when they
were done, and do no rerun them if dependencies have not changed (most
notably, do not rerun them if nothing has changed, or if only test code
has changed).

Change-Id: I510e55cb4b4c798dfce2cc7d95d66d30e3e802c4
Introduce a variable to identify in-source build

This makes it easier to find all conditionals that test for it (in case
someone may want to fix those), and makes the CMake code easier to read.

Change-Id: Ic7df20cd9829080005d021e101c4559143bb3cc1
Merge release-5-0 into master

Conflicts:
	src/gromacs/CMakeLists.txt (adjacent changes)

Change-Id: I6e5b35508b3f6f6d805a2a539e49decdef28012b
More quotes

... which brings us above 500 ones.

Change-Id: Ie980bb8e8fc258ab46fb31791bfcc4e50417a6bb
Merge "Merge release-5-0 into master"
More quotes

From speakers, their slides and participants at ATPESC2014

Change-Id: Iae2b9f823a8b86995875a02c783df70d42f4727d
Generate man pages and completions by default if possible

Make GMX_BUILD_HELP a tristate option to support three different use
cases:
 - OFF: never build anything (default for source distributions, where
   everything is already generated)
 - ON: always build everything as part of the ALL target, give an error
   if anything fails.
 - AUTO: try to build man pages and completions as part of the ALL
   target, and install the result if successful; if it fails, some
   warnings will be given, but build will still be otherwise functional.
This allows making the default AUTO for builds from a git repo, making
the shell completions and man pages work automatically also in such
cases (as long as the build host can run the compiled executables).

HTML help is generated only with GMX_BUILD_HELP=ON, since it is
currently in somewhat of a flux what will happen to it, and most people
will not notice it missing, either.

Change-Id: Id7a69b1b912381a2f1ad3678b82cbaa01cba8479
Reorganize CPack management

- Move all CPack variable setting to a separate file to reduce clutter
  in the main CMakeLists.txt.
- Move calling CPack to the end of the build system, since this allows
  gathering information for CPack from other parts.  Also some other
  CPack features (like identifying the existing components) works better
  there.
- Instead of hard-coding the generated directories to include in the
  source package, add a helper function that can be called from the code
  that actually does the generation.  This makes it a lot easier to
  understand how this works from just reading the CMake code.
- Add some TODOs for further improvements.

Change-Id: I2ca76f0f3b3e848527f2340b4aab1d62a5de8328
Fix ICC warnings

- 111: statement is unreachable
- 181: printf/scanf argument type invalid

Change-Id: I28477bdd5734f34ae4deed09b9cddce922469f81
Refactor mdrun integration tests

Future work will need the ability for such a test to call mdrun more
than once and compare the results. This means that a test fixture
object needs to be able to keep track of the separate files in an
orderly way. Created SimulationRunner to manage the setup and calls to
grompp and mdrun, somewhat like an implementation
class. MdrunTestFixture now owns a single such object. Created
MdrunTestFixtureBase to be the common point for managing issues of
controlling the execution environment of mdrun, so that future work
can derive classes from it that use more than one SimulationRunner.

Change-Id: Ic2ab82b3bacb01f9bf77de67909567352fc2d306
Renamed bonded module as 'listed-forces'

This name is more in line with all the functionality that might end up
in this module, because they all share the same implementation
property that there's a small list of atoms participating in each
individual interaction, and we don't treat them in the non-bonded or
PME code. Examples: bonded, 1-4, various restraints

Added basic Doxygen support for this module, which makes the existing
documentation visible and the new include sorting functional. Added
basic Doxygen for many functions, but not thirty-plus actual "compute
this kind of interaction" functions (to come later).

Fixed various higher-level code and documentation to refer more
accurately to listed interactions (e.g. GMX_FORCE_LISTED, ewcsLISTED).

Also removed an unecessary extern "C" for restcbt.h, and removed
unecessary include of genborn.h for bonded.h

Change-Id: If2271eab53a952058b0ed9ff92bd7a326c1797cd
Converted swap module to C++.

Change-Id: I904c142bb9ee20cf13a01219fb4066d18a802a2c