From d0c438a1941955348e7307cb72b69fd9993a89f0 Mon Sep 17 00:00:00 2001 From: Roland Schulz Date: Tue, 21 Oct 2014 21:23:29 -0400 Subject: [PATCH] Don't set CFLAGS for Phi in toolchain The recommended way to set those flags is with CMAKE_*_FLAGS_INIT but that is only passible in a platform file because those set in a toolchain file get overwritten. This fixes that extra CFLAGS passed on the command line don't get ignored. Also move setting of fftw out of platform file because those should be project independent. Change-Id: I5f4d70efd8369bdef5f5060959e3568026d6820c --- CMakeLists.txt | 8 +++++++- .../{XeonPhi.cmake => Linux-Intel-C-XeonPhi.cmake} | 15 +++------------ .../{XeonPhi.cmake => Linux-Intel-CXX-XeonPhi.cmake} | 15 +++------------ cmake/Platform/XeonPhi.cmake | 11 +++++------ 4 files changed, 18 insertions(+), 31 deletions(-) copy cmake/Platform/{XeonPhi.cmake => Linux-Intel-C-XeonPhi.cmake} (73%) copy cmake/Platform/{XeonPhi.cmake => Linux-Intel-CXX-XeonPhi.cmake} (73%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 628e30d4c6..18152b051b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -265,10 +265,16 @@ gmx_option_multichoice( "${GMX_SUGGESTED_SIMD}" None SSE2 SSE4.1 AVX_128_FMA AVX_256 AVX2_256 IBM_QPX Sparc64_HPC_ACE Reference) +if(GMX_TARGET_MIC) + set(GMX_FFT_LIBRARY_DEFAULT "mkl") +else() + set(GMX_FFT_LIBRARY_DEFAULT "fftw3") +endif() + gmx_option_multichoice( GMX_FFT_LIBRARY "FFT library" - "fftw3" + "${GMX_FFT_LIBRARY_DEFAULT}" fftw3 mkl "fftpack[built-in]") gmx_dependent_option( GMX_BUILD_OWN_FFTW diff --git a/cmake/Platform/XeonPhi.cmake b/cmake/Platform/Linux-Intel-C-XeonPhi.cmake similarity index 73% copy from cmake/Platform/XeonPhi.cmake copy to cmake/Platform/Linux-Intel-C-XeonPhi.cmake index 3e7956a83c..a08c51386c 100644 --- a/cmake/Platform/XeonPhi.cmake +++ b/cmake/Platform/Linux-Intel-C-XeonPhi.cmake @@ -1,7 +1,7 @@ # # This file is part of the GROMACS molecular simulation package. # -# Copyright (c) 2014, by the GROMACS development team, led by +# Copyright (c) 2014,2015, 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. @@ -31,14 +31,5 @@ # # To help us fund GROMACS development, we humbly ask that you cite # the research papers on the package. Check out http://www.gromacs.org. -if(NOT GMX_MPI) - set(CMAKE_C_COMPILER "icc") - set(CMAKE_CXX_COMPILER "icpc") -else() - set(CMAKE_C_COMPILER "mpiicc") - set(CMAKE_CXX_COMPILER "mpiicpc") - set(GMX_PREFER_STATIC_LIBS ON CACHE BOOL "Shared libraries on Xeon Phi with MPI don't work.") -endif() -set(CMAKE_CXX_FLAGS "-mmic" CACHE STRING "Flags used by the compiler during all build types.") -set(CMAKE_C_FLAGS "-mmic" CACHE STRING "Flags used by the compiler during all build types.") -set(GMX_FFT_LIBRARY "mkl" CACHE STRING "FFT library") + +set(CMAKE_C_FLAGS_INIT "-mmic") diff --git a/cmake/Platform/XeonPhi.cmake b/cmake/Platform/Linux-Intel-CXX-XeonPhi.cmake similarity index 73% copy from cmake/Platform/XeonPhi.cmake copy to cmake/Platform/Linux-Intel-CXX-XeonPhi.cmake index 3e7956a83c..98d843fd34 100644 --- a/cmake/Platform/XeonPhi.cmake +++ b/cmake/Platform/Linux-Intel-CXX-XeonPhi.cmake @@ -1,7 +1,7 @@ # # This file is part of the GROMACS molecular simulation package. # -# Copyright (c) 2014, by the GROMACS development team, led by +# Copyright (c) 2014,2015, 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. @@ -31,14 +31,5 @@ # # To help us fund GROMACS development, we humbly ask that you cite # the research papers on the package. Check out http://www.gromacs.org. -if(NOT GMX_MPI) - set(CMAKE_C_COMPILER "icc") - set(CMAKE_CXX_COMPILER "icpc") -else() - set(CMAKE_C_COMPILER "mpiicc") - set(CMAKE_CXX_COMPILER "mpiicpc") - set(GMX_PREFER_STATIC_LIBS ON CACHE BOOL "Shared libraries on Xeon Phi with MPI don't work.") -endif() -set(CMAKE_CXX_FLAGS "-mmic" CACHE STRING "Flags used by the compiler during all build types.") -set(CMAKE_C_FLAGS "-mmic" CACHE STRING "Flags used by the compiler during all build types.") -set(GMX_FFT_LIBRARY "mkl" CACHE STRING "FFT library") + +set(CMAKE_CXX_FLAGS_INIT "-mmic") diff --git a/cmake/Platform/XeonPhi.cmake b/cmake/Platform/XeonPhi.cmake index 3e7956a83c..a23feaf9f8 100644 --- a/cmake/Platform/XeonPhi.cmake +++ b/cmake/Platform/XeonPhi.cmake @@ -1,7 +1,7 @@ # # This file is part of the GROMACS molecular simulation package. # -# Copyright (c) 2014, by the GROMACS development team, led by +# Copyright (c) 2014,2015, 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. @@ -31,14 +31,13 @@ # # To help us fund GROMACS development, we humbly ask that you cite # the research papers on the package. Check out http://www.gromacs.org. + +set(CMAKE_SYSTEM_NAME Linux) +set(CMAKE_SYSTEM_PROCESSOR XeonPhi) if(NOT GMX_MPI) set(CMAKE_C_COMPILER "icc") set(CMAKE_CXX_COMPILER "icpc") else() - set(CMAKE_C_COMPILER "mpiicc") + set(CMAKE_C_COMPILER "mpiicc") #FindMPI doesn't work (#14991) set(CMAKE_CXX_COMPILER "mpiicpc") - set(GMX_PREFER_STATIC_LIBS ON CACHE BOOL "Shared libraries on Xeon Phi with MPI don't work.") endif() -set(CMAKE_CXX_FLAGS "-mmic" CACHE STRING "Flags used by the compiler during all build types.") -set(CMAKE_C_FLAGS "-mmic" CACHE STRING "Flags used by the compiler during all build types.") -set(GMX_FFT_LIBRARY "mkl" CACHE STRING "FFT library") -- 2.11.4.GIT