Skip to content

Commit 5231beb

Browse files
authored
Toolchain: Block installation of prebuilt libtorch when enabling MKL (deepmodeling#7525)
* Toolchain: Block installation of prebuilt libtorch when enabling MKL * Remove dead CMake logic
1 parent 353b417 commit 5231beb

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

CMakeLists.txt

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -691,11 +691,7 @@ if(ENABLE_MLALGO OR DEFINED Torch_DIR)
691691
set_if_higher(CMAKE_CXX_STANDARD 14)
692692
endif()
693693
include_directories(${TORCH_INCLUDE_DIRS})
694-
if(MKL_FOUND)
695-
list(PREPEND math_libs ${TORCH_LIBRARIES})
696-
else()
697-
list(APPEND math_libs ${TORCH_LIBRARIES})
698-
endif()
694+
list(APPEND math_libs ${TORCH_LIBRARIES})
699695
add_compile_options(${TORCH_CXX_FLAGS})
700696
endif()
701697

toolchain/scripts/lib/config_manager.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -567,6 +567,11 @@ config_apply_env_logic() {
567567
echo "Using MKL, so fftw is disabled."
568568
CONFIG_CACHE["with_fftw"]="__DONTUSE__"
569569
fi
570+
if [ "${CONFIG_CACHE[with_libtorch]}" = "__INSTALL__" ]; then
571+
report_error ${LINENO} \
572+
"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=<path>."
573+
exit 1
574+
fi
570575
fi
571576

572577
# Select the correct compute number based on the GPU architecture

0 commit comments

Comments
 (0)