*.a
*.exe
*.lib
-config.h
*.cache
log
Makefile
set(CMAKE_INSTALL_PREFIX "/usr/local/gromacs" CACHE STRING "Installation prefix (installation will need write permissions here)" FORCE)
endif()
+include(gmxBuildTypeReference)
+
if(NOT CMAKE_BUILD_TYPE)
- set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel." FORCE)
+ set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel Reference." FORCE)
endif(NOT CMAKE_BUILD_TYPE)
enable_language(C)
include(gmxCFlags)
gmx_c_flags()
-include(gmxGetCompilerVersion)
+include(gmxGetCompilerInfo)
get_compiler_version()
# gcc 4.4.x is buggy and crashes when compiling some files with O3 and OpenMP on.
message(FATAL_ERROR "
mdrun supports native GPU acceleration on NVIDIA hardware with compute
capability >=2.0. This requires the NVIDIA CUDA library, which was not
- found; the location can be hinted by setting CUDA_TOOLKIT_ROOT_DIR.
+ found; the location can be hinted by setting CUDA_TOOLKIT_ROOT_DIR as
+ a CMake option (It does not work as an environment variable).
+ The typical location would be /usr/local/cuda.
CPU or GPU acceleration can be selected at runtime, but if you are
sure you can not make use of GPU acceleration, disable it by setting
if(NOT GMX_OPENMP)
message(WARNING "
- In order to use GPU acceleration efficiently, mdrun requires OpenMP multithreding.
+ In order to use GPU acceleration efficiently, mdrun requires OpenMP multithreading.
Without OpenMP only a single CPU core per GPU can be used which is suboptimal.
Note that with MPI multiple processes can be forced to use a single GPU, but this
- typically inefficient.")
+ typically inefficient. Note that you need to set both C and C++ compilers that
+ support OpenMP (CC and CXX environment variables, respectively) when using GPUs.")
endif()
include(gmxManageNvccConfig)
include(ThreadMPI)
endif()
+ # Version info (semicolon used as line separator) for nvcc.
+ get_nvcc_version_info()
+
endif()
# Annoyingly enough, FindCUDA leaves a few variables behind as non-advanced.
# We need to mark these advanced outside the conditional, otherwise, if the user
GMX_TEST_CFLAG(MSVC_AVX_CFLAG "/arch:AVX" GROMACS_C_FLAGS)
endif (NOT GNU_AVX_CFLAG)
if (NOT GNU_AVX_CFLAG AND NOT MSVC_AVX_CFLAG)
- message(WARNING "No C AVX flag found. Consider a newer compiler, or disable AVX for much lower performance.")
+ message(WARNING "No C AVX flag found. Consider a newer compiler, or try SSE4.1 (lower performance).")
endif (NOT GNU_AVX_CFLAG AND NOT MSVC_AVX_CFLAG)
if (CMAKE_CXX_COMPILER_LOADED)
GMX_TEST_CXXFLAG(MSVC_AVX_CXXFLAG "/arch:AVX" GROMACS_CXX_FLAGS)
endif (NOT GNU_AVX_CXXFLAG)
if (NOT GNU_AVX_CXXFLAG AND NOT MSVC_AVX_CXXFLAG)
- message(WARNING "No C++ AVX flag found. Consider a newer compiler, or disable AVX for much lower performance.")
+ message(WARNING "No C++ AVX flag found. Consider a newer compiler, or try SSE4.1 (lower performance).")
endif (NOT GNU_AVX_CXXFLAG AND NOT MSVC_AVX_CXXFLAG)
endif()
if(${GMX_CPU_ACCELERATION} STREQUAL "AVX_128_FMA" AND NOT MSVC)
GMX_TEST_CFLAG(GNU_FMA_CFLAG "-mfma4" GROMACS_C_FLAGS)
if (NOT GNU_FMA_CFLAG)
- message(WARNING "No C FMA4 flag found. Consider a newer compiler, or disable AVX_128_FMA for much lower performance.")
+ message(WARNING "No C FMA4 flag found. Consider a newer compiler, or try SSE4.1 (lower performance).")
endif(NOT GNU_FMA_CFLAG)
if (CMAKE_CXX_COMPILER_LOADED)
GMX_TEST_CXXFLAG(GNU_FMA_CXXFLAG "-mfma4" GROMACS_CXX_FLAGS)
if (NOT GNU_FMA_CXXFLAG)
- message(WARNING "No C++ FMA flag found. Consider a newer compiler, or disable AVX_128_FMA for much lower performance.")
+ message(WARNING "No C++ FMA flag found. Consider a newer compiler, or try SSE4.1 (lower performance).")
endif (NOT GNU_FMA_CXXFLAG)
endif()
endif()
unset(OpenMP_LINKER_FLAGS CACHE)
unset(OpenMP_SHARED_LINKER_FLAGS)
endif()
+
######################################
# Output compiler and CFLAGS used
######################################
-execute_process(COMMAND ${CMAKE_C_COMPILER} --version RESULT_VARIABLE TMP_RESULT OUTPUT_VARIABLE CC_VERSION ERROR_VARIABLE CC_VERSION)
-#try executing just the compiler command if that failed...
-if(TMP_RESULT)
- execute_process(COMMAND ${CMAKE_C_COMPILER} RESULT_VARIABLE TMP_RESULT OUTPUT_VARIABLE CC_VERSION ERROR_VARIABLE CC_VERSION)
-endif()
-string(LENGTH "${CC_VERSION}" len)
-if(len)
- string(REGEX MATCH "[^\n]+" CC_VERSION "${CC_VERSION}")
-endif()
-
-set(BUILD_COMPILER "@CMAKE_C_COMPILER@ @CMAKE_C_COMPILER_ID@ @CC_VERSION@")
-set(BUILD_CFLAGS "@CMAKE_C_FLAGS@")
-if(CMAKE_BUILD_TYPE STREQUAL "Debug")
- set(BUILD_CFLAGS "@BUILD_CFLAGS@ @CMAKE_C_FLAGS_DEBUG@")
-elseif(CMAKE_BUILD_TYPE STREQUAL "Release")
- set(BUILD_CFLAGS "@BUILD_CFLAGS@ @CMAKE_C_FLAGS_RELEASE@")
-elseif(CMAKE_BUILD_TYPE STREQUAL "MinSizeRel")
- set(BUILD_CFLAGS "@BUILD_CFLAGS@ @CMAKE_C_FLAGS_MINSIZEREL@")
-elseif(CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")
- set(BUILD_CFLAGS "@BUILD_CFLAGS@ @CMAKE_C_FLAGS_RELWITHDEBINFO@")
-endif()
-
+get_compiler_info(C BUILD_C_COMPILER BUILD_CFLAGS)
+if (CMAKE_CXX_COMPILER_LOADED)
+ get_compiler_info(CXX BUILD_CXX_COMPILER BUILD_CXXFLAGS)
+endif ()
########################################################################
# Specify install locations and which subdirectories to process #
--- /dev/null
+# Custom build type "Reference", to be used for creating new
+# reference values in the Gromacs regression tests.
+set( CMAKE_CXX_FLAGS_REFERENCE "-O0 -g" CACHE STRING "C++ flags for regressiontests reference runs." FORCE)
+set( CMAKE_C_FLAGS_REFERENCE "-O0 -g" CACHE STRING "C flags for regressiontests reference runs." FORCE)
+mark_as_advanced( CMAKE_CXX_FLAGS_REFERENCE CMAKE_C_FLAGS_REFERENCE)
+
+# turn off all fancy options for the regressiontests reference build
+if("${CMAKE_BUILD_TYPE}" STREQUAL "Reference")
+ set(GMX_GPU OFF CACHE BOOL "Disabled for regressiontests reference builds" FORCE)
+ set(GMX_OPENMP OFF CACHE BOOL "Disabled for regressiontests reference builds" FORCE)
+ set(GMX_CPU_ACCELERATION "None" CACHE STRING "Disabled for regressiontests reference builds" FORCE)
+ set(GMX_FFT_LIBRARY "fftpack" CACHE STRING "Use fftpack for regressiontests reference builds" FORCE)
+ set(GMX_SOFTWARE_INVSQRT OFF CACHE BOOL "Disabled for regressiontests reference builds" FORCE)
+ set(GMX_THREAD_MPI OFF OFF CACHE BOOL "Disabled for regressiontests reference builds" FORCE)
+
+ if(NOT "${CMAKE_C_COMPILER_ID}" STREQUAL "GNU" OR NOT "${C_COMPILER_VERSION}" MATCHES "4.7")
+ message(WARNING "Reference values for regressiontests should use Gromacs compiled with "
+ "gcc-4.7, but your configuration is using ${CMAKE_C_COMPILER_ID}-${C_COMPILER_VERSION}.")
+ endif()
+endif()
--- /dev/null
+# This macro attempts to parse the version string of the C compiler in use.
+# Currently supported are only compilers that accept "-dumpversion" argument:
+# gcc, Intel Compiler (on Linux and Mac OS), Open64, EkoPath.
+#
+# C_COMPILER_VERSION - version string of the current C compiler (CMAKE_C_COMPILER)
+# CXX_COMPILER_VERSION - version string of the current C++ compiler (CMAKE_CXX_COMPILER)
+#
+macro(get_compiler_version)
+ if(NOT C_COMPILER_VERSION)
+ execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion
+ RESULT_VARIABLE _cc_dumpversion_res
+ OUTPUT_VARIABLE _cc_dumpversion_out
+ ERROR_VARIABLE _cc_dumpversion_err
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+
+ if (${_cc_dumpversion_res} EQUAL 0)
+ SET(C_COMPILER_VERSION ${_cc_dumpversion_out}
+ CACHE STRING "C compiler version string" FORCE)
+ else ()
+ SET(C_COMPILER_VERSION ""
+ CACHE STRING "C compiler version string not available" FORCE)
+ endif ()
+ endif()
+
+ if(NOT CXX_COMPILER_VERSION AND CMAKE_CXX_COMPILER_LOADED)
+ execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion
+ RESULT_VARIABLE _cxx_dumpversion_res
+ OUTPUT_VARIABLE _cxx_dumpversion_out
+ ERROR_VARIABLE _cxx_dumpversion_err
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+
+ if (${_cxx_dumpversion_res} EQUAL 0)
+ SET(CXX_COMPILER_VERSION ${_cxx_dumpversion_out}
+ CACHE STRING "C++ compiler version string" FORCE)
+ else ()
+ SET(CXX_COMPILER_VERSION ""
+ CACHE STRING "C++ compiler version string not available" FORCE)
+ endif ()
+ endif ()
+
+ if (NOT "${C_COMPILER_VERSION}" STREQUAL "${CXX_COMPILER_VERSION}" AND CMAKE_CXX_COMPILER_LOADED)
+ message(WARNING "The version string of the C and C++ compilers does not match!")
+ endif ()
+
+ mark_as_advanced(C_COMPILER_VERSION CXX_COMPILER_VERSION)
+endmacro()
+
+# This macro attempts to get a reasonable version string for a compiler,
+# and also extracts compiler flags.
+#
+# Parameters:
+# LANGUAGE - C or CXX, the compiler to check for
+# BUILD_COMPILER - [output variable] string with compiler path, ID and
+# some compiler-provided information
+# BUILD_FLAGS - [output variable] flags for the compiler
+#
+macro(get_compiler_info LANGUAGE BUILD_COMPILER BUILD_FLAGS)
+ execute_process(COMMAND ${CMAKE_${LANGUAGE}_COMPILER} --version
+ RESULT_VARIABLE _exec_result
+ OUTPUT_VARIABLE _compiler_version
+ ERROR_VARIABLE _compiler_version)
+ # Try executing just the compiler command --version failed
+ if(_exec_result)
+ execute_process(COMMAND ${CMAKE_${LANGUAGE}_COMPILER}
+ RESULT_VARIABLE _exec_result
+ OUTPUT_VARIABLE _compiler_version
+ ERROR_VARIABLE _compiler_version)
+ endif()
+ if(NOT "${_compiler_version}" STREQUAL "")
+ string(REGEX MATCH "[^\n]+" _compiler_version "${_compiler_version}")
+ endif()
+
+ set(${BUILD_COMPILER}
+ "${CMAKE_${LANGUAGE}_COMPILER} ${CMAKE_${LANGUAGE}_COMPILER_ID} ${_compiler_version}")
+ set(_build_flags "${CMAKE_${LANGUAGE}_FLAGS}")
+ string(TOUPPER ${CMAKE_BUILD_TYPE} _build_type)
+ set(_build_flags "${_build_flags} ${CMAKE_${LANGUAGE}_FLAGS_${_build_type}}")
+ set(${BUILD_FLAGS} ${_build_flags})
+endmacro()
+++ /dev/null
-# This macro attempts to parse the version string of the C compiler in use.
-# Currently supported are only compilers that accept "-dumpversion" argument:
-# gcc, Intel Compiler (on Linux and Mac OS), Open64, EkoPath.
-#
-# C_COMPILER_VERSION - version string of the current C compiler (CMAKE_C_COMPILER)
-# CXX_COMPILER_VERSION - version string of the current C++ compiler (CMAKE_CXX_COMPILER)
-#
-macro(get_compiler_version)
- if(NOT C_COMPILER_VERSION)
- execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion
- RESULT_VARIABLE _cc_dumpversion_res
- OUTPUT_VARIABLE _cc_dumpversion_out
- ERROR_VARIABLE _cc_dumpversion_err
- OUTPUT_STRIP_TRAILING_WHITESPACE)
-
- if (${_cc_dumpversion_res} EQUAL 0)
- SET(C_COMPILER_VERSION ${_cc_dumpversion_out}
- CACHE STRING "C compiler verstion string" FORCE)
- else ()
- SET(C_COMPILER_VERSION ""
- CACHE STRING "C compiler verstion string not available" FORCE)
- endif ()
- endif()
-
- if(NOT CXX_COMPILER_VERSION AND CMAKE_CXX_COMPILER_LOADED)
- execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion
- RESULT_VARIABLE _cxx_dumpversion_res
- OUTPUT_VARIABLE _cxx_dumpversion_out
- ERROR_VARIABLE _cxx_dumpversion_err
- OUTPUT_STRIP_TRAILING_WHITESPACE)
-
- if (${_cxx_dumpversion_res} EQUAL 0)
- SET(CXX_COMPILER_VERSION ${_cxx_dumpversion_out}
- CACHE STRING "C++ compiler verstion string" FORCE)
- else ()
- SET(CXX_COMPILER_VERSION ""
- CACHE STRING "C++ compiler verstion string not available" FORCE)
- endif ()
- endif ()
-
- if (NOT "${C_COMPILER_VERSION}" STREQUAL "${CXX_COMPILER_VERSION}" AND CMAKE_CXX_COMPILER_LOADED)
- message(WARNING "The version string of the C and C++ compilers does not match!")
- endif ()
-
- mark_as_advanced(C_COMPILER_VERSION CXX_COMPILER_VERSION)
-endmacro()
"${_CUDA_ARCH_STR};-use_fast_math;${CUDA_NVCC_HOST_COMPILER_OPTIONS};${_FPIC_NVCC_FLAG}"
CACHE STRING "Compiler flags for nvcc." FORCE)
endif()
+
+
+# Try to execute ${CUDA_NVCC_EXECUTABLE} --version and set the output
+# (or an error string) in the argument variable.
+#
+# returned in argument: CUDA nvcc compiler version string
+#
+macro(get_nvcc_version_info)
+ if(CUDA_NVCC_EXECUTABLE AND NOT CUDA_NVCC_COMPILER_INFO)
+
+ # Get the nvcc version string. This is multi-line, but since it is only 4 lines
+ # and might change in the future it is better to store than trying to parse out
+ # the version from the current format.
+ execute_process(COMMAND ${CUDA_NVCC_EXECUTABLE} --version
+ RESULT_VARIABLE _nvcc_version_res
+ OUTPUT_VARIABLE _nvcc_version_out
+ ERROR_VARIABLE _nvcc_version_err
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+ if (${_nvcc_version_res} EQUAL 0)
+ # Fix multi-line mess: Replace newline with ";" so we can use it in a define
+ string(REPLACE "\n" ";" _nvcc_info_singleline ${_nvcc_version_out})
+ SET(CUDA_NVCC_COMPILER_INFO ${_nvcc_info_singleline}
+ CACHE STRING "CUDA nvcc compiler version string" FORCE)
+ else ()
+ SET(CUDA_NVCC_COMPILER_INFO ""
+ CACHE STRING "CUDA nvcc compiler version string not available" FORCE)
+ endif ()
+ endif ()
+ mark_as_advanced(CUDA_NVCC_COMPILER_INFO)
+endmacro ()
#ifdef GMX_SOFTWARE_INVSQRT
-static real gmx_invsqrt(real x)
+static real gmx_software_invsqrt(real x)
{
const real half=0.5;
const real three=3.0;
return y; /* 5 Flops */
#endif
}
+#define gmx_invsqrt(x) gmx_software_invsqrt(x)
#define INVSQRT_DONE
#endif /* gmx_invsqrt */
#ifdef GMX_POWERPC_SQRT
-static real gmx_invsqrt(real x)
+static real gmx_powerpc_invsqrt(real x)
{
const real half=0.5;
const real three=3.0;
return y; /* 5 Flops */
#endif
}
+#define gmx_invsqrt(x) gmx_powerpc_invsqrt(x)
#define INVSQRT_DONE
#endif /* powerpc_invsqrt */
--- /dev/null
+config.h
+buildinfo.h
-configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmakein ${CMAKE_CURRENT_BINARY_DIR}/config.h)
+configure_file(config.h.cmakein config.h)
+configure_file(buildinfo.h.cmakein buildinfo.h)
include(../cmake/BuildManPages.cmake)
--- /dev/null
+/*! \internal \file
+ * \brief
+ * Build information from the build system.
+ *
+ * Used for log and version output.
+ */
+
+/** Hardware and OS version for build host */
+#define BUILD_HOST "@BUILD_HOST@"
+
+/** Date and time for build */
+#define BUILD_TIME "@BUILD_TIME@"
+
+/** User doing build */
+#define BUILD_USER "@BUILD_USER@"
+
+/** CPU vendor for build host */
+#define BUILD_CPU_VENDOR "@BUILD_CPU_VENDOR@"
+
+/** CPU brand for build host */
+#define BUILD_CPU_BRAND "@BUILD_CPU_BRAND@"
+
+/** CPU family for build host */
+#define BUILD_CPU_FAMILY @BUILD_CPU_FAMILY@
+
+/** CPU model for build host */
+#define BUILD_CPU_MODEL @BUILD_CPU_MODEL@
+
+/** CPU stepping for build host */
+#define BUILD_CPU_STEPPING @BUILD_CPU_STEPPING@
+
+/** CPU feature list for build host */
+#define BUILD_CPU_FEATURES "@BUILD_CPU_FEATURES@"
+
+/** C compiler used to build */
+#define BUILD_C_COMPILER "@BUILD_C_COMPILER@"
+
+/** C compiler flags used to build */
+#define BUILD_CFLAGS "@BUILD_CFLAGS@"
+
+/** C++ compiler flags used to build, or empty string if no C++ */
+#define BUILD_CXX_COMPILER "@BUILD_CXX_COMPILER@"
+
+/** C++ compiler flags used to build */
+#define BUILD_CXXFLAGS "@BUILD_CXXFLAGS@"
+
+/** CUDA nvcc compiler version information */
+#define CUDA_NVCC_COMPILER_INFO "@CUDA_NVCC_COMPILER_INFO@"
+
/* Default location of data files */
#define GMXLIBDIR "@GMXLIBDIR@"
-/* Hardware and OS version for build host */
-#define BUILD_HOST "@BUILD_HOST@"
-
-/* CPU information for build host */
-#define BUILD_CPU_VENDOR "@BUILD_CPU_VENDOR@"
-
-#define BUILD_CPU_BRAND "@BUILD_CPU_BRAND@"
-
-#define BUILD_CPU_FAMILY @BUILD_CPU_FAMILY@
-
-#define BUILD_CPU_MODEL @BUILD_CPU_MODEL@
-
-#define BUILD_CPU_STEPPING @BUILD_CPU_STEPPING@
-
-#define BUILD_CPU_FEATURES "@BUILD_CPU_FEATURES@"
-
-/* Compiler and CFLAGS from build */
-#define BUILD_COMPILER "@BUILD_COMPILER@"
-
-#define BUILD_CFLAGS "@BUILD_CFLAGS@"
-
-/* Date and time for build */
-#define BUILD_TIME "@BUILD_TIME@"
-
-/* User doing build */
-#define BUILD_USER "@BUILD_USER@"
-
/* Turn off water-water neighborlist optimization only - not used right now */
#cmakedefine DISABLE_WATERWATER_NLIST
PROPERTIES GENERATED true)
endif()
+# The log file output queries Cuda if GPU support is enabled
+if(GMX_GPU)
+set_source_files_properties(copyrite.c PROPERTIES COMPILE_FLAGS "-I${CUDA_TOOLKIT_INCLUDE}")
+endif()
+
if(NOT GMX_EXTERNAL_BLAS)
file(GLOB BLAS_SOURCES gmx_blas/*.c)
endif(NOT GMX_EXTERNAL_BLAS)
#if(GMX_THREAD_MPI)
# add_subdirectory(thread_mpi)
#endif(GMX_THREAD_MPI)
-#target_link_libraries(gmx ${GMX_EXTRA_LIBRARIES} ${THREAD_MPI_LIB})
+#target_link_libraries(gmx ${GMX_EXTRA_LIBRARIES} ${FFT_LIBRARIES} ${THREAD_MPI_LIB})
# apply gcc 4.4.x bug workaround
if(GMX_USE_GCC44_BUG_WORKAROUND)
# NONBONDED_SOURCES is imported from the nonbonded subdirectory.
add_library(gmx ${GMXLIB_SOURCES} ${BLAS_SOURCES} ${LAPACK_SOURCES} ${THREAD_MPI_SRC} ${NONBONDED_SOURCES})
-target_link_libraries(gmx ${GMX_GPU_LIBRARIES} ${GMX_EXTRA_LIBRARIES} ${THREAD_LIB} ${OpenMP_SHARED_LINKER_FLAGS})
+target_link_libraries(gmx ${GMX_GPU_LIBRARIES} ${GMX_EXTRA_LIBRARIES} ${FFT_LIBRARIES} ${THREAD_LIB} ${OpenMP_SHARED_LINKER_FLAGS})
if(USE_VERSION_H)
add_dependencies(gmx gmx_version)
endif()
#include "string2.h"
#include <fcntl.h>
+#include "buildinfo.h"
#ifdef GMX_FAHCORE
#include "corewrap.h"
#include <thread_mpi.h>
#endif
+#ifdef HAVE_LIBMKL
+#include <mkl.h>
+#endif
+#ifdef GMX_GPU
+#include <cuda.h>
+#include <cuda_runtime_api.h>
+#endif
+#ifdef GMX_FFT_FFTW3
+#include <fftw3.h>
+#endif
+
/* This file is completely threadsafe - keep it that way! */
#include <string.h>
#include "copyrite.h"
#include "strdb.h"
#include "futil.h"
+#include "vec.h"
+#include "buildinfo.h"
+#include "gmx_cpuid.h"
static void pr_two(FILE *out,int c,int i)
{
static const char _gmx_ver_string[]="VERSION " VERSION;
#endif
-/* This routine only returns a static (constant) string, so we use a
- * mutex to initialize it. Since the string is only written to the
- * first time, there is no risk with multiple calls overwriting the
- * output for each other.
- */
const char *GromacsVersion()
{
return _gmx_ver_string;
}
-
void gmx_print_version_info(FILE *fp)
{
- fprintf(fp, "Version: %s\n", _gmx_ver_string);
+#ifdef GMX_GPU
+ int cuda_driver,cuda_runtime;
+#endif
+
+ fprintf(fp, "Gromacs version: %s\n", _gmx_ver_string);
#ifdef USE_VERSION_H
- fprintf(fp, "GIT SHA1 hash: %s\n", _gmx_full_git_hash);
+ fprintf(fp, "GIT SHA1 hash: %s\n", _gmx_full_git_hash);
/* Only print out the branch information if present.
* The generating script checks whether the branch point actually
* coincides with the hash reported above, and produces an empty string
* in such cases. */
if (_gmx_central_base_hash[0] != 0)
{
- fprintf(fp, "Branched from: %s\n", _gmx_central_base_hash);
+ fprintf(fp, "Branched from: %s\n", _gmx_central_base_hash);
}
#endif
#ifdef GMX_DOUBLE
- fprintf(fp, "Precision: double\n");
+ fprintf(fp, "Precision: double\n");
#else
- fprintf(fp, "Precision: single\n");
+ fprintf(fp, "Precision: single\n");
#endif
#ifdef GMX_THREAD_MPI
- fprintf(fp, "Parallellization: thread_mpi\n");
+ fprintf(fp, "MPI library: thread_mpi\n");
#elif defined(GMX_MPI)
- fprintf(fp, "Parallellization: MPI\n");
+ fprintf(fp, "MPI library: MPI\n");
#else
- fprintf(fp, "Parallellization: none\n");
+ fprintf(fp, "MPI library: none\n");
#endif
-
+#ifdef GMX_OPENMP
+ fprintf(fp, "OpenMP support: enabled\n");
+#else
+ fprintf(fp, "OpenMP support: disabled\n");
+#endif
+#ifdef GMX_GPU
+ fprintf(fp, "GPU support: enabled\n");
+#else
+ fprintf(fp, "GPU support: disabled\n");
+#endif
+ /* A preprocessor trick to avoid duplicating logic from vec.h */
+#define gmx_stringify2(x) #x
+#define gmx_stringify(x) gmx_stringify2(x)
+ fprintf(fp, "invsqrt routine: %s\n", gmx_stringify(gmx_invsqrt(x)));
+ fprintf(fp, "CPU acceleration: %s\n", GMX_CPU_ACCELERATION_STRING);
+
+ /* TODO: Would be nicer to wrap this in a gmx_fft_version() call, but
+ * since that is currently in mdlib, can wait for master. */
#ifdef GMX_FFT_FFTPACK
- fprintf(fp, "FFT Library: fftpack\n");
+ fprintf(fp, "FFT library: fftpack (built-in)\n");
+#elif defined(GMX_FFT_FFTW3) && defined(GMX_NATIVE_WINDOWS)
+ fprintf(fp, "FFT library: %s\n", "fftw3");
+#elif defined(GMX_FFT_FFTW3) && defined(GMX_DOUBLE)
+ fprintf(fp, "FFT library: %s\n", fftw_version);
#elif defined(GMX_FFT_FFTW3)
- fprintf(fp, "FFT Library: fftw3\n");
+ fprintf(fp, "FFT library: %s\n", fftwf_version);
#elif defined(GMX_FFT_MKL)
- fprintf(fp, "FFT Library: MKL\n");
+ fprintf(fp, "FFT library: MKL\n");
+#else
+ fprintf(fp, "FFT library: unknown\n");
+#endif
+#ifdef GMX_LARGEFILES
+ fprintf(fp, "Large file support: enabled\n");
+#else
+ fprintf(fp, "Large file support: disabled\n");
+#endif
+#ifdef HAVE_RDTSCP
+ fprintf(fp, "RDTSCP usage: enabled\n");
#else
- fprintf(fp, "FFT Library: unknown\n");
+ fprintf(fp, "RDTSCP usage: disabled\n");
+#endif
+
+ fprintf(fp, "Built on: %s\n", BUILD_TIME);
+ fprintf(fp, "Built by: %s\n", BUILD_USER);
+ fprintf(fp, "Build OS/arch: %s\n", BUILD_HOST);
+ fprintf(fp, "Build CPU vendor: %s\n", BUILD_CPU_VENDOR);
+ fprintf(fp, "Build CPU brand: %s\n", BUILD_CPU_BRAND);
+ fprintf(fp, "Build CPU family: %d Model: %d Stepping: %d\n",
+ BUILD_CPU_FAMILY, BUILD_CPU_MODEL, BUILD_CPU_STEPPING);
+ /* TODO: The below strings can be quite long, so it would be nice to wrap
+ * them. Can wait for later, as the master branch has ready code to do all
+ * that. */
+ fprintf(fp, "Build CPU features: %s\n", BUILD_CPU_FEATURES);
+ fprintf(fp, "C compiler: %s\n", BUILD_C_COMPILER);
+ fprintf(fp, "C compiler flags: %s\n", BUILD_CFLAGS);
+ if (BUILD_CXX_COMPILER[0] != '\0')
+ {
+ fprintf(fp, "C++ compiler: %s\n", BUILD_CXX_COMPILER);
+ fprintf(fp, "C++ compiler flags: %s\n", BUILD_CXXFLAGS);
+ }
+#ifdef HAVE_LIBMKL
+ /* MKL might be used for LAPACK/BLAS even if FFTs use FFTW, so keep it separate */
+ fprintf(fp, "Linked with Intel MKL version %s.%s.%s.\n",
+ __INTEL_MKL__,__INTEL_MKL_MINOR__,__INTEL_MKL_UPDATE__);
+#endif
+#ifdef GMX_GPU
+ fprintf(fp, "CUDA compiler: %s\n",CUDA_NVCC_COMPILER_INFO);
+ cuda_driver = 0;
+ cudaDriverGetVersion(&cuda_driver);
+ cuda_runtime = 0;
+ cudaRuntimeGetVersion(&cuda_runtime);
+ fprintf(fp, "CUDA driver: %d.%d\n",cuda_driver/1000, cuda_driver%100);
+ fprintf(fp, "CUDA runtime: %d.%d\n",cuda_runtime/1000, cuda_runtime%100);
#endif
}
#include "filenm.h"
#include "gmxfio.h"
#include "string2.h"
+#include "copyrite.h"
#ifdef GMX_THREAD_MPI
#include "thread_mpi.h"
"Log file opened on %s"
"Host: %s pid: %d nodeid: %d nnodes: %d\n",
timebuf,host,pid,cr->nodeid,cr->nnodes);
- fprintf(fp,
- "Built %s by %s\n"
- "Build os/architecture: %s\n"
- "Build CPU Vendor: %s Brand: %s\n"
- "Build CPU Family: %d Model: %d Stepping: %d\n"
- "Build CPU Features: %s\n"
- "Compiler: %s\n"
- "CFLAGS: %s\n\n",
- BUILD_TIME,BUILD_USER,BUILD_HOST,
- BUILD_CPU_VENDOR,BUILD_CPU_BRAND,
- BUILD_CPU_FAMILY,BUILD_CPU_MODEL,BUILD_CPU_STEPPING,
- BUILD_CPU_FEATURES,BUILD_COMPILER,BUILD_CFLAGS);
+ gmx_print_version_info(fp);
+ fprintf(fp, "\n\n");
fflush(fp);
debug_gmx();