From 2af9c550fda11ddf87c0762d15b2138240c7ab69 Mon Sep 17 00:00:00 2001 From: Erik Lindahl Date: Sun, 12 Nov 2017 06:14:10 -0700 Subject: [PATCH] Only issue FFT warning messages on changes Similar to other CMake modules, we should only issue warnings at the first invocation, or if the FFT library was changed. Change-Id: I6dba59f1021984d9a744a55d797814c1c9d89b20 --- cmake/gmxManageFFTLibraries.cmake | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cmake/gmxManageFFTLibraries.cmake b/cmake/gmxManageFFTLibraries.cmake index 8a184948cd..224f03b684 100644 --- a/cmake/gmxManageFFTLibraries.cmake +++ b/cmake/gmxManageFFTLibraries.cmake @@ -90,12 +90,12 @@ if(${GMX_FFT_LIBRARY} STREQUAL "FFTW3") include_directories(SYSTEM ${${FFTW}_INCLUDE_DIRS}) if ((${GMX_SIMD_ACTIVE} MATCHES "SSE" OR ${GMX_SIMD_ACTIVE} MATCHES "AVX") AND NOT ${FFTW}_HAVE_SIMD) - message(WARNING "The fftw library found is compiled without SIMD support, which makes it slow. Consider recompiling it or contact your admin") + set(FFT_WARNING_MESSAGE "The fftw library found is compiled without SIMD support, which makes it slow. Consider recompiling it or contact your admin") else() if(${GMX_SIMD_ACTIVE} MATCHES "AVX" AND NOT (${FFTW}_HAVE_SSE OR ${FFTW}_HAVE_SSE2)) # If we end up here we have an AVX Gromacs build, and # FFTW with SIMD. - message(WARNING "The FFTW library was compiled with neither --enable-sse nor --enable-sse2; those would have enabled SSE(2) SIMD instructions. This will give suboptimal performance. You should (re)compile the FFTW library with --enable-sse2 and --enable-avx (and --enable-avx2 or --enable-avx512 if supported).") + set(FFT_WARNING_MESSAGE "The FFTW library was compiled with neither --enable-sse nor --enable-sse2; those would have enabled SSE(2) SIMD instructions. This will give suboptimal performance. You should (re)compile the FFTW library with --enable-sse2 and --enable-avx (and --enable-avx2 or --enable-avx512 if supported).") endif() endif() set(FFT_STATUS_MESSAGE "Using external FFT library - FFTW3") @@ -165,6 +165,9 @@ else() endif() gmx_check_if_changed(FFT_CHANGED GMX_FFT_LIBRARY) if (FFT_CHANGED) + if(FFT_WARNING_MESSAGE) + message(WARNING "${FFT_WARNING_MESSAGE}") + endif() message(STATUS "${FFT_STATUS_MESSAGE}") endif() -- 2.11.4.GIT