Merge branch release-5-1
authorMark Abraham <mark.j.abraham@gmail.com>
Wed, 27 Jan 2016 12:24:24 +0000 (13:24 +0100)
committerMark Abraham <mark.j.abraham@gmail.com>
Wed, 27 Jan 2016 12:24:24 +0000 (13:24 +0100)
Change-Id: Iefe28408022b6964e7b1cbab07032f5d110c5f6b

1  2 
cmake/gmxManageGPU.cmake
cmake/gmxManageSimd.cmake
docs/install-guide/index.rst

diff --combined cmake/gmxManageGPU.cmake
index eb889d9e471870185c8c2412c231cd08de596366,1caef5d0b84d727c63db957e8a5fac9a2b68b2d4..9b4f328ce71be9b7e6fd847d637ca8560f6ea570
@@@ -76,6 -76,14 +76,6 @@@ if(GMX_GPU OR GMX_GPU_AUTO AND CAN_RUN_
      endif()
      find_package(CUDA ${REQUIRED_CUDA_VERSION} ${FIND_CUDA_QUIETLY})
  
 -    # The IBM xlc compiler chokes if we use both altivec and Cuda. Solve
 -    # this by not propagating the flags in this case, but add -O3
 -    # to make sure we don't turn off optimization.
 -    if(CMAKE_CXX_COMPILER_ID MATCHES "XL")
 -        set(CUDA_PROPAGATE_HOST_FLAGS OFF)
 -        list(APPEND CUDA_NVCC_FLAGS "-O3")
 -    endif()
 -
      # Cmake 2.8.12 (and CMake 3.0) introduced a new bug where the cuda
      # library dir is added twice as an rpath on APPLE, which in turn causes
      # the install_name_tool to wreck the binaries when it tries to remove this
@@@ -137,7 -145,7 +137,7 @@@ ${_msg}"
      if (NOT CUDA_FOUND)
          if (GMX_GPU_AUTO)
              # Disable GPU acceleration in auto mode
 -            message(STATUS "No compatible CUDA toolkit found (v4.0+), disabling native GPU acceleration")
 +            message(STATUS "No compatible CUDA toolkit found (v5.0+), disabling native GPU acceleration")
              set_property(CACHE GMX_GPU PROPERTY VALUE OFF)
              set(CUDA_NOTFOUND_AUTO ON)
          else()
@@@ -158,7 -166,7 +158,7 @@@ if (GMX_GPU
          set(NVML_FIND_QUIETLY TRUE)
      endif()
      find_package(NVML)
-     option(GMX_USE_NVML "Use NVML support for better CUDA performance" ${HAVE_NVML})
+     option(GMX_USE_NVML "Use NVML support for better CUDA performance" ${NVML_FOUND})
      mark_as_advanced(GMX_USE_NVML)
      if(GMX_USE_NVML)
          if(NVML_FOUND)
@@@ -217,68 -225,52 +217,68 @@@ macro(get_cuda_compiler_info COMPILER_I
      endif()
  endmacro ()
  
 +include(CMakeDependentOption)
 +include(gmxOptionUtilities)
  macro(gmx_gpu_setup)
 -    # set up nvcc options
 -    include(gmxManageNvccConfig)
 +    if(GMX_GPU)
 +        # set up nvcc options
 +        include(gmxManageNvccConfig)
  
 -    gmx_check_if_changed(_cuda_version_changed CUDA_VERSION)
 +        gmx_check_if_changed(_cuda_version_changed CUDA_VERSION)
  
 -    # Generate CUDA RT API version string which will end up in config.h
 -    # We do this because nvcc is silly enough to not define its own version
 -    # (which should match the CUDA runtime API version AFAICT) and we want to
 -    # avoid creating the fragile dependency on cuda_runtime_api.h.
 -    #
 -    # NOTE: CUDA v7.5 is expected to have nvcc define it own version, so in the
 -    # future we should switch to using that version string instead of our own.
 -    if (NOT GMX_CUDA_VERSION OR _cuda_version_changed)
 -        MATH(EXPR GMX_CUDA_VERSION "${CUDA_VERSION_MAJOR}*1000 + ${CUDA_VERSION_MINOR}*10")
 -    endif()
 +        # Generate CUDA RT API version string which will end up in config.h
 +        # We do this because nvcc is silly enough to not define its own version
 +        # (which should match the CUDA runtime API version AFAICT) and we want to
 +        # avoid creating the fragile dependency on cuda_runtime_api.h.
 +        #
 +        # NOTE: CUDA v7.5 is expected to have nvcc define it own version, so in the
 +        # future we should switch to using that version string instead of our own.
 +        if (NOT GMX_CUDA_VERSION OR _cuda_version_changed)
 +            MATH(EXPR GMX_CUDA_VERSION "${CUDA_VERSION_MAJOR}*1000 + ${CUDA_VERSION_MINOR}*10")
 +        endif()
  
 -    if (_cuda_version_changed)
 -        # check the generated CUDA API version against the one present in cuda_runtime_api.h
 -        try_compile(_get_cuda_version_compile_res
 -            ${CMAKE_BINARY_DIR}
 -            ${CMAKE_SOURCE_DIR}/cmake/TestCUDAVersion.c
 -            COMPILE_DEFINITIONS "-DGMX_CUDA_VERSION=${GMX_CUDA_VERSION}"
 -            CMAKE_FLAGS "-DINCLUDE_DIRECTORIES=${CUDA_TOOLKIT_INCLUDE}"
 -            OUTPUT_VARIABLE _get_cuda_version_compile_out)
 +        if (_cuda_version_changed)
 +            # check the generated CUDA API version against the one present in cuda_runtime_api.h
 +            try_compile(_get_cuda_version_compile_res
 +                ${CMAKE_BINARY_DIR}
 +                ${CMAKE_SOURCE_DIR}/cmake/TestCUDAVersion.c
 +                COMPILE_DEFINITIONS "-DGMX_CUDA_VERSION=${GMX_CUDA_VERSION}"
 +                CMAKE_FLAGS "-DINCLUDE_DIRECTORIES=${CUDA_TOOLKIT_INCLUDE}"
 +                OUTPUT_VARIABLE _get_cuda_version_compile_out)
  
 -        if (NOT _get_cuda_version_compile_res)
 -            if (_get_cuda_version_compile_out MATCHES "CUDA version mismatch")
 -                message(FATAL_ERROR "The CUDA API version generated internally from the compiler version does not match the version reported by cuda.h. This means either that the CUDA detection picked up mismatching nvcc and the CUDA headers (likely not part of the same toolkit installation) or that there is an error in the internal version generation. If you are sure that it is not the former causing the error (check the relevant cache variables), define the GMX_CUDA_VERSION cache variable to work around the error.")
 -            else()
 -                message(FATAL_ERROR "Could not detect CUDA runtime API version")
 +            if (NOT _get_cuda_version_compile_res)
 +                if (_get_cuda_version_compile_out MATCHES "CUDA version mismatch")
 +                    message(FATAL_ERROR "The CUDA API version generated internally from the compiler version does not match the version reported by cuda.h. This means either that the CUDA detection picked up mismatching nvcc and the CUDA headers (likely not part of the same toolkit installation) or that there is an error in the internal version generation. If you are sure that it is not the former causing the error (check the relevant cache variables), define the GMX_CUDA_VERSION cache variable to work around the error.")
 +                else()
 +                    message(FATAL_ERROR "Could not detect CUDA runtime API version")
 +                endif()
              endif()
          endif()
 -    endif()
  
 -    # texture objects are supported in CUDA 5.0 and later
 -    if (CUDA_VERSION VERSION_GREATER 4.999)
 -        set(HAVE_CUDA_TEXOBJ_SUPPORT 1)
 -    endif()
 +        # no OpenMP is no good!
 +        if(NOT GMX_OPENMP)
 +            message(WARNING "To use GPU acceleration efficiently, mdrun requires OpenMP multi-threading. Without OpenMP a single CPU core can be used with a GPU which is not optimal. Note that with MPI multiple processes can be forced to use a single GPU, but this is typically inefficient. You need to set both C and C++ compilers that support OpenMP (CC and CXX environment variables, respectively) when using GPUs.")
 +        endif()
 +    endif() # GMX_GPU
  
 -    # Atomic operations used for polling wait for GPU
 -    # (to avoid the cudaStreamSynchronize + ECC bug).
 -    # ThreadMPI is now always included. Thus, we don't check for Atomics anymore here.
 +    cmake_dependent_option(GMX_CUDA_NB_SINGLE_COMPILATION_UNIT
 +        "Whether to compile the CUDA non-bonded module using a single compilation unit." ON
 +        "GMX_GPU" ON)
 +    mark_as_advanced(GMX_CUDA_NB_SINGLE_COMPILATION_UNIT)
  
 -    # no OpenMP is no good!
 -    if(NOT GMX_OPENMP)
 -        message(WARNING "To use GPU acceleration efficiently, mdrun requires OpenMP multi-threading. Without OpenMP a single CPU core can be used with a GPU which is not optimal. Note that with MPI multiple processes can be forced to use a single GPU, but this is typically inefficient. You need to set both C and C++ compilers that support OpenMP (CC and CXX environment variables, respectively) when using GPUs.")
 +    if (GMX_GPU)
 +        # We need to use single compilation unit for kernels:
 +        # - when compiling for CC 2.x devices where buggy kernel code is generated
 +        gmx_check_if_changed(_gmx_cuda_target_changed GMX_CUDA_TARGET_SM GMX_CUDA_TARGET_COMPUTE CUDA_NVCC_FLAGS)
 +        if(_gmx_cuda_target_changed OR NOT GMX_GPU_DETECTION_DONE)
 +            if((NOT GMX_CUDA_TARGET_SM AND NOT GMX_CUDA_TARGET_COMPUTE) OR
 +               (GMX_CUDA_TARGET_SM MATCHES "2[01]" OR GMX_CUDA_TARGET_COMPUTE MATCHES "2[01]"))
 +               message(STATUS "Enabling single compilation unit for the CUDA non-bonded module. Multiple compilation units are not compatible with CC 2.x devices, to enable the feature specify only CC >=3.0 target architectures in GMX_CUDA_TARGET_SM/GMX_CUDA_TARGET_COMPUTE.")
 +                set_property(CACHE GMX_CUDA_NB_SINGLE_COMPILATION_UNIT PROPERTY VALUE ON)
 +            else()
 +                message(STATUS "Enabling multiple compilation units for the CUDA non-bonded module.")
 +                set_property(CACHE GMX_CUDA_NB_SINGLE_COMPILATION_UNIT PROPERTY VALUE OFF)
 +            endif()
 +        endif()
      endif()
  endmacro()
index 66fe788f5f1b084fcb4aa2ccf8a1287ad38fae0d,255ea7fc077b3b15e1c7957d2b0266f945a514d2..959ac77fc0c09834a64b29506b63ec4abec42e16
@@@ -1,7 -1,7 +1,7 @@@
  #
  # This file is part of the GROMACS molecular simulation package.
  #
- # Copyright (c) 2012,2013,2014,2015, by the GROMACS development team, led by
+ # Copyright (c) 2012,2013,2014,2015,2016, by the GROMACS development team, led by
  # Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  # and including many others, as listed in the AUTHORS file in the
  # top-level source directory and at http://www.gromacs.org.
@@@ -51,6 -51,21 +51,21 @@@ macro(gmx_use_clang_as_with_gnu_compile
      endif()
  endmacro()
  
+ # Issue a fatal error with an appropriate message, when the toolchain
+ # was not able to compile code for SIMD support.
+ #
+ # Inputs:
+ #  SIMD_STRING              A string describing the kind of SIMD support that didn't work.
+ #  ALTERNATIVE_SUGGESTION   A string describing anything the user could try other than getting a new compiler.
+ #  SUGGEST_BINUTILS_UPDATE  True when there's information that the compiler was OK, but something else was not.
+ function(gmx_give_fatal_error_when_simd_support_not_found SIMD_STRING ALTERNATIVE_SUGGESTION SUGGEST_BINUTILS_UPDATE)
+     if(SUGGEST_BINUTILS_UPDATE)
+         set(_msg "Found a compiler flag for ${SIMD_STRING} support, but some other problem exists. Update your assembler and/or linker, e.g. in the binutils package of your distribution.")
+     else()
+         set(_msg "Cannot find ${SIMD_STRING} compiler flag. Use a newer compiler, or ${ALTERNATIVE_SUGGESTION}.")
+     endif()
+     message(FATAL_ERROR ${_msg})
+ endfunction()
  
  macro(gmx_manage_simd)
  
@@@ -103,7 -118,7 +118,7 @@@ elseif(GMX_SIMD STREQUAL "SSE2"
                                  "-msse2" "/arch:SSE2" "-hgnu")
  
      if(NOT CFLAGS_SSE2 OR NOT CXXFLAGS_SSE2)
-         message(FATAL_ERROR "Cannot find SSE2 compiler flag. Use a newer compiler, or disable SIMD (slower).")
+         gmx_give_fatal_error_when_simd_support_not_found("SSE2" "disable SIMD support (slow)" "${SUGGEST_BINUTILS_UPDATE}")
      endif()
  
      set(GMX_SIMD_X86_SSE2 1)
@@@ -124,8 -139,7 +139,7 @@@ elseif(GMX_SIMD STREQUAL "SSE4.1"
                                  "-msse4.1" "/arch:SSE4.1" "/arch:SSE2" "-hgnu")
  
      if(NOT CFLAGS_SSE4_1 OR NOT CXXFLAGS_SSE4_1)
-         message(FATAL_ERROR "Cannot find SSE4.1 compiler flag. "
-                             "Use a newer compiler, or choose SSE2 SIMD (slower).")
+         gmx_give_fatal_error_when_simd_support_not_found("SSE4.1" "choose SSE2 SIMD (slower)" "${SUGGEST_BINUTILS_UPDATE}")
      endif()
  
      if(CMAKE_C_COMPILER_ID MATCHES "Intel" AND CMAKE_C_COMPILER_VERSION VERSION_EQUAL "11.1")
@@@ -184,7 -198,7 +198,7 @@@ int main(){__m128 x=_mm_set1_ps(0.5);x=
  
      # We only need to check the last (FMA) test; that will always fail if the basic AVX128 test failed
      if(NOT CFLAGS_AVX_128_FMA OR NOT CXXFLAGS_AVX_128_FMA)
-         message(FATAL_ERROR "Cannot find compiler flags for 128 bit AVX with FMA support. Use a newer compiler, or choose SSE4.1 SIMD (slower).")
+         gmx_give_fatal_error_when_simd_support_not_found("128-bit AVX with FMA support" "choose SSE4.1 SIMD (slower)" "${SUGGEST_BINUTILS_UPDATE}")
      endif()
  
      ### STAGE 3: Optional: Find the XOP instruction flag (No point in yelling if this does not work)
@@@ -244,7 -258,7 +258,7 @@@ elseif(GMX_SIMD STREQUAL "AVX_256"
                                  "-mavx" "/arch:AVX" "-hgnu")
  
      if(NOT CFLAGS_AVX OR NOT CXXFLAGS_AVX)
-         message(FATAL_ERROR "Cannot find AVX compiler flag. Use a newer compiler, or choose SSE4.1 SIMD (slower).")
+         gmx_give_fatal_error_when_simd_support_not_found("AVX" "choose SSE4.1 SIMD (slower)" "${SUGGEST_BINUTILS_UPDATE}")
      endif()
  
      gmx_test_avx_gcc_maskload_bug(GMX_SIMD_X86_AVX_GCC_MASKLOAD_BUG "${SIMD_C_FLAGS}")
@@@ -268,7 -282,7 +282,7 @@@ elseif(GMX_SIMD STREQUAL "AVX2_256"
                                  "-march=core-avx2" "-mavx2" "/arch:AVX" "-hgnu") # no AVX2-specific flag for MSVC yet
  
      if(NOT CFLAGS_AVX2 OR NOT CXXFLAGS_AVX2)
-         message(FATAL_ERROR "Cannot find AVX2 compiler flag. Use a newer compiler, or choose AVX SIMD (slower).")
+         gmx_give_fatal_error_when_simd_support_not_found("AVX2" "choose AVX SIMD (slower)" "${SUGGEST_BINUTILS_UPDATE}")
      endif()
  
      # No need to test for Maskload bug - it was fixed before gcc added AVX2 support
@@@ -298,7 -312,7 +312,7 @@@ elseif(GMX_SIMD STREQUAL "AVX_512F"
                                  "-xMIC-AVX512" "-mavx512f" "/arch:AVX" "-hgnu") # no AVX_512F flags known for MSVC yet
  
      if(NOT CFLAGS_AVX_512F OR NOT CXXFLAGS_AVX_512F)
-         message(FATAL_ERROR "Cannot find AVX 512F compiler flag. Use a newer compiler, or choose a lower level of SIMD")
+         gmx_give_fatal_error_when_simd_support_not_found("AVX 512F" "choose a lower level of SIMD (slower)" "${SUGGEST_BINUTILS_UPDATE}")
      endif()
  
      set(GMX_SIMD_X86_AVX_512F 1)
@@@ -320,7 -334,7 +334,7 @@@ elseif(GMX_SIMD STREQUAL "AVX_512ER"
                                  "-xMIC-AVX512" "-mavx512er" "/arch:AVX" "-hgnu") # no AVX_512ER flags known for MSVC yet
  
      if(NOT CFLAGS_AVX_512ER OR NOT CXXFLAGS_AVX_512ER)
-         message(FATAL_ERROR "Cannot find AVX 512ER compiler flag. Use a newer compiler, or choose a lower level of SIMD")
+         gmx_give_fatal_error_when_simd_support_not_found("AVX 512ER" "choose a lower level of SIMD (slower)" "${SUGGEST_BINUTILS_UPDATE}")
      endif()
  
      set(GMX_SIMD_X86_AVX_512ER 1)
  
  elseif(GMX_SIMD STREQUAL "ARM_NEON")
  
 -    gmx_find_cflag_for_source(CFLAGS_ARM_NEON "C compiler 32-bit ARM NEON flag"
 +    gmx_find_cflag_for_source(CFLAGS_ARM_NEON "C compiler ARM NEON flag"
                                "#include<arm_neon.h>
                                int main(){float32x4_t x=vdupq_n_f32(0.5);x=vmlaq_f32(x,x,x);return vgetq_lane_f32(x,0)>0;}"
                                SIMD_C_FLAGS
 -                              "-mfpu=neon" "")
 -    gmx_find_cxxflag_for_source(CXXFLAGS_ARM_NEON "C++ compiler 32-bit ARM NEON flag"
 +                              "-mfpu=neon-vfpv4" "-mfpu=neon" "")
 +    gmx_find_cxxflag_for_source(CXXFLAGS_ARM_NEON "C++ compiler ARM NEON flag"
                                  "#include<arm_neon.h>
                                  int main(){float32x4_t x=vdupq_n_f32(0.5);x=vmlaq_f32(x,x,x);return vgetq_lane_f32(x,0)>0;}"
                                  SIMD_CXX_FLAGS
 -                                "-mfpu=neon" "-D__STDC_CONSTANT_MACROS" "")
 +                                "-mfpu=neon-vfpv4" "-mfpu=neon" "-D__STDC_CONSTANT_MACROS" "")
  
      if(NOT CFLAGS_ARM_NEON OR NOT CXXFLAGS_ARM_NEON)
-         message(FATAL_ERROR "Cannot find ARM NEON compiler flag. Use a newer compiler, or disable NEON SIMD.")
 -        gmx_give_fatal_error_when_simd_support_not_found("ARM 32-bit NEON" "disable SIMD support (slower)" "${SUGGEST_BINUTILS_UPDATE}")
++        gmx_give_fatal_error_when_simd_support_not_found("ARM NEON" "disable SIMD support (slower)" "${SUGGEST_BINUTILS_UPDATE}")
      endif()
  
      set(GMX_SIMD_ARM_NEON 1)
      set(SIMD_STATUS_MESSAGE "Enabling 32-bit ARM NEON SIMD instructions")
  
  elseif(GMX_SIMD STREQUAL "ARM_NEON_ASIMD")
 -    # Gcc-4.8.1 appears to have a bug where the c++ compiler requires
 -    # -D__STDC_CONSTANT_MACROS if we include arm_neon.h
  
      gmx_find_cflag_for_source(CFLAGS_ARM_NEON_ASIMD "C compiler ARM NEON Advanced SIMD flag"
                                "#include<arm_neon.h>
 -                              int main(){float64x2_t x=vdupq_n_f64(0.5);x=vfmaq_f64(x,x,x);return vgetq_lane_f64(x,0)>0;}"
 +                               int main(){float64x2_t x=vdupq_n_f64(0.5);x=vfmaq_f64(x,x,x);x=vrndnq_f64(x);return vgetq_lane_f64(x,0)>0;}"
                                SIMD_C_FLAGS
                                "")
      gmx_find_cxxflag_for_source(CXXFLAGS_ARM_NEON_ASIMD "C++ compiler ARM NEON Advanced SIMD flag"
                                  "#include<arm_neon.h>
 -                                int main(){float64x2_t x=vdupq_n_f64(0.5);x=vfmaq_f64(x,x,x);return vgetq_lane_f64(x,0)>0;}"
 +                                int main(){float64x2_t x=vdupq_n_f64(0.5);x=vfmaq_f64(x,x,x);x=vrndnq_f64(x);return vgetq_lane_f64(x,0)>0;}"
                                  SIMD_CXX_FLAGS
 -                                "-D__STDC_CONSTANT_MACROS" "")
 +                                "")
  
      if(NOT CFLAGS_ARM_NEON_ASIMD OR NOT CXXFLAGS_ARM_NEON_ASIMD)
-         message(FATAL_ERROR "Compiler does not fully support ARM (AArch64) NEON Advanced SIMD. Use a newer compiler (gcc version 4.9 or later), or disable SIMD.")
 -        gmx_give_fatal_error_when_simd_support_not_found("ARM (AArch64) NEON Advanced SIMD" "disable SIMD support (slower)" "${SUGGEST_BINUTILS_UPDATE}")
 -    endif()
 -
 -    if(CMAKE_C_COMPILER_ID MATCHES "GNU" AND CMAKE_C_COMPILER_VERSION VERSION_LESS "4.9")
 -        message(WARNING "At least gcc-4.8.1 has many bugs for ARM (AArch64) NEON Advanced SIMD compilation. You might need gcc version 4.9 or later.")
++        gmx_give_fatal_error_when_simd_support_not_found("ARM (AArch64) NEON Advanced SIMD" "particularly gcc version 4.9 or later, or disable SIMD support (slower)" "${SUGGEST_BINUTILS_UPDATE}")
      endif()
  
      if(CMAKE_C_COMPILER_ID MATCHES "Clang" AND CMAKE_C_COMPILER_VERSION VERSION_LESS "3.4")
@@@ -381,7 -401,7 +395,7 @@@ elseif(GMX_SIMD STREQUAL "IBM_QPX"
          set(SIMD_STATUS_MESSAGE "Enabling IBM QPX SIMD instructions")
  
      else()
-         message(FATAL_ERROR "Cannot compile the requested IBM QPX intrinsics. If you are compiling for BlueGene/Q with the XL compilers, use 'cmake .. -DCMAKE_TOOLCHAIN_FILE=Platform/BlueGeneQ-static-XL-C' to set up the tool chain.")
+         gmx_give_fatal_error_when_simd_support_not_found("IBM QPX" "or 'cmake .. -DCMAKE_TOOLCHAIN_FILE=Platform/BlueGeneQ-static-XL-CXX' to set up the tool chain" "${SUGGEST_BINUTILS_UPDATE}")
      endif()
  
  elseif(GMX_SIMD STREQUAL "IBM_VMX")
                                  "-maltivec -mabi=altivec" "-qarch=auto -qaltivec")
  
      if(NOT CFLAGS_IBM_VMX OR NOT CXXFLAGS_IBM_VMX)
-         message(FATAL_ERROR "Cannot find IBM VMX SIMD compiler flag. Use a newer compiler, or disable VMX SIMD.")
+         gmx_give_fatal_error_when_simd_support_not_found("IBM VMX" "disable SIMD support (slower)" "${SUGGEST_BINUTILS_UPDATE}")
      endif()
  
      set(GMX_SIMD_IBM_VMX 1)
  
  elseif(GMX_SIMD STREQUAL "IBM_VSX")
  
 -    # Altivec was originally single-only, and it took a while for compilers
 -    # to support the double-precision features in VSX. 
 -    if(GMX_DOUBLE AND CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.9")
 -        message(FATAL_ERROR "Using VSX SIMD in double precision with GCC requires GCC-4.9 or later.")
 +    if(${CMAKE_CXX_COMPILER_ID} MATCHES "GNU" OR ${CMAKE_C_COMPILER_ID} MATCHES "GNU")
 +        # VSX uses the same function API as Altivec/VMX, so make sure we tune for the current CPU and not VMX.
 +        # By putting these flags here rather than in the general compiler flags file we can safely assume
 +        # that we are at least on Power7 since that is when VSX appeared.
 +        if(BUILD_CPU_BRAND MATCHES "POWER7")
 +            gmx_test_cflag(GNU_C_VSX_POWER7   "-mcpu=power7 -mtune=power7" SIMD_C_FLAGS)
 +            gmx_test_cflag(GNU_CXX_VSX_POWER7 "-mcpu=power7 -mtune=power7" SIMD_CXX_FLAGS)
 +        else()
 +            # Enable power8 vector extensions on all platforms except old Power7.
 +            gmx_test_cflag(GNU_C_VSX_POWER8   "-mcpu=power8 -mpower8-vector -mpower8-fusion -mdirect-move" SIMD_C_FLAGS)
 +            gmx_test_cflag(GNU_CXX_VSX_POWER8 "-mcpu=power8 -mpower8-vector -mpower8-fusion -mdirect-move" SIMD_CXX_FLAGS)
 +        endif()
 +        # Altivec was originally single-only, and it took a while for compilers
 +        # to support the double-precision features in VSX.
 +        if(GMX_DOUBLE AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.9")
 +            message(FATAL_ERROR "Using VSX SIMD in double precision with GCC requires GCC-4.9 or later.")
 +        endif()
      endif()
  
      gmx_find_cflag_for_source(CFLAGS_IBM_VSX "C compiler IBM VSX SIMD flag"
                                  "-mvsx" "-maltivec -mabi=altivec" "-qarch=auto -qaltivec")
  
      if(NOT CFLAGS_IBM_VSX OR NOT CXXFLAGS_IBM_VSX)
-         message(FATAL_ERROR "Cannot find IBM VSX SIMD compiler flag. Use a newer compiler, or disable VSX SIMD.")
+         gmx_give_fatal_error_when_simd_support_not_found("IBM VSX" "disable SIMD support (slower)" "${SUGGEST_BINUTILS_UPDATE}")
      endif()
  
      set(GMX_SIMD_IBM_VSX 1)
@@@ -483,24 -490,8 +497,24 @@@ endif(
  # Check if the compiler supports one of these, and in that case set gmx_simdcall
  # to that string. If we do not have any such calling convention modifier, set it
  # to an empty string.
 +#
 +# Update 2015-11-04: As of version 3.6, clang has added support for __vectorcall
 +# (also on Linux). This appears to be buggy for the reference SIMD
 +# implementation when using the Debug build (when functions are not inlined) 
 +# while it seems works fine for the actual SIMD implementations. This is likely
 +# because the reference build ends up passing lots of structures with arrays
 +# rather than actual vector data. For now we disable __vectorcall with clang
 +# when using the reference build.
 +# 
  if(NOT DEFINED GMX_SIMD_CALLING_CONVENTION)
 -    foreach(callconv __vectorcall __regcall "")
 +    if(GMX_TARGET_BGQ)
 +        set(CALLCONV_LIST " ")
 +    elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND GMX_SIMD STREQUAL "REFERENCE")
 +        set(CALLCONV_LIST __regcall " ")
 +    else()
 +        set(CALLCONV_LIST __vectorcall __regcall " ")
 +    endif()
 +    foreach(callconv ${CALLCONV_LIST})
          set(callconv_compile_var "_callconv_${callconv}")
          check_c_source_compiles("int ${callconv} f(int i) {return i;} int main(void) {return f(0);}" ${callconv_compile_var})
          if(${callconv_compile_var})
index 21cb69d763653dc66e5ddbe5c7958ffb931cbd46,c9e86f6a72666ff163ca2a425d5b5e409cf0d53b..ecda804883ce30b871b1554e80ac48584ae858e8
@@@ -89,36 -89,23 +89,39 @@@ system
  Compiler
  --------
  Technically, |Gromacs| can be compiled on any platform with an ANSI C99
 -and C++98 compiler, and their respective standard C/C++ libraries.
 -We use only a few C99 features, but note that the C++ compiler also needs to
 -support these C99 features (notably, int64_t and related things), which are not
 -part of the C++98 standard.
 +and C++11 compiler, and their respective standard C/C++ libraries.
 +GROMACS uses a subset of C99 and C++11. A not fully standard compliant
 +compiler might be able to compile GROMACS.
  Getting good performance on an OS and architecture requires choosing a
  good compiler. In practice, many compilers struggle to do a good job
  optimizing the |Gromacs| architecture-optimized SIMD kernels.
  
 +C++11 support requires both support in the compiler as well as in the
 +C++ library. Multiple compilers do not provide their own library
 +but use the system library. It is required to select a library with
 +sufficient C++11 support. Both the Intel and clang compiler on Linux use
 +the libstdc++ which comes with gcc as the default C++ library. 4.6.1 of
 +that library is required. Also the C++ library version has to be
 +supported by the compiler. To select the C++ library version use:
 +
 +* For Intel: ``CXXFLAGS=-gcc-name=/path/to/gcc/binary`` or make sure
 +  that the correct gcc version is first in path (e.g. by loading the gcc
 +  module)
 +* For clang: ``CFLAGS=--gcc-toolchain=/path/to/gcc/folder
 +  CXXFLAGS=--gcc-toolchain=/path/to/gcc/folder``. This folder should
 +  contain ``include/c++``.
 +* On Windows with e.g. Intel: at least MSVC 2013 is required. Load the
 +  enviroment with vcvarsall.bat.
 +
  For best performance, the |Gromacs| team strongly recommends you get the
  most recent version of your preferred compiler for your platform.
  There is a large amount of |Gromacs| code that depends on effective
  compiler optimization to get high performance. This makes |Gromacs|
  performance sensitive to the compiler used, and the binary will often
- only work on the hardware for which it is compiled.
+ only work on the hardware for which it is compiled. You may also need
+ the most recent version compiler toolchain components beside the
+ compiler itself (e.g. assembler or linker); these are often shipped by
+ the distribution's binutils package.
  
  * In particular, |Gromacs| includes a lot of explicit SIMD (single
    instruction, multiple data) optimization that suits
@@@ -316,6 -303,9 +319,6 @@@ Optional build component
  -------------------------
  * Compiling to run on NVIDIA GPUs requires CUDA_
  * Compiling to run on AMD GPUs requires OpenCL_
 -* An external Boost library can be used to provide better
 -  implementation support for smart pointers and exception handling,
 -  but the |Gromacs| source bundles a subset of Boost 1.55.0 as a fallback
  * Hardware-optimized BLAS and LAPACK libraries are useful
    for a few of the |Gromacs| utilities focused on normal modes and
    matrix manipulation, but they do not provide any benefits for normal
@@@ -1164,8 -1154,8 +1167,8 @@@ much everywhere, it is important that w
  it works because we have tested it. We do test on Linux, Windows, and
  Mac with a range of compilers and libraries for a range of our
  configuration options. Every commit in our git source code repository
 -is currently tested on x86 with gcc versions ranging from 4.1 through
 -5.1, and versions 12 through 15 of the Intel compiler as well as Clang
 +is currently tested on x86 with gcc versions ranging from 4.6 through
 +5.1, and versions 14 and 15 of the Intel compiler as well as Clang
  version 3.4 through 3.6. For this, we use a variety of GNU/Linux
  flavors and versions as well as recent versions of Mac OS X and Windows.  Under
  Windows we test both MSVC and the Intel compiler. For details, you can