Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[cmake] fix file check #54614

Merged
merged 4 commits into from
Jun 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 5 additions & 8 deletions cmake/external/cusparselt.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -65,16 +65,13 @@ function(download_cusparselt)
endif()
endfunction()

find_file(
LOCAL_CUSPARSELT_LIB_ZIP
NAMES ${CUSPARSELT_CACHE_FILENAME}
PATHS ${CUSPARSELT_DOWNLOAD_DIR}
NO_DEFAULT_PATH)

if(LOCAL_CUSPARSELT_LIB_ZIP)
if(EXISTS ${CUSPARSELT_DOWNLOAD_DIR}/${CUSPARSELT_CACHE_FILENAME})
file(MD5 ${CUSPARSELT_DOWNLOAD_DIR}/${CUSPARSELT_CACHE_FILENAME}
CUSPARSELT_MD5)
if(NOT CUSPARSELT_MD5 EQUAL CUSPARSELT_URL_MD5)
if(NOT CUSPARSELT_MD5 STREQUAL CUSPARSELT_URL_MD5)
# clean build file
file(REMOVE_RECURSE ${CUSPARSELT_PREFIX_DIR})
file(REMOVE_RECURSE ${CUSPARSELT_INSTALL_DIR})
download_cusparselt()
endif()
else()
Expand Down
13 changes: 5 additions & 8 deletions cmake/external/lapack.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -81,16 +81,13 @@ function(download_lapack)
endif()
endfunction()

find_file(
LOCAL_LAPACK_LIB_ZIP
NAMES ${LAPACK_FILE}
PATHS ${LAPACK_DOWNLOAD_DIR}
NO_DEFAULT_PATH)

# Download and check lapack.
if(LOCAL_LAPACK_LIB_ZIP)
if(EXISTS ${LAPACK_DOWNLOAD_DIR}/${LAPACK_FILE})
file(MD5 ${LAPACK_DOWNLOAD_DIR}/${LAPACK_FILE} LAPACK_MD5)
if(NOT LAPACK_MD5 EQUAL LAPACK_URL_MD5)
if(NOT LAPACK_MD5 STREQUAL LAPACK_URL_MD5)
# clean build file
file(REMOVE_RECURSE ${LAPACK_PREFIX_DIR})
file(REMOVE_RECURSE ${LAPACK_INSTALL_DIR})
download_lapack()
endif()
else()
Expand Down
13 changes: 5 additions & 8 deletions cmake/external/mklml.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -71,16 +71,13 @@ function(download_mklml)
endif()
endfunction()

find_file(
LOCAL_MKLML_LIB_ZIP
NAMES ${MKLML_FILE}
PATHS ${MKLML_DOWNLOAD_DIR}
NO_DEFAULT_PATH)

# Download and check mklml.
if(LOCAL_MKLML_LIB_ZIP)
if(EXISTS ${MKLML_DOWNLOAD_DIR}/${MKLML_FILE})
file(MD5 ${MKLML_DOWNLOAD_DIR}/${MKLML_FILE} MKLML_MD5)
if(NOT MKLML_MD5 EQUAL MKLML_URL_MD5)
if(NOT MKLML_MD5 STREQUAL MKLML_URL_MD5)
# clean build file
file(REMOVE_RECURSE ${MKLML_PREFIX_DIR})
file(REMOVE_RECURSE ${MKLML_INSTALL_DIR})
download_mklml()
endif()
else()
Expand Down
13 changes: 5 additions & 8 deletions cmake/external/onnxruntime.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -129,16 +129,13 @@ function(download_onnxruntime)
endif()
endfunction()

find_file(
LOCAL_ONNXRUNTIME_LIB_ZIP
NAMES ${ONNXRUNTIME_CACHE_FILENAME}
PATHS ${ONNXRUNTIME_DOWNLOAD_DIR}
NO_DEFAULT_PATH)

if(LOCAL_ONNXRUNTIME_LIB_ZIP)
if(EXISTS ${ONNXRUNTIME_DOWNLOAD_DIR}/${ONNXRUNTIME_CACHE_FILENAME})
file(MD5 ${ONNXRUNTIME_DOWNLOAD_DIR}/${ONNXRUNTIME_CACHE_FILENAME}
ONNXRUNTIME_MD5)
if(NOT ONNXRUNTIME_MD5 EQUAL ONNXRUNTIME_URL_MD5)
if(NOT ONNXRUNTIME_MD5 STREQUAL ONNXRUNTIME_URL_MD5)
# clean build file
file(REMOVE_RECURSE ${ONNXRUNTIME_PREFIX_DIR})
file(REMOVE_RECURSE ${ONNXRUNTIME_INSTALL_DIR})
download_onnxruntime()
endif()
else()
Expand Down