Avoid stack overflow on Windows with CMake > 2.8.10.2

CMake used to add "/STACK:10000000" to the default linker flags. That
was removed in version 2.8.11-rc1. The default value used by MSVC is
apparently too small because mdrun crashes with a stack overflow when
built on Windows with MSVC or ICC and CMake newer than 2.8.10.2.

The issue is already fixed in GROMACS 5.0 and master by I1e9858ae3. This
is a backport for release-4-6 of that commit.

Change-Id: Ib9238e513da8e86049d9e56c82262055d3c8b349
Fixed output of eigenvalues in g_covar. Fixes #1575

Commit 972032bfb8cd38 introduced a bug that would lead to eigenvalues
only written to .xvg file if "-last" is explicitly stated on the
command line. Otherwise no eigenvalues would appear in the .xvg file.
The eigenvalues are written in a loop from '0' to 'end', but since
'end' is initialized with '-1', the loop would never be executed.
This patch moves the code that computes 'end' one block upwards
before the output to file.

Change-Id: I738c9dd77ff9e6e2daae89b6d2063755dfba88af
Fixed bugs in vsiteN with OpenMP

Fixes #1579.

Change-Id: I42d234f4ad6a94e8f7b6b8236ea119860dd9f7ab
Fixed two PME issues with MPI+OpenMP

Change 272736bc partially fixed #1388, but broke the more general
case of multiple MPI communication pulses in PME. Change 272736bc
incorrectly changed tx1 and ty1. This change has been reverted.

Change 27189bba fixed the incorrect PME grid reduction with multiple
thread grid overlap in y. But it broke the, much more common, case
where the y-size of the PME grid is not divisible by the domains in y.
This change, incorrectly, changed buf_my.

Now buf_my is set to the correct value, which solves both issues.

Fixes #1578.
Refs #1388 and #1572.

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

Conflicts:
	src/gromacs/fileio/gmxfio.c
Used new release-4-6 code calling renamed md5 functions

	src/gromacs/gmxana/gmx_covar.c
Used gmx_ffclose, not ffclose, for file opened with xvgropen.

Change-Id: If6f9cb61bf7eab06dfdc61a03ad89ed38d599382
Version bump after 4.6.7

Change-Id: I1f2e73c2b94f31b67e65bf7cf188fb542391ab4d
Fixes issue with vsiten and verlet buffers.

A loop counter for a loop over vsiten did not take into
account that multiple entries make up one vsiten
particle. Part of #1579.

Change-Id: Ic9a79e89ea9ef8f9f529c9d4a6c5cf05f65e9c7d
Added negative zero preprocessor constants

We had some discussions already when we started using negative
zero that it could be fragile on some compilers, and apparently
PGI is one of them. Maybe not the most important target, but it
makes sense to have a common constant in one place, and it can
also save some cycles in tight loops to clearly separate float
from double versions so we avoid extra precision conversions.

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

Conflicts:
	CMakeLists.txt
Left version stuff in release-5-0 alone, because they should be
unaffected by release-4-6 version bumps.

Change-Id: I000cba25affa818b9e4283e85ae8cdf61f7c53a1
Fixes and updates to BlueGene/Q support

Stopped hard-coding compilers, since these vary between sites. Moved
compiler suppressions to gmxCFlags to follow standard practice better.

Permitted use of software invsqrt, even though you don't want to use
it.

Suppressed several kinds of false-alarm warnings with whole-of-source
compiler suppressions. I would preferred to keep the suppressions as
file-level compiler flags, but the way we compile our list of source
files for libgromacs makes this inconvenient, and the compiler would
not accept the PBC-related suppression as a pragma, either. Build is
now finally free of warnings (so long as you don't use the built-in
LAPACK with bgclang-3.5). Restructured some helper functions that
return strings whose getters might throw, so that there is a return
value that will keep compilers happy in all cases.

Change-Id: I7158e165575934be2b76beee7c10f860ccf58b76
Merge "Merge branch release-4-6 into release-5-0" into release-5-0
Fix and document issues with template.cpp

Boost is a requirement for the template, so the FindGROMACS.cmake
needs machinery to deal with that. It will now find the Boost internal
to GROMACS.

pkg-config generally helps (if available and GMXRC is sourced), and
that use is now documented in the README.

Finding the GROMACS libraries and headers is also a requirement.  This
now works whether or not the user has sourced GMXRC or has pkg-config
installed. The user can over-ride this with CMAKE_PREFIX_PATH if they
want to.

The template needs to use the same compiler and compiler flags for
post-C++98 support, and this is now documented in the README. In
master branch, some of these issues are side-stepped, so take due care
when merging.

Fixes #1554

Change-Id: Id30cf5149ead4a3f719499e37776a00f08309afc
When writing TNG include file closing in wallcycle.

If there is an unwritten frame set when closing a TNG file
it will be written to disk. This includes compressing the
data (when writing compressed output), which can take a
significant amount of time if the system is large.
This should be included in the wallcycle count to make it
more fair.

Change-Id: Ida43fe73b8bc1b0c1326e286a4bff647410da45f
Updated x-axis label for g_wham.

It was confusing to label it "z" as this is not conventional notation
and several users have interpreted the output as applying only to the
z-axis.  This commit updates the x-axis label to be the more conventional
Greek "xi" used for reaction coordinates.

Change-Id: Ib60af7b03155a792792d3496184d298c834389e9
TNG: Handle large files on 32 bit systems.

Force 64 bit file positions and sizes to make sure that files
>2 GB work.

Change-Id: I70ea7fb96891dfa2d18d6188677e946b3a0a0ac6
Fixed string var expansion in CMake due to CMP0053

CMake policy 0053 means they are deprecating the usage of
@VAR@ in CMakefiles, so CMake-3.0.2 has started to
issue big warnings about this. Replace them with ${VAR}.

Change-Id: I4e63a4eb038edbc27019bfb89c7106e97aa194c2
Fix data block length when uncompressing TNG data.

Also, if there are no bonds in a molecule do not reserve
memory for them (to avoid a returned NULL pointer).

Change-Id: I06f9ad71711174017a229faec53d6dca08ee99d0
TNG Fix for GMX_DOUBLE builds and where ZLIB is not available.

Also includes a check that the user name can be retrieved
before trying to set it.

Change-Id: I51d4ab2e590752980953d1926d4bea56fe1beffa
Fix PRINT_ALLOC_KB output

Only an issue when compiled with -DPRINT_ALLOC_KB

Change-Id: I0fed328ba8e8f943ece3b38f63ce5b6cf84f0f5e