From f893914f1f8524df6cc9be7b5850522580d36261 Mon Sep 17 00:00:00 2001 From: wopeizl Date: Fri, 31 May 2019 18:25:59 +0800 Subject: [PATCH] fix the dll not found issue on windows (#17750) * fix the dll not found issue on windows --- cmake/external/mklml.cmake | 3 ++- python/setup.py.in | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/cmake/external/mklml.cmake b/cmake/external/mklml.cmake index 142fce816de..f312f2ce067 100644 --- a/cmake/external/mklml.cmake +++ b/cmake/external/mklml.cmake @@ -34,10 +34,11 @@ SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_RPATH}" "${MKLML_ROOT}/lib") SET(TIME_VERSION "2019.0.1.20181227") IF(WIN32) SET(MKLML_VER "mklml_win_${TIME_VERSION}" CACHE STRING "" FORCE) - SET(MKLML_URL "https://paddlepaddledeps.bj.bcebos.com/${MKLML_VER}.zip" CACHE STRING "" FORCE) + SET(MKLML_URL "https://paddlepaddledeps.cdn.bcebos.com/${MKLML_VER}.zip" CACHE STRING "" FORCE) SET(MKLML_LIB ${MKLML_LIB_DIR}/mklml.lib) SET(MKLML_IOMP_LIB ${MKLML_LIB_DIR}/libiomp5md.lib) SET(MKLML_SHARED_LIB ${MKLML_LIB_DIR}/mklml.dll) + SET(MKLML_SHARED_LIB_DEPS ${MKLML_LIB_DIR}/msvcr120.dll) SET(MKLML_SHARED_IOMP_LIB ${MKLML_LIB_DIR}/libiomp5md.dll) ELSE() #TODO(intel-huying): diff --git a/python/setup.py.in b/python/setup.py.in index 7d04dadb037..764b3ea6fe7 100644 --- a/python/setup.py.in +++ b/python/setup.py.in @@ -165,6 +165,10 @@ if '${WITH_MKL}' == 'ON': shutil.copy('${MKLML_SHARED_LIB}', libs_path) shutil.copy('${MKLML_SHARED_IOMP_LIB}', libs_path) package_data['paddle.libs']+=[('libmklml_intel' if os.name != 'nt' else 'mklml') + ext_name, ('libiomp5' if os.name != 'nt' else 'libiomp5md') + ext_name] + # mklml has dependency to vs runtime library + if os.name == 'nt': + shutil.copy('${MKLML_SHARED_LIB_DEPS}', libs_path) + package_data['paddle.libs'] += ['msvcr120.dll'] else: if os.name == 'nt': # copy the openblas.dll -- GitLab