Improve nvcc error reporting
authorMark Abraham <mark.j.abraham@gmail.com>
Thu, 10 Jan 2019 09:07:59 +0000 (10:07 +0100)
committerSzilárd Páll <pall.szilard@gmail.com>
Fri, 18 Jan 2019 12:51:08 +0000 (13:51 +0100)
When nvcc fails, tell the user about both standard error and standard
output. The former code was broken if _cuda_test_err would be
undefined, and reported by a user (see the link at Redmine #2500).

Change-Id: Id16d2ff1bd1033cd23e82687b79409ea8d841131

cmake/gmxManageNvccConfig.cmake

index ba338394bbdefc0b69234e37d83fd378ff6840d4..b33335173f1bfeea07facb91801b48c2223597f4 100644 (file)
@@ -1,7 +1,7 @@
 #
 # This file is part of the GROMACS molecular simulation package.
 #
-# Copyright (c) 2012,2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
+# Copyright (c) 2012,2013,2014,2015,2016,2017,2018,2019, 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.
@@ -177,8 +177,9 @@ if(_cuda_nvcc_executable_or_flags_changed OR CUDA_HOST_COMPILER_CHANGED OR NOT G
         OUTPUT_STRIP_TRAILING_WHITESPACE)
 
     if(${_cuda_test_res})
-        message(${_cuda_test_err})
         message(STATUS "Check for working NVCC/C compiler combination - broken")
+        message(STATUS "${CUDA_NVCC_EXECUTABLE} standard output: '${_cuda_test_out}'")
+        message(STATUS "${CUDA_NVCC_EXECUTABLE} standard error:  '${_cuda_test_err}'")
         if(${_cuda_test_err} MATCHES "nsupported")
             message(FATAL_ERROR "NVCC/C compiler combination does not seem to be supported. CUDA frequently does not support the latest versions of the host compiler, so you might want to try an earlier C/C++ compiler version and make sure your CUDA compiler and driver are as recent as possible.")
         else()