Skip to content

Commit 6ff3a43

Browse files
vmakovetmkrainiuk
andauthored
[cmake] update MKLConfig to 2025.3 release (#713)
Co-authored-by: Maria Kraynyuk <[email protected]>
1 parent 6fed63e commit 6ff3a43

File tree

4 files changed

+102
-41
lines changed

4 files changed

+102
-41
lines changed

.github/workflows/coverity.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,14 @@ jobs:
5555
5656
- name: Install Intel compiler
5757
run: |
58-
wget --progress=dot:giga https://registrationcenter-download.intel.com/akdlm/IRC_NAS/39c79383-66bf-4f44-a6dd-14366e34e255/intel-dpcpp-cpp-compiler-2025.2.0.527_offline.sh
59-
sudo bash intel-dpcpp-cpp-compiler-2025.2.0.527_offline.sh -s -a -s --action install --eula accept
58+
wget --progress=dot:giga https://registrationcenter-download.intel.com/akdlm/IRC_NAS/5adfc398-db78-488c-b98f-78461b3c5760/intel-dpcpp-cpp-compiler-2025.3.1.16_offline.sh
59+
sudo bash intel-dpcpp-cpp-compiler-2025.3.1.16_offline.sh -s -a -s --action install --eula accept
60+
6061
6162
- name: Install Intel oneMKL
6263
run: |
63-
wget --progress=dot:giga https://registrationcenter-download.intel.com/akdlm/IRC_NAS/47c7d946-fca1-441a-b0df-b094e3f045ea/intel-onemkl-2025.2.0.629_offline.sh
64-
sudo bash intel-onemkl-2025.2.0.629_offline.sh -s -a -s --action install --eula accept
64+
wget --progress=dot:giga https://registrationcenter-download.intel.com/akdlm/IRC_NAS/2ad98b49-1fb2-4294-ab3d-6889b434ebd3/intel-onemkl-2025.3.0.462_offline.sh
65+
sudo bash intel-onemkl-2025.3.0.462_offline.sh -s -a -s --action install --eula accept
6566
6667
- name: Restore netlib from cache
6768
id: cache-lapack

.github/workflows/pr-x86.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,13 @@ jobs:
6868
- name: Install compiler
6969
if: steps.domain_check.outputs.result == 'true'
7070
run: |
71-
wget --progress=dot:giga https://registrationcenter-download.intel.com/akdlm/IRC_NAS/39c79383-66bf-4f44-a6dd-14366e34e255/intel-dpcpp-cpp-compiler-2025.2.0.527_offline.sh
72-
sudo bash intel-dpcpp-cpp-compiler-2025.2.0.527_offline.sh -s -a -s --action install --eula accept
71+
wget --progress=dot:giga https://registrationcenter-download.intel.com/akdlm/IRC_NAS/5adfc398-db78-488c-b98f-78461b3c5760/intel-dpcpp-cpp-compiler-2025.3.1.16_offline.sh
72+
sudo bash intel-dpcpp-cpp-compiler-2025.3.1.16_offline.sh -s -a -s --action install --eula accept
7373
- name: Install Intel oneMKL
7474
if: steps.domain_check.outputs.result == 'true'
7575
run: |
76-
wget --progress=dot:giga https://registrationcenter-download.intel.com/akdlm/IRC_NAS/47c7d946-fca1-441a-b0df-b094e3f045ea/intel-onemkl-2025.2.0.629_offline.sh
77-
sudo bash intel-onemkl-2025.2.0.629_offline.sh -s -a -s --action install --eula accept
76+
wget --progress=dot:giga https://registrationcenter-download.intel.com/akdlm/IRC_NAS/2ad98b49-1fb2-4294-ab3d-6889b434ebd3/intel-onemkl-2025.3.0.462_offline.sh
77+
sudo bash intel-onemkl-2025.3.0.462_offline.sh -s -a -s --action install --eula accept
7878
- name: Configure/Build for a domain
7979
if: steps.domain_check.outputs.result == 'true'
8080
run: |

cmake/mkl/MKLConfig.cmake

Lines changed: 66 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,12 @@
5656
# ENABLE_CDFT: Enables cluster DFT library in MKL::MKL
5757
# ENABLE_SCALAPACK: Enables cluster LAPACK library in MKL::MKL
5858
# ENABLE_OMP_OFFLOAD: Enables OpenMP Offload functionality in MKL::MKL
59-
# ENABLE_TRY_SYCL_COMPILE: Enables compiling a test program that calls a oneMKL DPC++ API
59+
# ENABLE_TRY_SYCL_COMPILE: Enables compiling a test program that calls a oneMKL SYCL API
60+
#-----------------------------------
61+
# Special options (AUTO by default)
62+
#-----------------------------------
63+
# ENABLE_SYCL_COMPILER: Enables or disables treating the C++ compiler as a SYCL compiler.
64+
# By default, the compiler will be checked if it is a SYCL compiler.
6065
#
6166
#==================
6267
# Output parameters
@@ -150,13 +155,16 @@ foreach(lang ${languages})
150155
endforeach()
151156
list(REMOVE_DUPLICATES CURR_LANGS)
152157

153-
option(ENABLE_BLAS95 "Enables BLAS Fortran95 API" OFF)
154-
option(ENABLE_LAPACK95 "Enables LAPACK Fortran95 API" OFF)
155-
option(ENABLE_BLACS "Enables cluster BLAS library" OFF)
156-
option(ENABLE_CDFT "Enables cluster DFT library" OFF)
157-
option(ENABLE_SCALAPACK "Enables cluster LAPACK library" OFF)
158-
option(ENABLE_OMP_OFFLOAD "Enables OpenMP Offload functionality" OFF)
159-
option(ENABLE_TRY_SYCL_COMPILE "Enables compiling a oneMKL DPC++ test program" OFF)
158+
option(ENABLE_BLAS95 "Enables BLAS Fortran95 API" OFF)
159+
option(ENABLE_LAPACK95 "Enables LAPACK Fortran95 API" OFF)
160+
option(ENABLE_BLACS "Enables cluster BLAS library" OFF)
161+
option(ENABLE_CDFT "Enables cluster DFT library" OFF)
162+
option(ENABLE_SCALAPACK "Enables cluster LAPACK library" OFF)
163+
option(ENABLE_OMP_OFFLOAD "Enables OpenMP Offload functionality" OFF)
164+
option(ENABLE_TRY_SYCL_COMPILE "Enables compiling a oneMKL SYCL test program" OFF)
165+
166+
set(ENABLE_SYCL_COMPILER AUTO CACHE STRING "Enable SYCL compiler support")
167+
set_property(CACHE ENABLE_SYCL_COMPILER PROPERTY STRINGS AUTO ON OFF)
160168

161169
# Use MPI if any of these are enabled
162170
if(ENABLE_BLACS OR ENABLE_CDFT OR ENABLE_SCALAPACK)
@@ -225,11 +233,38 @@ if(CMAKE_Fortran_COMPILER)
225233
endif()
226234

227235
# Determine Compiler Family
228-
if(CXX_COMPILER_NAME STREQUAL "dpcpp" OR CXX_COMPILER_NAME STREQUAL "dpcpp.exe"
229-
OR CXX_COMPILER_NAME STREQUAL "icpx" OR CXX_COMPILER_NAME STREQUAL "icx.exe"
230-
OR CXX_COMPILER_NAME STREQUAL "mpiicpx" OR CXX_COMPILER_NAME STREQUAL "mpiicx.bat")
231-
set(SYCL_COMPILER ON)
232-
endif()
236+
if(ENABLE_SYCL_COMPILER STREQUAL "AUTO") # default
237+
# Check Intel oneAPI Compiler binary name for SYCL support
238+
if(CXX_COMPILER_NAME STREQUAL "dpcpp" OR CXX_COMPILER_NAME STREQUAL "dpcpp.exe"
239+
OR CXX_COMPILER_NAME STREQUAL "icpx" OR CXX_COMPILER_NAME STREQUAL "icx.exe"
240+
OR CXX_COMPILER_NAME STREQUAL "mpiicpx" OR CXX_COMPILER_NAME STREQUAL "mpiicx.bat")
241+
set(SYCL_COMPILER ON)
242+
else() # Non-Intel oneAPI Compilers
243+
# Slower but robust check for SYCL support in non-Intel oneAPI compilers
244+
if("CXX" IN_LIST CURR_LANGS AND
245+
(NOT CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_CXX_COMPILER_ID STREQUAL "MSVC"))
246+
include(CheckCXXCompilerFlag)
247+
include(CheckIncludeFileCXX)
248+
# Check SYCL flag support by the compiler
249+
check_cxx_compiler_flag("-fsycl" COMPILER_FSYCL_SUPPORT)
250+
if(COMPILER_FSYCL_SUPPORT)
251+
# Check SYCL header support by the compiler
252+
CHECK_INCLUDE_FILE_CXX("sycl/sycl.hpp" SYCL_SYCL_HPP "-fsycl")
253+
if(NOT SYCL_SYCL_HPP)
254+
CHECK_INCLUDE_FILE_CXX("CL/sycl.hpp" SYCL_CL_HPP "-fsycl")
255+
endif()
256+
if(SYCL_SYCL_HPP OR SYCL_CL_HPP)
257+
set(SYCL_COMPILER ON)
258+
endif()
259+
endif() # COMPILER_FSYCL_SUPPORT
260+
endif() # CXX IN_LIST CURR_LANGS
261+
endif() # CXX_COMPILER_NAME
262+
elseif(ENABLE_SYCL_COMPILER)
263+
# Using the "ON" option with a non-SYCL compiler may lead to unexpected behavior.
264+
set(SYCL_COMPILER ON)
265+
else()
266+
set(SYCL_COMPILER OFF)
267+
endif() # ENABLE_SYCL_COMPILER
233268
if(C_COMPILER_NAME MATCHES "^clang" OR CXX_COMPILER_NAME MATCHES "^clang")
234269
set(CLANG_COMPILER ON)
235270
endif()
@@ -365,6 +400,15 @@ endif()
365400
define_param(MKL_LINK DEFAULT_MKL_LINK MKL_LINK_LIST)
366401
check_required_vars(MKL_LINK)
367402

403+
if(MKL_LINK STREQUAL "static" AND ENABLE_OMP_OFFLOAD)
404+
mkl_message(WARNING "oneMKL SYCL static library is deprecated and will be removed in the oneMKL 2026.0 release")
405+
elseif(MKL_SYCL_LINK AND MKL_SYCL_LINK STREQUAL "static")
406+
mkl_message(STATUS "oneMKL SYCL static library is deprecated and will be removed in the oneMKL 2026.0 release")
407+
add_custom_target(MKL_SYCL_STATIC_MESSAGE
408+
COMMAND ${CMAKE_COMMAND} -E cmake_echo_color --red
409+
"Warning: oneMKL SYCL static library is deprecated and will be removed in the oneMKL 2026.0 release")
410+
endif()
411+
368412
# Define MKL_INTERFACE
369413
if(SYCL_COMPILER)
370414
if(MKL_INTERFACE AND NOT DEFINED MKL_SYCL_INTERFACE_FULL)
@@ -793,24 +837,24 @@ foreach(lib ${MKL_REQUESTED_LIBRARIES})
793837
endif()
794838
string(TOUPPER ${MKL_SYCL_DOMAIN} MKL_SYCL_DOMAIN)
795839
if(MKL_SYCL_DOMAIN STREQUAL "DFT")
796-
mkl_message(STATUS "Could NOT find MKL ${lib} for targets MKL::MKL_SYCL::${MKL_SYCL_DOMAIN} and MKL::MKL_SYCL_DISTRIBUTED_DFT")
840+
mkl_message(STATUS "Could NOT find ${lib} for targets MKL::MKL_SYCL::${MKL_SYCL_DOMAIN} and MKL::MKL_SYCL_DISTRIBUTED_DFT")
797841
else()
798-
mkl_message(STATUS "Could NOT find MKL ${lib} for target MKL::MKL_SYCL::${MKL_SYCL_DOMAIN}")
842+
mkl_message(STATUS "Could NOT find ${lib} for target MKL::MKL_SYCL::${MKL_SYCL_DOMAIN}")
799843
endif()
800844
else()
801845
if(NOT USE_MPI AND (${lib} MATCHES "mkl_scalapack" OR ${lib} MATCHES "mkl_blacs" OR ${lib} MATCHES "mkl_cdft" OR ${lib} STREQUAL "mkl_sycl_distributed_dft")
802846
AND ${${lib}_file} STREQUAL "${lib}_file-NOTFOUND")
803847
if(${lib} MATCHES "mkl_scalapack")
804-
mkl_message(STATUS "Could NOT find MKL ${lib} for target MKL::MKL_SCALAPACK")
848+
mkl_message(STATUS "Could NOT find ${lib} for target MKL::MKL_SCALAPACK")
805849
endif()
806850
if(${lib} MATCHES "mkl_cdft")
807-
mkl_message(STATUS "Could NOT find MKL ${lib} for target MKL::MKL_CDFT")
851+
mkl_message(STATUS "Could NOT find ${lib} for target MKL::MKL_CDFT")
808852
endif()
809853
if(${lib} MATCHES "mkl_blacs")
810-
mkl_message(STATUS "Could NOT find MKL ${lib} for targets MKL::MKL_SCALAPACK, MKL::MKL_CDFT, and MKL::MKL_BLACS")
854+
mkl_message(STATUS "Could NOT find ${lib} for targets MKL::MKL_SCALAPACK, MKL::MKL_CDFT, and MKL::MKL_BLACS")
811855
endif()
812856
if(${lib} STREQUAL "mkl_sycl_distributed_dft")
813-
mkl_message(STATUS "Could NOT find MKL ${lib} for target MKL::MKL_SYCL_DISTRIBUTED_DFT")
857+
mkl_message(STATUS "Could NOT find ${lib} for target MKL::MKL_SYCL_DISTRIBUTED_DFT")
814858
endif()
815859
else()
816860
check_required_vars(${lib}_file)
@@ -1027,6 +1071,7 @@ if(SYCL_COMPILER)
10271071
if(NOT TARGET MKL::MKL_SYCL)
10281072
add_library(MKL::MKL_SYCL INTERFACE IMPORTED GLOBAL)
10291073
add_library(MKL::MKL_DPCPP ALIAS MKL::MKL_SYCL)
1074+
add_dependencies(MKL::MKL_SYCL MKL_SYCL_STATIC_MESSAGE)
10301075
endif()
10311076
target_compile_options(MKL::MKL_SYCL INTERFACE $<$<COMPILE_LANGUAGE:CXX>:${MKL_SYCL_COPT}>)
10321077
target_link_libraries(MKL::MKL_SYCL INTERFACE ${MKL_SYCL_LINK_LINE} ${MKL_SYCL_THREAD_LIB} ${MKL_SYCL_SUPP_LINK})
@@ -1039,6 +1084,7 @@ if(SYCL_COMPILER)
10391084
endif()
10401085
string(TOUPPER ${MKL_SYCL_DOMAIN} MKL_SYCL_DOMAIN)
10411086
add_library(MKL::MKL_SYCL::${MKL_SYCL_DOMAIN} INTERFACE IMPORTED GLOBAL)
1087+
add_dependencies(MKL::MKL_SYCL::${MKL_SYCL_DOMAIN} MKL_SYCL_STATIC_MESSAGE)
10421088
target_compile_options(MKL::MKL_SYCL::${MKL_SYCL_DOMAIN} INTERFACE $<$<COMPILE_LANGUAGE:CXX>:${MKL_SYCL_COPT}>)
10431089
# Only dynamic link has domain specific libraries
10441090
# Domain specific targets still use mkl_sycl for static
@@ -1279,7 +1325,7 @@ if(ENABLE_TRY_SYCL_COMPILE AND "CXX" IN_LIST CURR_LANGS AND SYCL_COMPILER AND MK
12791325
unset(CMAKE_REQUIRED_LIBRARIES)
12801326
if(NOT MKL_TRY_SYCL_COMPILE)
12811327
mkl_not_found_and_return("The SYCL compiler \"${CMAKE_CXX_COMPILER}\" is not able to \
1282-
compile a simple test program that calls a oneMKL DPC++ API. \
1328+
compile a simple test program that calls a oneMKL SYCL API. \
12831329
See \"CMakeError.log\" for details. Besides environment issues, \
12841330
this could be caused by a compiler version that is incompatible \
12851331
with oneMKL ${${CMAKE_FIND_PACKAGE_NAME}_VERSION}.")

cmake/mkl/MKLConfigVersion.cmake

Lines changed: 27 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,36 +17,50 @@
1717
# SPDX-License-Identifier: Apache-2.0
1818
#===============================================================================
1919

20-
set(PACKAGE_VERSION "2025.2.0")
20+
set(PACKAGE_VERSION "2025.3.0")
2121

2222
if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION)
2323
set(PACKAGE_VERSION_COMPATIBLE FALSE)
2424
else()
2525

26-
if("2025.2.0" MATCHES "^([0-9]+)\\.")
26+
if("2025.3.0" MATCHES "^([0-9]+)\\.")
2727
set(CVF_VERSION_MAJOR "${CMAKE_MATCH_1}")
28+
if(NOT CVF_VERSION_MAJOR VERSION_EQUAL 0)
29+
string(REGEX REPLACE "^0+" "" CVF_VERSION_MAJOR "${CVF_VERSION_MAJOR}")
30+
endif()
2831
else()
29-
set(CVF_VERSION_MAJOR "2025.2.0")
32+
set(CVF_VERSION_MAJOR "2025.3.0")
3033
endif()
3134

32-
if(PACKAGE_FIND_VERSION_MAJOR STREQUAL CVF_VERSION_MAJOR)
33-
set(PACKAGE_VERSION_COMPATIBLE TRUE)
35+
if(PACKAGE_FIND_VERSION_RANGE)
36+
# both endpoints of the range must have the expected major version
37+
math (EXPR CVF_VERSION_MAJOR_NEXT "${CVF_VERSION_MAJOR} + 1")
38+
if (NOT PACKAGE_FIND_VERSION_MIN_MAJOR STREQUAL CVF_VERSION_MAJOR
39+
OR ((PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "INCLUDE" AND NOT PACKAGE_FIND_VERSION_MAX_MAJOR STREQUAL CVF_VERSION_MAJOR)
40+
OR (PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "EXCLUDE" AND NOT PACKAGE_FIND_VERSION_MAX VERSION_LESS_EQUAL CVF_VERSION_MAJOR_NEXT)))
41+
set(PACKAGE_VERSION_COMPATIBLE FALSE)
42+
elseif(PACKAGE_FIND_VERSION_MIN_MAJOR STREQUAL CVF_VERSION_MAJOR
43+
AND ((PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "INCLUDE" AND PACKAGE_VERSION VERSION_LESS_EQUAL PACKAGE_FIND_VERSION_MAX)
44+
OR (PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "EXCLUDE" AND PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION_MAX)))
45+
set(PACKAGE_VERSION_COMPATIBLE TRUE)
46+
else()
47+
set(PACKAGE_VERSION_COMPATIBLE FALSE)
48+
endif()
3449
else()
35-
set(PACKAGE_VERSION_COMPATIBLE FALSE)
36-
endif()
50+
if(PACKAGE_FIND_VERSION_MAJOR STREQUAL CVF_VERSION_MAJOR)
51+
set(PACKAGE_VERSION_COMPATIBLE TRUE)
52+
else()
53+
set(PACKAGE_VERSION_COMPATIBLE FALSE)
54+
endif()
3755

38-
if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION)
56+
if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION)
3957
set(PACKAGE_VERSION_EXACT TRUE)
58+
endif()
4059
endif()
4160
endif()
4261

4362

4463

45-
if("FALSE")
46-
return()
47-
endif()
48-
49-
5064
if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "" OR "" STREQUAL "")
5165
return()
5266
endif()

0 commit comments

Comments
 (0)