Fixes bug in g_hbond that makes it produce fatal error.

Rather than crashing with a range check error when there
are no hydrogen bonds the code now prints to stderr and
continues normally.

Change-Id: Idc9fddf8bfac9989bc1aa3a9c552b08580f99949
Merge "Fixes bug in g_hbond that makes it produce fatal error." into release-4-5-patches
Use stat for gmx_is_file. Fix get_libdir with symlinks.

In commit 4e057440520c1 I used lstat instead of stat confusing the
two. The commit tried to fix the misidentification of directories.
There is no need to distinquish between symlinks and files (and
thus break it if a binary is a symlink).

Change-Id: Ie964e826729a35f11516fb3d002ebc01cbb7a564
Extended build information output and reference build type

mdrun -version (and -version flag for other binaries as well) now
contains more information about what was compiled in, as well as
compiler information and versions of external libraries used.
Also added C++ compiler information to mdrun log output.
When GPU builds are enabled there is also version information
about CUDA SDK, nvcc, driver and runtime.

A new "Reference" build type has been added to CMake. This turns
off lots of options and should be used when generating reference
values for our regression tests.

Change-Id: I7532bebdaeb1207c4f6e69d422b0f13da83e3960
added nbnxn analytical Ewald correction kernels

In single precision on Bulldozer these kernels are 15% faster than
the quadratic-spline table correction, on Sandy Bridge 2%.
These kernels are only selected with AVX in single precision.

Change-Id: I1c3eb3b24b5570107fe3fa0c4b03fe5e215c79c8
Fixes #1035 NaN in g_cluster output.

Now always initializes the masses of the atoms to prevent
division by zero downstream.

Change-Id: I1b38ccc7982d4340ed068535f7b7dd8e75e1a4c4
Merge "Extended build information output and reference build type" into release-4-6
Made the linear extrapolation in g_bar non-default behavior

g_bar currently resorts to linear extrapolation of dH/dl if
it doesn't find covering foreign lambda deltaH values. This is
dangerous because the most likely case of this being used is when
the user forgets to set foreign lambdas.

This commit adds an option -extp to g_bar that the user must
explictily set to enable the linear extrapolation. If not, and
there is no foreign_lambda path, g_bar prints an error message
with details of what to do.

Change-Id: Ib39f964b4f43f79379f00a3331ea4dc88183ed63
Clean up some mathematical constants

Replaced some hard-coded floats with unified constants in include/maths.h,
and made most places refer to them. Also added note that care is needed
about float-sized constants in CUDA code.

Change-Id: Icf1ec0b81179792d5e6d4d4ab9b38af3a38d7770
made nbnxn analytical Ewald consistent

The recent addition of nbnxn analytical Ewald kernels switched those
kernels on for local interactions, but not for non-local domains.
This performance bug has been fixed.

Change-Id: I28abc822ee8f1cf8f7dbb5c516703145400441b2
Merge "Use stat for gmx_is_file. Fix get_libdir with symlinks." into release-4-5-patches
Merge "Clean up some mathematical constants" into release-4-6
Merge release-4-5-patches into release-4-6

Conflicts (both trivial):
	CMakeLists.txt
	src/config.h.cmakein

Change-Id: I363ce1c09c68c2be5aa926e893011d43c8ed3337
Fixed issues with g_bar help text.

Fixed Latex issues and formatting in the g_bar help text.

Change-Id: I8e509d6de9ae998e4c632ffaa1be11c839f3e8f6
Added affinity support check, visibility macros in thread_mpi

- Fixed a bug where the return value of tMPI_Thread_setaffinity_single()
  is not 0 when there is no error under Windows.
- Added a function tMPI_Thread_setaffinity_support() that returns
  whether the platform supports setting thread affinity
- Added dynamic library visibility support macros

Change-Id: I9f74c5095bccc06b413443dd6a1ac2dd56e0d4b8
fixed bug in nbnxn OpenMP non-bonded force reduction

Fixed bug introduced recently in 4a50973c which caused the force
reduction to ignore some non-bonded forces with OpenMP and
domain decomposition.

Change-Id: I359deac21365c844b9af828ba7ddbea26e3fc296
Merge "Merge release-4-5-patches into release-4-6" into release-4-6
Merge "fixed bug in nbnxn OpenMP non-bonded force reduction" into release-4-6
Merge "Added affinity support check, visibility macros in thread_mpi" into release-4-6
Add visibility defines

This adds visibility declarations for functions and variables used
outside of a library. This enables shared linking on Windows and
thus makes the binaries much smaller. It doesn't effect any other
build because the defines are set to empty by default.

With GCC the correctness can be tested by adding to CFLAGS:
-fvisibility=hidden -DUSE_VISIBILITY

Related to #701

Change-Id: Ied261586e49bae11c5f8a8dffe377f0b0f02dd9d