# These need to be done early (before further tests).
#####################################################################
+include(gmxTestIntelLLVM)
include(gmxCFlags)
gmx_c_flags()
--- /dev/null
+#ifndef __INTEL_LLVM_COMPILER
+#error
+#endif
+#define VALUE_TO_STRING(x) #x
+#define VALUE(x) VALUE_TO_STRING(x)
+#pragma message(VALUE(__INTEL_LLVM_COMPILER))
+int main() {}
#
# Copyright (c) 2009,2010,2011,2012,2013 by the GROMACS development team.
# Copyright (c) 2014,2015,2016,2017,2018 by the GROMACS development team.
-# Copyright (c) 2019,2020, by the GROMACS development team, led by
+# Copyright (c) 2019,2020,2021, 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.
GMX_TEST_CXXFLAG(CXXFLAGS_PRAGMA "-Wno-unknown-pragmas" GMXC_CXXFLAGS)
endif()
GMX_TEST_CXXFLAG(CXXFLAGS_WARN_NO_MISSING_FIELD_INITIALIZERS "-Wno-missing-field-initializers" GMXC_CXXFLAGS)
+ # Intel LLVM 2021.2 defaults to no-finite-math which isn't OK for GROMACS
+ if(GMX_INTEL_LLVM AND GMX_INTEL_LLVM_VERSION GREATER_EQUAL 2021020)
+ GMX_TEST_CXXFLAG(CXXFLAGS_FINITE_MATH "-fno-finite-math-only" GMXC_CXXFLAGS)
+ endif()
endif()
# Apple bastardized version of Clang
# This file is part of the GROMACS molecular simulation package.
#
# Copyright (c) 2012,2013,2014,2015,2016 by the GROMACS development team.
-# Copyright (c) 2017,2018,2019,2020, by the GROMACS development team, led by
+# Copyright (c) 2017,2018,2019,2020,2021, 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.
# To help us fund GROMACS development, we humbly ask that you cite
# the research papers on the package. Check out http://www.gromacs.org.
-include(gmxTestICCNextGen)
-
# Manage setup of the different FFT libraries we can use in Gromacs.
set(PKG_FFT "")
set(PKG_FFT_LIBS "")
set(MKL_MANUALLY FALSE)
if (GMX_FFT_LIBRARY STREQUAL "MKL" AND
NOT ((CMAKE_C_COMPILER_ID MATCHES "Intel" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER "11")
- OR GMX_ICC_NEXTGEN))
+ OR GMX_INTEL_LLVM))
# The user will have to provide the set of magic libraries in
# MKL_LIBRARIES (see below), which we cache (non-advanced), so that they
# don't have to keep specifying it, and can easily see that
# docs, but on Jenkins Win2k8, icl tries to interpret it
# as a file. Shrug.
set(FFT_LINKER_FLAGS "/Qmkl:sequential")
+ elseif(GMX_INTEL_LLVM AND GMX_INTEL_LLVM_VERSION GREATER_EQUAL 2021020)
+ set(FFT_LINKER_FLAGS "-qmkl=sequential")
else()
set(FFT_LINKER_FLAGS "-mkl=sequential")
endif()
#
# This file is part of the GROMACS molecular simulation package.
#
-# Copyright (c) 2020, by the GROMACS development team, led by
+# Copyright (c) 2020,2021, 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.
# To help us fund GROMACS development, we humbly ask that you cite
# the research papers on the package. Check out http://www.gromacs.org.
-# CMake detects ICC NextGen (based on LLVM) as Clang
-if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
- include(CheckCXXSourceCompiles)
- check_cxx_source_compiles(
- "int main() { return __INTEL_LLVM_COMPILER; }"
- GMX_ICC_NEXTGEN)
+# CMake detects Intel compiler (based on LLVM) as Clang
+# Was fixed in Cmake 3.20. When we require 3.20 this can be deleted.
+if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID MATCHES "IntelLLVM")
+ try_compile(GMX_INTEL_LLVM "${CMAKE_BINARY_DIR}" SOURCES "${CMAKE_SOURCE_DIR}/cmake/TestIntelLLVM.cpp" OUTPUT_VARIABLE GMX_INTEL_LLVM_VERSION)
+ if (GMX_INTEL_LLVM)
+ if(GMX_INTEL_LLVM_VERSION MATCHES ": ([0-9]+) ")
+ set(GMX_INTEL_LLVM_VERSION ${CMAKE_MATCH_1})
+ else()
+ message(WARNING "Intel LLVM version detection failed. Output: ${GMX_INTEL_LLVM_VERSION}")
+ endif()
+ endif()
endif()
Fixes that affect portability
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+Support for Intel oneAPI compiler 2021.2
+"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+
+Fixed compiler infinity math and MKL flags.
+
Miscellaneous
^^^^^^^^^^^^^