diff --git a/cmake/external/boost.cmake b/cmake/external/boost.cmake index f14195480b7dc80df0566c9b09075797010fe289..d88d693d8286d1efab5242fb758331ef64663a4d 100644 --- a/cmake/external/boost.cmake +++ b/cmake/external/boost.cmake @@ -46,6 +46,7 @@ ExternalProject_Add( ${BOOST_PROJECT} ${EXTERNAL_PROJECT_LOG_ARGS} "${BOOST_DOWNLOAD_CMD}" + URL_MD5 f891e8c2c9424f0565f0129ad9ab4aff PREFIX ${BOOST_PREFIX_DIR} DOWNLOAD_DIR ${BOOST_SOURCE_DIR} SOURCE_DIR ${BOOST_SOURCE_DIR} diff --git a/cmake/external/mkldnn.cmake b/cmake/external/mkldnn.cmake index 5ea03e6ea481eb18efb422301091d0b98fa4cc72..ce5603b24b687daacea784c96fc00b828e513c97 100644 --- a/cmake/external/mkldnn.cmake +++ b/cmake/external/mkldnn.cmake @@ -110,7 +110,7 @@ if(WIN32) add_custom_command(TARGET ${MKLDNN_PROJECT} POST_BUILD VERBATIM COMMAND echo EXPORTS >> ${MKLDNN_INSTALL_DIR}/bin/mkldnn.def) add_custom_command(TARGET ${MKLDNN_PROJECT} POST_BUILD VERBATIM - COMMAND echo off &&(for /f "skip=19 tokens=4" %A in (${MKLDNN_INSTALL_DIR}/bin/exports.txt) do echo %A >> ${MKLDNN_INSTALL_DIR}/bin/mkldnn.def)&& echo on) + COMMAND echo off && (for /f "skip=19 tokens=4" %A in (${MKLDNN_INSTALL_DIR}/bin/exports.txt) do echo %A >> ${MKLDNN_INSTALL_DIR}/bin/mkldnn.def) && echo on) add_custom_command(TARGET ${MKLDNN_PROJECT} POST_BUILD VERBATIM COMMAND lib /def:${MKLDNN_INSTALL_DIR}/bin/mkldnn.def /out:${MKLDNN_INSTALL_DIR}/bin/mkldnn.lib /machine:x64) else(WIN32) diff --git a/cmake/external/mklml.cmake b/cmake/external/mklml.cmake index 4cf9b626d15472206f47cd604d0b5b87089c4476..d99cb1952951c4c9e1ac7d7b1d727d28e8750ec6 100644 --- a/cmake/external/mklml.cmake +++ b/cmake/external/mklml.cmake @@ -24,6 +24,7 @@ SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_RPATH}" "${MKLML_ROOT}/lib") IF(WIN32) SET(MKLML_VER "mklml_win_2019.0.5.20190502" CACHE STRING "" FORCE) SET(MKLML_URL "https://paddlepaddledeps.bj.bcebos.com/${MKLML_VER}.zip" CACHE STRING "" FORCE) + SET(MKLML_URL_MD5 ff8c5237570f03eea37377ccfc95a08a) 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) @@ -33,6 +34,7 @@ ELSE() # Now enable csrmm function in mklml library temporarily, it will be updated as offical version later. SET(MKLML_VER "csrmm_mklml_lnx_2019.0.5" CACHE STRING "" FORCE) SET(MKLML_URL "http://paddlepaddledeps.bj.bcebos.com/${MKLML_VER}.tgz" CACHE STRING "" FORCE) + SET(MKLML_URL_MD5 bc6a7faea6a2a9ad31752386f3ae87da) SET(MKLML_LIB ${MKLML_LIB_DIR}/libmklml_intel.so) SET(MKLML_IOMP_LIB ${MKLML_LIB_DIR}/libiomp5.so) SET(MKLML_SHARED_LIB ${MKLML_LIB_DIR}/libmklml_intel.so) @@ -52,6 +54,7 @@ ExternalProject_Add( ${MKLML_PROJECT} ${EXTERNAL_PROJECT_LOG_ARGS} "${MKLML_DOWNLOAD_CMD}" + URL_MD5 ${MKLML_URL_MD5} PREFIX ${MKLML_PREFIX_DIR} DOWNLOAD_DIR ${MKLML_SOURCE_DIR} SOURCE_DIR ${MKLML_SOURCE_DIR} diff --git a/cmake/third_party.cmake b/cmake/third_party.cmake index 2ae4518c9dfd78530715ce834851a79af72ac7ef..d33edef38ca7b36ce0b0474407ae7363884bfdaa 100644 --- a/cmake/third_party.cmake +++ b/cmake/third_party.cmake @@ -108,13 +108,18 @@ ENDMACRO() # 2. NAME: The name of file, that determin the dirname # FUNCTION(file_download_and_uncompress URL NAME) - MESSAGE(STATUS "Download dependence[${NAME}] from ${URL}") + set(options "") + set(oneValueArgs MD5) + set(multiValueArgs "") + cmake_parse_arguments(URL "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) + MESSAGE(STATUS "Download dependence[${NAME}] from ${URL}, MD5: ${URL_MD5}") SET(${NAME}_INCLUDE_DIR ${THIRD_PARTY_PATH}/${NAME}/data PARENT_SCOPE) ExternalProject_Add( download_${NAME} ${EXTERNAL_PROJECT_LOG_ARGS} PREFIX ${THIRD_PARTY_PATH}/${NAME} URL ${URL} + URL_MD5 ${URL_MD5} TIMEOUT 120 DOWNLOAD_DIR ${THIRD_PARTY_PATH}/${NAME}/data/ SOURCE_DIR ${THIRD_PARTY_PATH}/${NAME}/data/ @@ -244,7 +249,7 @@ if(WITH_GPU) list(APPEND third_party_deps extern_cub) endif() set(URL "https://paddlepaddledeps.bj.bcebos.com/externalErrorMsg.tar.gz" CACHE STRING "" FORCE) - file_download_and_uncompress(${URL} "externalError") # download file externalErrorMsg.tar.gz + file_download_and_uncompress(${URL} "externalError" MD5 c0749523ebb536eb7382487d645d9cd4) # download file externalErrorMsg.tar.gz if(WITH_TESTING) # copy externalErrorMsg.pb for unittest 'enforce_test' set(SRC_DIR ${THIRD_PARTY_PATH}/externalError/data)