Skip to content

Commit

Permalink
support wget third_party.tar.gz (PaddlePaddle#66479)
Browse files Browse the repository at this point in the history
  • Loading branch information
risemeup1 authored and lixcli committed Aug 5, 2024
1 parent cfde92a commit 99f9d0f
Showing 1 changed file with 29 additions and 2 deletions.
31 changes: 29 additions & 2 deletions cmake/third_party.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,35 @@ if(NOT WITH_SETUP_INSTALL)
WORKING_DIRECTORY ${PADDLE_SOURCE_DIR}
RESULT_VARIABLE result_var)
if(NOT result_var EQUAL 0)
message(
FATAL_ERROR "Failed to update submodule, please check your network !")
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
set(THIRD_PARTY_TAR_URL
https://xly-devops.bj.bcebos.com/PR/build_whl/0/third_party.tar.gz
CACHE STRING "third_party.tar.gz url")
execute_process(
COMMAND wget -q ${THIRD_PARTY_TAR_URL}
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
RESULT_VARIABLE wget_result)
if(NOT wget_result EQUAL 0)
message(
FATAL_ERROR
"Failed to download third_party.tar.gz, please check your network !"
)
else()
execute_process(
COMMAND tar -xzf third_party.tar.gz -C ${CMAKE_SOURCE_DIR}/
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
RESULT_VARIABLE tar_result)
if(NOT tar_result EQUAL 0)
message(
FATAL_ERROR
"Failed to extract third_party.tar.gz, please make sure tar.gz file is not corrupted !"
)
endif()
endif()
else()
message(
FATAL_ERROR "Failed to update submodule, please check your network !")
endif()
endif()

endif()
Expand Down

0 comments on commit 99f9d0f

Please sign in to comment.