From: Mark Abraham Date: Thu, 6 Mar 2014 17:42:31 +0000 (+0100) Subject: Fix MKL linking X-Git-Url: http://biod.pnpi.spb.ru/gitweb/?a=commitdiff_plain;h=547244a43be0f4ddd79aca17ee1c9e8701d1bcd5;p=alexxy%2Fgromacs.git Fix MKL linking Setting the same for CMAKE_STATIC_LINKER_FLAGS broke because that variable got applied to calls to ar for linking libgmock.a. Probably not important because Intel probably encourages shared linking for MKL. Change-Id: I6816d8ba318c704a0efad7659f5afecaeb48b092 --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 4500c7eb55..2c04820946 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -725,7 +725,7 @@ if (NOT GMX_SKIP_DEFAULT_CFLAGS) set(CMAKE_C_FLAGS "${SIMD_C_FLAGS} ${MPI_COMPILE_FLAGS} ${EXTRA_C_FLAGS} ${CMAKE_C_FLAGS}") set(CMAKE_CXX_FLAGS "${SIMD_CXX_FLAGS} ${MPI_COMPILE_FLAGS} ${EXTRA_CXX_FLAGS} ${CMAKE_CXX_FLAGS}") set(CMAKE_EXE_LINKER_FLAGS "${FFT_LINKER_FLAGS} ${MPI_LINKER_FLAGS} ${CMAKE_EXE_LINKER_FLAGS}") - set(CMAKE_SHARED_LINKER_FLAGS "${MPI_LINKER_FLAGS} ${CMAKE_SHARED_LINKER_FLAGS}") + set(CMAKE_SHARED_LINKER_FLAGS "${FFT_LINKER_FLAGS} ${MPI_LINKER_FLAGS} ${CMAKE_SHARED_LINKER_FLAGS}") else() message("Recommended flags which are not added because GMX_SKIP_DEFAULT_CFLAGS=yes:") message("CMAKE_C_FLAGS: ${SIMD_C_FLAGS} ${MPI_COMPILE_FLAGS} ${EXTRA_C_FLAGS} ${GMXC_CFLAGS}") diff --git a/cmake/gmxManageFFTLibraries.cmake b/cmake/gmxManageFFTLibraries.cmake index 35c600001e..3edd654a0e 100644 --- a/cmake/gmxManageFFTLibraries.cmake +++ b/cmake/gmxManageFFTLibraries.cmake @@ -98,7 +98,10 @@ elseif(${GMX_FFT_LIBRARY} STREQUAL "MKL") if (NOT MKL_MANUALLY) # The next line takes care of everything for MKL if (WIN32) - set(FFT_LINKER_FLAGS "/Qmkl=sequential") + # This works according to the Intel MKL 10.3 for Windows + # docs, but on Jenkins Win2k8, icl tries to interpret it + # as a file. Shrug. + set(FFT_LINKER_FLAGS "/Qmkl:sequential") else() set(FFT_LINKER_FLAGS "-mkl=sequential") endif() diff --git a/cmake/gmxManageLinearAlgebraLibraries.cmake b/cmake/gmxManageLinearAlgebraLibraries.cmake index bcbc8bab57..fb723187da 100644 --- a/cmake/gmxManageLinearAlgebraLibraries.cmake +++ b/cmake/gmxManageLinearAlgebraLibraries.cmake @@ -1,7 +1,7 @@ # # This file is part of the GROMACS molecular simulation package. # -# Copyright (c) 2013, by the GROMACS development team, led by +# Copyright (c) 2013,2014, 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. @@ -85,7 +85,8 @@ macro(manage_linear_algebra_library name function_in_library) endif() if(NOT _library_was_found AND HAVE_LIBMKL) - set(CMAKE_REQUIRED_LIBRARIES ${FFT_LINKER_FLAGS} ${FFT_LIBRARIES}) + set(CMAKE_REQUIRED_LIBRARIES "${FFT_LIBRARIES}") + set(CMAKE_REQUIRED_FLAGS "${FFT_LINKER_FLAGS}") # This may also not work correctly if the user changes # MKL_LIBRARIES after the first run. However, # MKL_LIBRARIES is only needed for icc version < 11, or