From 8bbd1d4289ab277d07bae6a3d2b6fc4f5b7ada16 Mon Sep 17 00:00:00 2001 From: Growl Date: Fri, 26 Jun 2026 16:43:14 +0800 Subject: [PATCH 1/2] Toolchain: Block installation of prebuilt libtorch when enabling MKL --- toolchain/scripts/lib/config_manager.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/toolchain/scripts/lib/config_manager.sh b/toolchain/scripts/lib/config_manager.sh index 65ea5740d26..fc7ca306837 100644 --- a/toolchain/scripts/lib/config_manager.sh +++ b/toolchain/scripts/lib/config_manager.sh @@ -567,6 +567,11 @@ config_apply_env_logic() { echo "Using MKL, so fftw is disabled." CONFIG_CACHE["with_fftw"]="__DONTUSE__" fi + if [ "${CONFIG_CACHE[with_libtorch]}" = "__INSTALL__" ]; then + report_error ${LINENO} \ + "Installing the current prebuilt libtorch package is disabled for oneMKL builds due to known conflicts between bundled and externally linked oneMKL libraries. Please provide a compatible libtorch installation via --with-libtorch=system or --with-libtorch=." + exit 1 + fi fi # Select the correct compute number based on the GPU architecture From 7949204f25cd4826209e5bbb863493f71961e781 Mon Sep 17 00:00:00 2001 From: Growl Date: Fri, 26 Jun 2026 17:48:25 +0800 Subject: [PATCH 2/2] Remove dead CMake logic --- CMakeLists.txt | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8f85893c47e..7675f569d0a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -691,11 +691,7 @@ if(ENABLE_MLALGO OR DEFINED Torch_DIR) set_if_higher(CMAKE_CXX_STANDARD 14) endif() include_directories(${TORCH_INCLUDE_DIRS}) - if(MKL_FOUND) - list(PREPEND math_libs ${TORCH_LIBRARIES}) - else() - list(APPEND math_libs ${TORCH_LIBRARIES}) - endif() + list(APPEND math_libs ${TORCH_LIBRARIES}) add_compile_options(${TORCH_CXX_FLAGS}) endif()